mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-16 16:50:41 +08:00
Add : db.Utilities.ConditionalModelsToSql
This commit is contained in:
parent
6f0dbe563d
commit
f61f2273ff
@ -1119,6 +1119,12 @@ namespace SqlSugar
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Conditional
|
#region Conditional
|
||||||
|
public KeyValuePair<string, SugarParameter[]> ConditionalModelsToSql(List<IConditionalModel> conditionalModels,int beginIndex=0)
|
||||||
|
{
|
||||||
|
var sqlBuilder=InstanceFactory.GetSqlBuilderWithContext(this.Context);
|
||||||
|
var result=sqlBuilder.ConditionalModelToSql(conditionalModels,beginIndex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
public List<IConditionalModel> JsonToConditionalModels(string json)
|
public List<IConditionalModel> JsonToConditionalModels(string json)
|
||||||
{
|
{
|
||||||
List<IConditionalModel> conditionalModels = new List<IConditionalModel>();
|
List<IConditionalModel> conditionalModels = new List<IConditionalModel>();
|
||||||
@ -1212,5 +1218,6 @@ namespace SqlSugar
|
|||||||
return (this.Context.Queryable<T>() as QueryableProvider<T>).GetTreeRoot(childListExpression, parentIdExpression, pk, list, rootValue);
|
return (this.Context.Queryable<T>() as QueryableProvider<T>).GetTreeRoot(childListExpression, parentIdExpression, pk, list, rootValue);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,11 @@ namespace SqlSugar
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static ISqlBuilder GetSqlBuilderWithContext(ISqlSugarClient db)
|
||||||
|
{
|
||||||
|
var result= GetQueryBuilderWithContext(db).Builder;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
public static ISqlBuilder GetSqlbuilder(ConnectionConfig currentConnectionConfig)
|
public static ISqlBuilder GetSqlbuilder(ConnectionConfig currentConnectionConfig)
|
||||||
{
|
{
|
||||||
if (currentConnectionConfig.DbType == DbType.SqlServer)
|
if (currentConnectionConfig.DbType == DbType.SqlServer)
|
||||||
|
@ -50,5 +50,6 @@ namespace SqlSugar
|
|||||||
List<IConditionalModel> JsonToConditionalModels(string json);
|
List<IConditionalModel> JsonToConditionalModels(string json);
|
||||||
DataTable DictionaryListToDataTable(List<Dictionary<string, object>> dictionaryList);
|
DataTable DictionaryListToDataTable(List<Dictionary<string, object>> dictionaryList);
|
||||||
List<T> ToTree<T>(List<T> list, Expression<Func<T, IEnumerable<object>>> childListExpression, Expression<Func<T, object>> parentIdExpression, Expression<Func<T, object>> pkExpression, object rootValue);
|
List<T> ToTree<T>(List<T> list, Expression<Func<T, IEnumerable<object>>> childListExpression, Expression<Func<T, object>> parentIdExpression, Expression<Func<T, object>> pkExpression, object rootValue);
|
||||||
|
KeyValuePair<string, SugarParameter[]> ConditionalModelsToSql(List<IConditionalModel> conditionalModels, int beginIndex = 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user