Browse Source

Update json 2 sql

pull/19/head
sunkaixuan 2 years ago
parent
commit
cbd35d44ff
  1. 2
      Src/Asp.Net/SqlSugar/Json2Sql/JsonToModel/JsonSqlFuncToParameters.cs
  2. 2
      Src/Asp.Net/SqlSugar/Json2Sql/JsonToModel/JsonToGroupByModels.cs
  3. 4
      Src/Asp.Net/SqlSugar/Json2Sql/JsonToModel/JsonToJoinModels.cs
  4. 2
      Src/Asp.Net/SqlSugar/Json2Sql/JsonToModel/JsonToOrderByModels.cs
  5. 2
      Src/Asp.Net/SqlSugar/Json2Sql/JsonToModel/JsonToSelectModels.cs
  6. 2
      Src/Asp.Net/SqlSugar/Json2Sql/Provider/Deleteable/JsonDeleteableProvider.cs
  7. 2
      Src/Asp.Net/SqlSugar/Json2Sql/Provider/Insertable/AppendName.cs
  8. 1
      Src/Asp.Net/SqlSugar/Json2Sql/Provider/Queryable/AppendFrom.cs
  9. 2
      Src/Asp.Net/SqlSugar/Json2Sql/Provider/Updateable/AppendTable.cs

2
Src/Asp.Net/SqlSugar/Json2Sql/JsonToModel/JsonSqlFuncToParameters.cs

@ -57,7 +57,7 @@ namespace SqlSugar
public object GetStringParameters(JToken parameters)
{
return parameters.ObjToString();
return parameters.ObjToString().ToCheckField();
}
#endregion

2
Src/Asp.Net/SqlSugar/Json2Sql/JsonToModel/JsonToGroupByModels.cs

@ -22,7 +22,7 @@ namespace SqlSugar
}
else
{
conditionalModels.Add(new GroupByModel() { FieldName = item.ObjToString() });
conditionalModels.Add(new GroupByModel() { FieldName = item.ObjToString().ToCheckField() });
}
}
return conditionalModels;

4
Src/Asp.Net/SqlSugar/Json2Sql/JsonToModel/JsonToJoinModels.cs

@ -22,8 +22,8 @@ namespace SqlSugar
var shortName = array[1];
var onWhere = array[2];
JoinModel result = new JoinModel();
result.TableName = tableName.ObjToString();
result.ShortName = shortName.ObjToString();
result.TableName = tableName.ObjToString().ToCheckField();
result.ShortName = shortName.ObjToString().ToCheckField();
result.OnWhereList = JsonToSqlFuncModels(onWhere);
return result;
}

2
Src/Asp.Net/SqlSugar/Json2Sql/JsonToModel/JsonToOrderByModels.cs

@ -22,7 +22,7 @@ namespace SqlSugar
}
else if (item.Type == JTokenType.String)
{
conditionalModels.Add(new OrderByModel() { FieldName = item.ObjToString() });
conditionalModels.Add(new OrderByModel() { FieldName = item.ObjToString().ToCheckField() });
}
else if (item.Type == JTokenType.Array)
{

2
Src/Asp.Net/SqlSugar/Json2Sql/JsonToModel/JsonToSelectModels.cs

@ -22,7 +22,7 @@ namespace SqlSugar
}
else if (IsString(item))
{
conditionalModels.Add(new SelectModel() { FiledName = item.ObjToString(), AsName = item.ObjToString().Replace(".", "_") });
conditionalModels.Add(new SelectModel() { FiledName = item.ObjToString().ToCheckField(), AsName = item.ObjToString().Replace(".", "_") });
}
else if (IsArraySingleItem(item))
{

2
Src/Asp.Net/SqlSugar/Json2Sql/Provider/Deleteable/JsonDeleteableProvider.cs

@ -50,7 +50,7 @@ namespace SqlSugar
private void AppendTable(JToken item)
{
var tableInfo = jsonCommonProvider.GetTableName(item);
var tableName = tableInfo.TableName;
var tableName = tableInfo.TableName.ToCheckField();
if (tableInfo.ShortName.HasValue())
{
tableName = tableInfo.ShortName + "." + tableInfo.TableName;

2
Src/Asp.Net/SqlSugar/Json2Sql/Provider/Insertable/AppendName.cs

@ -10,7 +10,7 @@ namespace SqlSugar
private void AppendName(JToken item)
{
var tableInfo = jsonCommonProvider.GetTableName(item);
this.TableName = tableInfo.TableName;
this.TableName = tableInfo.TableName.ToCheckField();
if (tableInfo.ShortName.HasValue())
{
this.TableName = tableInfo.ShortName + "." + tableInfo.TableName;

1
Src/Asp.Net/SqlSugar/Json2Sql/Provider/Queryable/AppendFrom.cs

@ -15,6 +15,7 @@ namespace SqlSugar
private void AppendFrom(JToken item)
{
var tableNameInfo=jsonCommonProvider.GetTableName(item);
tableNameInfo.TableName.ToCheckField();
AddMasterTableInfos(tableNameInfo);
if (tableNameInfo.ShortName.HasValue())
{

2
Src/Asp.Net/SqlSugar/Json2Sql/Provider/Updateable/AppendTable.cs

@ -11,7 +11,7 @@ namespace SqlSugar
private void AppendTable(JToken item)
{
var tableInfo = jsonCommonProvider.GetTableName(item);
this.TableName = tableInfo.TableName;
this.TableName = tableInfo.TableName.ToCheckField();
if (tableInfo.ShortName.HasValue())
{
this.TableName = tableInfo.ShortName + "." + tableInfo.TableName;

Loading…
Cancel
Save