Synchronization code

This commit is contained in:
sunkaixuan 2024-04-03 08:11:12 +08:00
parent c8c431f074
commit 1a584149a4

View File

@ -192,7 +192,7 @@ namespace SqlSugar
this.Context.SqlTranslationLeft + asName + "." + newExpressionInfo.LeftNameName + this.Context.SqlTranslationRight
);
}
}
else
{
parameter.Context.Result.Append(this.Context.GetAsString(
@ -221,7 +221,7 @@ namespace SqlSugar
mappingKeys.Add("Single_" + newExpressionInfo.LeftNameName, asName + "." + newExpressionInfo.LeftNameName);
if (newExpressionInfo.Type == nameof(ConstantExpression))
{
this.Context.SugarContext.QueryBuilder.MappingKeys = mappingKeys;
this.Context.SugarContext.QueryBuilder.MappingKeys = mappingKeys;
parameter.Context.Result.Append($" {newExpressionInfo.RightDbName} AS {this.Context.SqlTranslationLeft}{asName}.{newExpressionInfo.LeftNameName}{this.Context.SqlTranslationRight} ");
}
else
@ -250,6 +250,11 @@ namespace SqlSugar
}
//throw new Exception("子查询ToList开发中..");
}
else if (ExpressionTool.GetMethodName(item) == nameof(SqlFunc.MappingColumn))
{
var value = GetNewExpressionValue(item);
parameter.Context.Result.Append($" {value} AS {asName} ");
}
else
{
asName = GetAsNameResolveAnObject(parameter, item, asName, isSameType);