Update exp to sql (SqlFunc.Exists)

This commit is contained in:
sunkaixuan
2022-10-20 09:02:32 +08:00
parent 13383f0e91
commit 676719104f

View File

@@ -1035,7 +1035,14 @@ namespace SqlSugar
List<IConditionalModel> conditionalModels = (List<IConditionalModel>) model.Args[1].MemberValue;
var sqlObj = this.Context.SugarContext.Context.Queryable<object>().SqlBuilder.ConditionalModelToSql(conditionalModels, 0);
model.Args[1].MemberName = sqlObj.Key;
this.Context.Parameters.AddRange(sqlObj.Value);
if (sqlObj.Value != null)
{
this.Context.Parameters.AddRange(sqlObj.Value);
}
else
{
return " 1=1 ";
}
}
return this.Context.DbMehtods.Exists(model);