mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
-
This commit is contained in:
parent
157d23705e
commit
53b12c9383
@ -224,20 +224,14 @@ namespace SqlSugar.OceanBaseForOracle
|
|||||||
}
|
}
|
||||||
if (orderParameters.Select(it => it.ParameterName).GroupBy(it => it).Where(it => it.Count() > 1).Any())
|
if (orderParameters.Select(it => it.ParameterName).GroupBy(it => it).Where(it => it.Count() > 1).Any())
|
||||||
{
|
{
|
||||||
|
orderParameters = parameters.Where(it => sql.Contains(it.ParameterName))
|
||||||
foreach (var param in parameters.OrderByDescending(it => it.ParameterName.Length))
|
.OrderBy(it => sql.IndexOf(it.ParameterName)).ToList();
|
||||||
{
|
|
||||||
sql = sql.Replace(param.ParameterName, helper.FormatValue(param.Value) + "");
|
|
||||||
}
|
}
|
||||||
orderParameters = new List<SugarParameter>();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var param in parameters.OrderByDescending(it => it.ParameterName.Length))
|
foreach (var param in parameters.OrderByDescending(it => it.ParameterName.Length))
|
||||||
{
|
{
|
||||||
sql = sql.Replace(param.ParameterName, "?");
|
sql = sql.Replace(param.ParameterName, "?");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
OdbcCommand sqlCommand = new OdbcCommand(sql, (OdbcConnection)this.Connection);
|
OdbcCommand sqlCommand = new OdbcCommand(sql, (OdbcConnection)this.Connection);
|
||||||
sqlCommand.CommandType = this.CommandType;
|
sqlCommand.CommandType = this.CommandType;
|
||||||
|
Loading…
Reference in New Issue
Block a user