diff --git a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs index 1aaef7f54..7c6f239b7 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs @@ -931,12 +931,16 @@ namespace SqlSugar protected string AppendSelect(string sql, ReadOnlyCollection parameters, List columnsResult, int parameterIndex1) { var columns = this.Context.EntityMaintenance.GetEntityInfo().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"));