mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-03 20:27:56 +08:00
Update exp to sql
This commit is contained in:
parent
a3f1ccf23c
commit
c12647aafe
@ -743,15 +743,16 @@ namespace SqlSugar
|
||||
var listPar = model.Args[1].MemberValue as ListAnyParameter;
|
||||
foreach (var item in (model.Args[0].MemberValue as IList))
|
||||
{
|
||||
var sql = listPar.Sql;
|
||||
if (sb.Length > 3)
|
||||
{
|
||||
sb.Append("OR");
|
||||
}
|
||||
foreach (var columnInfo in listPar.Columns)
|
||||
{
|
||||
var replace = listPar.ConvetColumnFunc($"{listPar.Name}.{columnInfo.DbColumnName}");
|
||||
if (listPar.Sql.Contains(replace))
|
||||
if(sql.Contains(replace))
|
||||
{
|
||||
if (sb.Length>3)
|
||||
{
|
||||
sb.Append("OR");
|
||||
}
|
||||
var value = columnInfo.PropertyInfo.GetValue(item);
|
||||
var newValue = "null";
|
||||
if (value != null)
|
||||
@ -791,9 +792,10 @@ namespace SqlSugar
|
||||
newValue = value.ToSqlValue();
|
||||
}
|
||||
}
|
||||
sb.Append(listPar.Sql.Replace(replace, newValue));
|
||||
sql = sql.Replace(replace, newValue);
|
||||
}
|
||||
}
|
||||
sb.Append(sql);
|
||||
}
|
||||
sb.Append(" ) ");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user