mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 04:23:47 +08:00
Subqueryable.Where(List<IConditionalModel>))
This commit is contained in:
@@ -54,7 +54,17 @@ namespace SqlSugar
|
||||
argExp = ExpressionTool.DynamicInvoke(argExp) as Expression;
|
||||
}
|
||||
var result = "AND " + SubTools.GetMethodValue(copyContext, argExp, ResolveExpressType.WhereMultiple);
|
||||
|
||||
if (argExp.Type == typeof(List<IConditionalModel>))
|
||||
{
|
||||
var p = this.Context.Parameters.Last();
|
||||
this.Context.Parameters.Remove(p);
|
||||
var cols = p.Value 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 = "AND " + sqlObj.Key;
|
||||
this.Context.Parameters.AddRange(sqlObj.Value);
|
||||
return result;
|
||||
}
|
||||
if (this.Context.JoinIndex > 0 || pars.Count() > 1)
|
||||
{
|
||||
this.Context.Parameters.AddRange(copyContext.Parameters);
|
||||
|
@@ -57,7 +57,17 @@ namespace SqlSugar
|
||||
copyContext.IsSingle = false;
|
||||
}
|
||||
var result = "WHERE " + SubTools.GetMethodValue(copyContext, argExp, ResolveExpressType.WhereMultiple);
|
||||
|
||||
if (argExp.Type == typeof(List<IConditionalModel>))
|
||||
{
|
||||
var p= this.Context.Parameters.Last();
|
||||
this.Context.Parameters.Remove(p);
|
||||
var cols = p.Value 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)
|
||||
{
|
||||
this.Context.Parameters.AddRange(copyContext.Parameters);
|
||||
|
@@ -26,6 +26,10 @@ namespace SqlSugar
|
||||
{
|
||||
return this;
|
||||
}
|
||||
public Subqueryable<T> Where(List<IConditionalModel> conditionals)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
public Subqueryable<T> Where(Expression exp)
|
||||
{
|
||||
return this;
|
||||
|
@@ -150,6 +150,10 @@ namespace SqlSugar
|
||||
}
|
||||
public class Subqueryable<T1, T2, T3, T4, T5, T6> : Subqueryable<T1> where T1 : class, new()
|
||||
{
|
||||
public new Subqueryable<T1, T2, T3, T4, T5, T6> Where(List<IConditionalModel> conditionals)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
public Subqueryable<T1, T2, T3, T4, T5, T6, JoinType> InnerJoin<JoinType>(Func<T1, T2, T3, T4, T5, T6, JoinType, bool> expression)
|
||||
{
|
||||
return new Subqueryable<T1, T2, T3, T4, T5, T6, JoinType>();
|
||||
@@ -189,6 +193,10 @@ namespace SqlSugar
|
||||
}
|
||||
public class Subqueryable<T1, T2, T3, T4, T5> : Subqueryable<T1> where T1 : class, new()
|
||||
{
|
||||
public new Subqueryable<T1, T2, T3, T4,T5> Where(List<IConditionalModel> conditionals)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
public Subqueryable<T1, T2, T3, T4, T5, JoinType> InnerJoin<JoinType>(Func<T1, T2, T3, T4, T5, JoinType, bool> expression)
|
||||
{
|
||||
return new Subqueryable<T1, T2, T3, T4, T5, JoinType>();
|
||||
@@ -224,6 +232,10 @@ namespace SqlSugar
|
||||
}
|
||||
public class Subqueryable<T1, T2, T3, T4> : Subqueryable<T1> where T1 : class, new()
|
||||
{
|
||||
public new Subqueryable<T1, T2, T3,T4> Where(List<IConditionalModel> conditionals)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
public Subqueryable<T1, T2, T3, T4, JoinType> InnerJoin<JoinType>(Func<T1, T2, T3, T4, JoinType, bool> expression)
|
||||
{
|
||||
return new Subqueryable<T1, T2, T3, T4, JoinType>();
|
||||
@@ -324,6 +336,10 @@ namespace SqlSugar
|
||||
}
|
||||
public class Subqueryable<T1, T2, T3> : Subqueryable<T1> where T1 : class, new()
|
||||
{
|
||||
public new Subqueryable<T1, T2,T3> Where(List<IConditionalModel> conditionals)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
public Subqueryable<T1, T2, T3, JoinType> InnerJoin<JoinType>(Func<T1, T2, T3, JoinType, bool> expression)
|
||||
{
|
||||
return new Subqueryable<T1, T2, T3, JoinType>();
|
||||
@@ -420,6 +436,10 @@ namespace SqlSugar
|
||||
}
|
||||
public class Subqueryable<T1, T2> : Subqueryable<T1> where T1 : class, new()
|
||||
{
|
||||
public new Subqueryable<T1,T2> Where(List<IConditionalModel> conditionals)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
public Subqueryable<T1, T2, JoinType> InnerJoin<JoinType>(Func<T1, T2, JoinType, bool> expression)
|
||||
{
|
||||
return new Subqueryable<T1, T2, JoinType>();
|
||||
|
Reference in New Issue
Block a user