Browse Source

Synchronization code

pull/30/head
sunkaixuan 2 years ago
parent
commit
6879ad31a1
  1. 10
      Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs

10
Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs

@ -931,12 +931,16 @@ namespace SqlSugar
protected string AppendSelect<EntityType>(string sql, ReadOnlyCollection<ParameterExpression> parameters, List<EntityColumnInfo> columnsResult, int parameterIndex1)
{
var columns = this.Context.EntityMaintenance.GetEntityInfo<EntityType>().Columns;
var parameterName = parameters[parameterIndex1];
var parameterName = parameters[parameterIndex1].Name;
if (parameterName.HasValue())
{
parameterName = this.SqlBuilder.GetTranslationColumnName(parameterName);
}
foreach (var item in columns)
{
if (item.IsIgnore == false && columnsResult.Any(it => it.PropertyName.EqualCase(item.PropertyName)) && !sql.ToLower().Contains(SqlBuilder.GetTranslationColumnName(item.PropertyName.ToLower())))
{
sql = $" {sql},{parameterName.Name}.{SqlBuilder.GetTranslationColumnName(item.DbColumnName)} AS {SqlBuilder.GetTranslationColumnName(item.PropertyName)} ";
sql = $" {sql},{parameterName}.{SqlBuilder.GetTranslationColumnName(item.DbColumnName)} AS {SqlBuilder.GetTranslationColumnName(item.PropertyName)} ";
}
}
@ -988,7 +992,7 @@ namespace SqlSugar
}
this.QueryBuilder.AsTables[tableinfo.Key] = " (SELECT * FROM " + tableName + ")";
}
this.QueryBuilder.SelectValue = this.QueryBuilder.TableShortName + ".*";
this.QueryBuilder.SelectValue =this.SqlBuilder.GetTranslationColumnName(this.QueryBuilder.TableShortName) + ".*";
}
}
Check.Exception(result.JoinIndex > 10, ErrorMessage.GetThrowMessage("只支持12个表", "Only 12 tables are supported"));

Loading…
Cancel
Save