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} +