mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Update json 2 sql
This commit is contained in:
parent
3abcb60598
commit
e991dd337b
@ -113,7 +113,7 @@ namespace SqlSugar
|
||||
var parname = GetParameterName(pars, parvalue);
|
||||
return parname;
|
||||
}
|
||||
private int GetParameterNameIndex = 100;
|
||||
internal int GetParameterNameIndex = 100;
|
||||
|
||||
private string GetParameterName(List<SugarParameter> pars, object parvalue)
|
||||
{
|
||||
|
@ -30,6 +30,7 @@ namespace SqlSugar
|
||||
}
|
||||
//public ISqlSugarClient context { get; set; }
|
||||
public ISqlBuilder sqlBuilder { get; set; }
|
||||
public int ParameterIndex { get { return ((SqlBuilderProvider)sqlBuilder)?.GetParameterNameIndex??0; } }
|
||||
public JsonTableNameInfo GetTableName(JToken item)
|
||||
{
|
||||
JsonTableNameInfo jsonTableNameInfo = new JsonTableNameInfo();
|
||||
|
@ -66,6 +66,7 @@ namespace SqlSugar
|
||||
|
||||
private void AppendQueryableAll(JsonQueryParameter jsonQueryParameter, JToken item)
|
||||
{
|
||||
SetQueryableParameterIndex();
|
||||
var name = item.Path.ToLower();
|
||||
if (IsForm(name))
|
||||
{
|
||||
@ -79,7 +80,7 @@ namespace SqlSugar
|
||||
{
|
||||
AppendOrderBy(item);
|
||||
}
|
||||
else if (IsJoinLastAfter(name))
|
||||
else if (IsJoinLastAfter(name))
|
||||
{
|
||||
ApendJoinLastAfter(item);
|
||||
}
|
||||
@ -108,5 +109,10 @@ namespace SqlSugar
|
||||
jsonQueryParameter.IsSelect = AppendJoin(item);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetQueryableParameterIndex()
|
||||
{
|
||||
((SqlBuilderProvider)sugarQueryable.SqlBuilder).GetParameterNameIndex = jsonCommonProvider.ParameterIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user