From 0fcd6e8ae6a94cb96ab2b672fe653e9312f58c37 Mon Sep 17 00:00:00 2001 From: jiask <1069621233@qq.com> Date: Mon, 17 Nov 2025 16:32:44 +0800 Subject: [PATCH] JSK --- .../mapper/report/TradeReportMapper.xml | 96 +++++++++---------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/report/TradeReportMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/report/TradeReportMapper.xml index da5223f..aaf65dc 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/report/TradeReportMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/report/TradeReportMapper.xml @@ -210,13 +210,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sum(case when oi.mealtime_type = 4 then oi.real_amount - oi.refund_amount else 0 end) as dinner_consume_count, - count(distinct case when oi.mealtime_type = 5 then + count(distinct case when oi.mealtime_type = 5 or oi.mealtime_type = -1 then oi.user_id else null end) as midnight_snack_user_count, - count(case when oi.mealtime_type = 5 then + count(case when oi.mealtime_type = 5 or oi.mealtime_type = -1 then oi.order_id else null end) as midnight_snack_order_count, - sum(case when oi.mealtime_type = 5 then + sum(case when oi.mealtime_type = 5 or oi.mealtime_type = -1 then oi.real_amount - oi.refund_amount else 0 end) as midnight_snack_consume_count from @@ -250,51 +250,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" oi.user_id, su.nick_name, sd.dept_full_name, - count(distinct case when oi.mealtime_type = 1 then - oi.user_id else null - end) as breakfast_user_count, - count(case when oi.mealtime_type = 1 then - oi.order_id else null - end) as breakfast_order_count, - sum(case when oi.mealtime_type = 1 then - oi.real_amount - oi.refund_amount else 0 - end) as breakfast_consume_count, - count(distinct case when oi.mealtime_type = 2 then - oi.user_id else null - end) as lunch_user_count, - count(case when oi.mealtime_type = 2 then - oi.order_id else null - end) as lunch_order_count, - sum(case when oi.mealtime_type = 2 then - oi.real_amount - oi.refund_amount else 0 - end) as lunch_consume_count, - count(distinct case when oi.mealtime_type = 3 then - oi.user_id else null - end) as afternoon_tea_user_count, - count(case when oi.mealtime_type = 3 then - oi.order_id else null - end) as afternoon_tea_order_count, - sum(case when oi.mealtime_type = 3 then - oi.real_amount - oi.refund_amount else 0 - end) as afternoon_tea_consume_count, - count(distinct case when oi.mealtime_type = 4 then - oi.user_id else null - end) as dinner_user_count, - count(case when oi.mealtime_type = 4 then - oi.order_id else null - end) as dinner_order_count, - sum(case when oi.mealtime_type = 4 then - oi.real_amount - oi.refund_amount else 0 - end) as dinner_consume_count, - count(distinct case when oi.mealtime_type = 5 then - oi.user_id else null - end) as midnight_snack_user_count, - count(case when oi.mealtime_type = 5 then - oi.order_id else null - end) as midnight_snack_order_count, - sum(case when oi.mealtime_type = 5 then - oi.real_amount - oi.refund_amount else 0 - end) as midnight_snack_consume_count + count(distinct case when oi.order_type!=2 and oi.mealtime_type = 1 then + oi.user_id else null + end) as breakfast_user_count, + count(case when oi.order_type!=2 and oi.mealtime_type = 1 then + oi.order_id else null + end) as breakfast_order_count, + sum(case when oi.order_type!=2 and oi.mealtime_type = 1 then + oi.real_amount - oi.refund_amount else 0 + end) as breakfast_consume_count, + count(distinct case when oi.order_type!=2 and oi.mealtime_type = 2 then + oi.user_id else null + end) as lunch_user_count, + count(case when oi.order_type!=2 and oi.mealtime_type = 2 then + oi.order_id else null + end) as lunch_order_count, + sum(case when oi.order_type!=2 and oi.mealtime_type = 2 then + oi.real_amount - oi.refund_amount else 0 + end) as lunch_consume_count, + count(distinct case when oi.order_type=2 then + oi.user_id else null + end) as afternoon_tea_user_count, + count(case when oi.order_type=2 then + oi.order_id else null + end) as afternoon_tea_order_count, + sum(case when oi.order_type=2 then + oi.real_amount - oi.refund_amount else 0 + end) as afternoon_tea_consume_count, + count(distinct case when oi.order_type!=2 and oi.mealtime_type = 4 then + oi.user_id else null + end) as dinner_user_count, + count(case when oi.order_type!=2 and oi.mealtime_type = 4 then + oi.order_id else null + end) as dinner_order_count, + sum(case when oi.order_type!=2 and oi.mealtime_type = 4 then + oi.real_amount - oi.refund_amount else 0 + end) as dinner_consume_count, + count(distinct case when oi.order_type!=2 and (oi.mealtime_type = 5 or oi.mealtime_type = -1) then + oi.user_id else null + end) as midnight_snack_user_count, + count(case when oi.order_type!=2 and (oi.mealtime_type = 5 or oi.mealtime_type = -1) then + oi.order_id else null + end) as midnight_snack_order_count, + sum(case when oi.order_type!=2 and (oi.mealtime_type = 5 or oi.mealtime_type = -1) then + oi.real_amount - oi.refund_amount else 0 + end) as midnight_snack_consume_count from order_info oi left join sys_user su on