From c274a7f9e1b84dc45a0311661f9dc6885af130b7 Mon Sep 17 00:00:00 2001 From: zhaohengkun Date: Thu, 26 Sep 2024 14:52:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E7=AB=AF=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/xml/CardValueRecordMapper.xml | 8 +- .../order/mapper/AllOrderInfoMapper.java | 2 + .../order/mapper/xml/AllOrderInfoMapper.xml | 444 +++++++++--------- .../mapper/xml/UserBalanceMapper.xml | 16 +- .../service/impl/UserBalanceServiceImpl.java | 57 ++- 5 files changed, 275 insertions(+), 252 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml index 3d030b137..e23b1b481 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml @@ -317,11 +317,11 @@ @@ -83,8 +83,8 @@ COALESCE(SUM(pay_money), 0) AS amount, COALESCE(COUNT(*), 0) AS strokeCount, CASE - WHEN COUNT(*) = 0 THEN 0 - ELSE SUM(pay_money) / COUNT(*) + WHEN COUNT(*) = 0 THEN 0 + ELSE SUM(pay_money) / COUNT(*) END AS unitPrice from all_order_info aoi @@ -104,10 +104,10 @@ - - - - + + + + - + - - + SELECT DATE(pay_time) AS pay_time, - COUNT(DISTINCT aoi.store_id) storeCount, - COALESCE(SUM(pay_money), 0) AS amount, - COALESCE(COUNT(*), 0) AS strokeCount, - ROUND( - CASE - WHEN COUNT(*) = 0 THEN 0 - ELSE SUM(pay_money) / COUNT(*) - END, - 2 - ) AS unitPrice + COUNT(DISTINCT aoi.store_id) storeCount, + COALESCE(SUM(pay_money), 0) AS amount, + COALESCE(COUNT(*), 0) AS strokeCount, + ROUND( + CASE + WHEN COUNT(*) = 0 THEN 0 + ELSE SUM(pay_money) / COUNT(*) + END, + 2 + ) AS unitPrice from all_order_info aoi - WHERE date_format(aoi.pay_time,'%y%m%d') BETWEEN date_format(#{allOrderInfo.params.beginTime},'%y%m%d') AND date_format(#{allOrderInfo.params.endTime},'%y%m%d') + WHERE date_format(aoi.pay_time,'%y%m%d') BETWEEN date_format(#{allOrderInfo.params.beginTime},'%y%m%d') AND + date_format(#{allOrderInfo.params.endTime},'%y%m%d') and aoi.store_id in @@ -307,11 +307,11 @@ COALESCE(SUM(pay_money), 0) AS amount, COALESCE(COUNT(*), 0) AS strokeCount, ROUND( - CASE - WHEN COUNT(*) = 0 THEN 0 - ELSE SUM(pay_money) / COUNT(*) - END, - 2 + CASE + WHEN COUNT(*) = 0 THEN 0 + ELSE SUM(pay_money) / COUNT(*) + END, + 2 ) AS unitPrice from all_order_info aoi @@ -332,64 +332,64 @@ @@ -517,42 +514,64 @@ - + + + + + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/UserBalanceMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/UserBalanceMapper.xml index 05c450ec3..38a47d8ff 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/UserBalanceMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/UserBalanceMapper.xml @@ -41,10 +41,13 @@ mub.store_id storeId, mub.card_balance cardBalance, mub.create_time, - mu.id mtUserId + mu.id mtUserId, + mub.grade_id + from mt_user_balance mub - left join mt_user mu on mub.mt_user_id = mu.id + left join mt_user mu on mub.mt_user_id = mu.id + mub.user_status = 0 and mub.store_id in #{item} @@ -58,8 +61,13 @@ count(*) sumnum, sum(mub.card_balance) balanceSum from mt_user_balance mub - left join mt_user mu on mub.mt_user_id = mu.id - + left join mt_user mu on mub.mt_user_id = mu.id + where + mub.user_status = 0 and + mub.store_id in + + #{item} +