|
|
@ -116,6 +116,7 @@ namespace SqlSugar.ClickHouse |
|
|
|
CheckConnection(); |
|
|
|
ClickHouseCommand sqlCommand =connection.CreateCommand(); |
|
|
|
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)) |
|
|
|
{ |
|
|
|
var newName = param.ParameterName.TrimStart('@'); |
|
|
@ -144,6 +145,10 @@ namespace SqlSugar.ClickHouse |
|
|
|
{ |
|
|
|
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 |
|
|
|
{ |
|
|
|
sql = sql.Replace(param.ParameterName, "{" + newName + ":" + dbtype + "}"); |
|
|
|