|
@ -116,6 +116,7 @@ namespace SqlSugar.ClickHouse |
|
|
CheckConnection(); |
|
|
CheckConnection(); |
|
|
ClickHouseCommand sqlCommand =connection.CreateCommand(); |
|
|
ClickHouseCommand sqlCommand =connection.CreateCommand(); |
|
|
var pars = ToIDbDataParameter(parameters); |
|
|
var pars = ToIDbDataParameter(parameters); |
|
|
|
|
|
var arrayPars = parameters?.Where(it =>it.IsArray)?.Where(it=>it.ParameterName!=null)?.Select(it=>it.ParameterName); |
|
|
foreach (var param in pars.OrderByDescending(it=>it.ParameterName.Length)) |
|
|
foreach (var param in pars.OrderByDescending(it=>it.ParameterName.Length)) |
|
|
{ |
|
|
{ |
|
|
var newName = param.ParameterName.TrimStart('@'); |
|
|
var newName = param.ParameterName.TrimStart('@'); |
|
@ -144,6 +145,10 @@ namespace SqlSugar.ClickHouse |
|
|
{ |
|
|
{ |
|
|
sql = sql.Replace(param.ParameterName, "null"); |
|
|
sql = sql.Replace(param.ParameterName, "null"); |
|
|
} |
|
|
} |
|
|
|
|
|
else if (arrayPars != null&& arrayPars.Contains(param.ParameterName)) |
|
|
|
|
|
{ |
|
|
|
|
|
sql= sql.Replace(param.ParameterName, "'" +this.Context.Utilities.SerializeObject(param.Value).ToSqlFilter() + "'"); |
|
|
|
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
sql = sql.Replace(param.ParameterName, "{" + newName + ":" + dbtype + "}"); |
|
|
sql = sql.Replace(param.ParameterName, "{" + newName + ":" + dbtype + "}"); |
|
|