Browse Source

Update Select DTO

pull/30/head
sunkaixuan 2 years ago
parent
commit
5953379ca2
  1. 2
      Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve_Helper.cs
  2. 14
      Src/Asp.Net/SqlSugar/Infrastructure/Mapper.cs

2
Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve_Helper.cs

@ -663,7 +663,7 @@ namespace SqlSugar
case "SelectAll":
case "GetSelfAndAutoFill":
this.Context.Parameters.RemoveAll(it => it.ParameterName == model.Args[0].MemberName.ObjToString());
var result1 = this.Context.DbMehtods.GetSelfAndAutoFill(model.Args[0].MemberValue.ObjToString(), this.Context.IsSingle);
var result1 = this.Context.DbMehtods.GetSelfAndAutoFill(this.Context.GetTranslationColumnName(model.Args[0].MemberValue.ObjToString()), this.Context.IsSingle);
if ((model.Args[0].MemberValue + "") == "." && this.Context.IsSingle)
{
result1 = this.Context.GetTranslationTableName(model.Args[0].MemberName + "", false) + ".*/**/" + result1;

14
Src/Asp.Net/SqlSugar/Infrastructure/Mapper.cs

@ -57,16 +57,10 @@ namespace SqlSugar
AsName=viewColumns.PropertyName,
DbName=columnInfo.it.DbColumnName
};
var isNoPgAuto = queryBuilder.Context.CurrentConnectionConfig.MoreSettings?.PgSqlIsAutoToLower == false;
if (isNoPgAuto)
{
var shortName=queryBuilder.Builder.GetTranslationColumnName(expPars.shortName);
selectItems.Add(new KeyValuePair<string, JoinMapper>(shortName, joinMapper));
}
else
{
selectItems.Add(new KeyValuePair<string, JoinMapper>(expPars.shortName, joinMapper));
}
//var isNoPgAuto = queryBuilder.Context.CurrentConnectionConfig.MoreSettings?.PgSqlIsAutoToLower == false;
//var isNoUpper = this._context.CurrentConnectionConfig?.MoreSettings?.IsAutoToUpper == false;
var shortName = queryBuilder.Builder.GetTranslationColumnName(expPars.shortName);
selectItems.Add(new KeyValuePair<string, JoinMapper>(shortName, joinMapper));
isbreak = true;
}
}

Loading…
Cancel
Save