diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs index 7df9d517e..095c8c77e 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs @@ -1196,6 +1196,11 @@ namespace SqlSugar result += QueryBuilder.GetExpressionValue(item, isSingle ? ResolveExpressType.FieldSingle : ResolveExpressType.FieldMultiple).GetResultString() + ","; } + else if (item is MemberExpression && type == OrderByType.Desc) + { + result += + QueryBuilder.GetExpressionValue(item, isSingle ? ResolveExpressType.FieldSingle : ResolveExpressType.FieldMultiple).GetResultString() + " Desc,"; + } else if (type == OrderByType.Desc) { result += diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/Dm/SqlBuilder/DmExpressionContext.cs b/Src/Asp.NetCore2/SqlSugar/Realization/Dm/SqlBuilder/DmExpressionContext.cs index 185753ffe..a423047ae 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/Dm/SqlBuilder/DmExpressionContext.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/Dm/SqlBuilder/DmExpressionContext.cs @@ -54,6 +54,10 @@ namespace SqlSugar } public partial class DmMethod : DefaultDbMethod, IDbMethods { + public override string GetStringJoinSelector(string result, string separator) + { + return $"listagg(to_char({result}),'{separator}') within group(order by {result}) "; + } public override string ToInt64(MethodCallExpressionModel model) { var parameter = model.Args[0];