From 2741f1cefe4793d1730a70234168adc3e6da4ef6 Mon Sep 17 00:00:00 2001 From: tangqian Date: Wed, 31 May 2023 13:56:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8E=A8=E5=B9=BF=E5=91=98=E6=8F=90?= =?UTF-8?q?=E6=88=90=E4=BF=A1=E6=81=AF=E6=9F=A5=E8=AF=A2=E5=92=8C=E5=AF=BC?= =?UTF-8?q?=E5=87=BA.=20=E5=95=86=E5=9F=8E=E6=8F=90=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/recharge/vo/PromoterDrawReqVO.java | 4 +- .../mapper/recharge/RechargeOrderMapper.xml | 41 +++++++++++-------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/PromoterDrawReqVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/PromoterDrawReqVO.java index e75d140f4..347e12ff1 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/PromoterDrawReqVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/PromoterDrawReqVO.java @@ -29,7 +29,7 @@ public class PromoterDrawReqVO extends PageParam { @Schema(description = "成为推广员时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - - + @Schema(description = "排序1升序2降序") + private String sort; } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml index eebeee2c6..f5b04f6bd 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml @@ -10,7 +10,8 @@ --> - SELECT x1.*, x2.order_count, @@ -65,30 +66,37 @@ cy_recharge_order b GROUP BY b.promoter_id - ) x2 ON x1.user_id = x2.user_id ORDER BY x2.total_amount DESC + ) x2 ON x1.user_id = x2.user_id + + ORDER BY x2.total_amount ASC + + + ORDER BY x2.total_amount DESC + - SELECT b.promoter_id AS user_id, - count( CASE b.paid = 1 WHEN 1 THEN 0 END) AS order_count, - sum( CASE WHEN b.paid = 1 THEN b.pay_price ELSE 0 END ) AS deal_amount, + count( CASE b.paid = 1 WHEN 1 THEN 0 END) AS order_count, + sum( CASE WHEN b.paid = 1 THEN b.pay_price ELSE 0 END ) AS deal_amount, sum( CASE WHEN b.paid IN ( 1, 2 ) THEN b.pay_price ELSE 0 END ) AS total_amount FROM cy_recharge_order b - - - and b.promoter_id in - - #{id} - - - + + + and b.promoter_id in + + #{id} + + + GROUP BY b.promoter_id - - select a.order_id, a.pay_serial_number, @@ -127,7 +135,8 @@ - select a.id, a.order_id,