mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 16:18:47 +08:00
Synchronization code
This commit is contained in:
parent
4de68ea690
commit
44163a3078
@ -57,7 +57,7 @@ namespace SqlSugar
|
|||||||
copyContext.IsSingle = false;
|
copyContext.IsSingle = false;
|
||||||
}
|
}
|
||||||
var result = "WHERE " + SubTools.GetMethodValue(copyContext, argExp, ResolveExpressType.WhereMultiple);
|
var result = "WHERE " + SubTools.GetMethodValue(copyContext, argExp, ResolveExpressType.WhereMultiple);
|
||||||
if (argExp.Type == typeof(List<IConditionalModel>))
|
if (argExp.Type == typeof(List<IConditionalModel>)&& this.Context.Parameters.Any())
|
||||||
{
|
{
|
||||||
var p= this.Context.Parameters.Last();
|
var p= this.Context.Parameters.Last();
|
||||||
this.Context.Parameters.Remove(p);
|
this.Context.Parameters.Remove(p);
|
||||||
@ -68,6 +68,15 @@ namespace SqlSugar
|
|||||||
this.Context.Parameters.AddRange(sqlObj.Value);
|
this.Context.Parameters.AddRange(sqlObj.Value);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
else if (argExp.Type == typeof(List<IConditionalModel>) && !this.Context.Parameters.Any())
|
||||||
|
{
|
||||||
|
var cols = ExpressionTool.DynamicInvoke(((expression as MethodCallExpression).Arguments[0])) as List<IConditionalModel>;
|
||||||
|
var sqlObj = this.Context.SugarContext.QueryBuilder.Builder.ConditionalModelToSql(cols, this.Context.ParameterIndex * 100);
|
||||||
|
this.Context.ParameterIndex = this.Context.ParameterIndex + this.Context.ParameterIndex * 100;
|
||||||
|
result = "WHERE " + sqlObj.Key;
|
||||||
|
this.Context.Parameters.AddRange(sqlObj.Value);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
if (this.Context.JoinIndex > 0 ||pars.Count() > 1)
|
if (this.Context.JoinIndex > 0 ||pars.Count() > 1)
|
||||||
{
|
{
|
||||||
this.Context.Parameters.AddRange(copyContext.Parameters);
|
this.Context.Parameters.AddRange(copyContext.Parameters);
|
||||||
|
Loading…
Reference in New Issue
Block a user