From 41a09446e11702191b188c163d7c17c476b0e8f6 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sun, 19 Mar 2023 16:35:53 +0800 Subject: [PATCH] Synchronization code --- .../SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs | 5 +++++ .../Realization/Dm/SqlBuilder/DmExpressionContext.cs | 4 ++++ 2 files changed, 9 insertions(+) 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];