From 79a9d8e47ed9697b9ccacc5f06e40f3ac0d938ef Mon Sep 17 00:00:00 2001 From: wangh <9483> Date: Tue, 19 Dec 2023 16:54:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/xml/CardFuelRecordMapper.xml | 24 ++++++------- .../mapper/xml/CardValueRecordMapper.xml | 24 ++++++------- .../member/mapper/xml/LJStaffMapper.xml | 1 + .../order/mapper/xml/LJOrderMapper.xml | 34 ++++++++++--------- .../order/mapper/xml/OilOrderMapper.xml | 31 ++++++++++------- .../business/store/entity/ChainStoreInfo.java | 1 + .../impl/ChainStoreInfoServiceImpl.java | 4 +++ 7 files changed, 66 insertions(+), 53 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/mapper/xml/CardFuelRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/mapper/xml/CardFuelRecordMapper.xml index 2608ca448..89e8b2a89 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/mapper/xml/CardFuelRecordMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/mapper/xml/CardFuelRecordMapper.xml @@ -358,28 +358,28 @@ SELECT -- 当天的数据和条数 - CAST((SELECT COUNT(*) FROM oil_order WHERE DATE(create_time) = CURDATE()) AS CHAR) AS today_count, - CAST((SELECT SUM(pay_amount) FROM oil_order WHERE DATE(create_time) = CURDATE()) AS CHAR) AS today_sum, + CAST((SELECT COUNT(*) FROM oil_order WHERE DATE(create_time) = CURDATE()and store_id = #{storeId}) AS CHAR) AS today_count, + CAST((SELECT SUM(pay_amount) FROM oil_order WHERE DATE(create_time) = CURDATE()and store_id = #{storeId}) AS CHAR) AS today_sum, -- 当周的数据和条数 - CAST((SELECT COUNT(*) FROM oil_order WHERE WEEK(create_time) = WEEK(CURDATE())) AS CHAR) AS this_week_count, - CAST((SELECT SUM(pay_amount) FROM oil_order WHERE WEEK(create_time) = WEEK(CURDATE())) AS CHAR) AS this_week_sum, + CAST((SELECT COUNT(*) FROM oil_order WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_count, + CAST((SELECT SUM(pay_amount) FROM oil_order WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_sum, -- 当月的数据和条数 - CAST((SELECT COUNT(*) FROM oil_order WHERE MONTH(create_time) = MONTH(CURDATE())) AS CHAR) AS this_month_count, - CAST((SELECT SUM(pay_amount) FROM oil_order WHERE MONTH(create_time) = MONTH(CURDATE())) AS CHAR) AS this_month_sum, + CAST((SELECT COUNT(*) FROM oil_order WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_count, + CAST((SELECT SUM(pay_amount) FROM oil_order WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_sum, -- 昨天的数据 - CAST((SELECT COUNT(*) FROM oil_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)) AS CHAR) AS yesterday_count, - CAST((SELECT SUM(pay_amount) FROM oil_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)) AS CHAR) AS yesterday_sum, + CAST((SELECT COUNT(*) FROM oil_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_count, + CAST((SELECT SUM(pay_amount) FROM oil_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_sum, -- 上周的数据 - CAST((SELECT COUNT(*) FROM oil_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))) AS CHAR) AS last_week_count, - CAST((SELECT SUM(pay_amount) FROM oil_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))) AS CHAR) AS last_week_sum, + CAST((SELECT COUNT(*) FROM oil_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_count, + CAST((SELECT SUM(pay_amount) FROM oil_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_sum, -- 上个月的数据 - CAST((SELECT COUNT(*) FROM oil_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))) AS CHAR) AS last_month_count, - CAST((SELECT SUM(pay_amount) FROM oil_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))) AS CHAR) AS last_month_sum; + CAST((SELECT COUNT(*) FROM oil_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_count, + CAST((SELECT SUM(pay_amount) FROM oil_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_sum; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml index e66c2b6ab..b73a29781 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml @@ -166,28 +166,28 @@ SELECT -- 当天的数据和条数 - CAST((SELECT COUNT(*) FROM oil_order WHERE DATE(create_time) = CURDATE()) AS CHAR) AS today_count, - CAST((SELECT SUM(pay_amount) FROM oil_order WHERE DATE(create_time) = CURDATE()) AS CHAR) AS today_sum, + CAST((SELECT COUNT(*) FROM oil_order WHERE DATE(create_time) = CURDATE() and store_id = #{storeId}) AS CHAR) AS today_count, + CAST((SELECT SUM(pay_amount) FROM oil_order WHERE DATE(create_time) = CURDATE() and store_id = #{storeId}) AS CHAR) AS today_sum, -- 当周的数据和条数 - CAST((SELECT COUNT(*) FROM oil_order WHERE WEEK(create_time) = WEEK(CURDATE())) AS CHAR) AS this_week_count, - CAST((SELECT SUM(pay_amount) FROM oil_order WHERE WEEK(create_time) = WEEK(CURDATE())) AS CHAR) AS this_week_sum, + CAST((SELECT COUNT(*) FROM oil_order WHERE WEEK(create_time) = WEEK(CURDATE()) and store_id = #{storeId} ) AS CHAR) AS this_week_count, + CAST((SELECT SUM(pay_amount) FROM oil_order WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_sum, -- 当月的数据和条数 - CAST((SELECT COUNT(*) FROM oil_order WHERE MONTH(create_time) = MONTH(CURDATE())) AS CHAR) AS this_month_count, - CAST((SELECT SUM(pay_amount) FROM oil_order WHERE MONTH(create_time) = MONTH(CURDATE())) AS CHAR) AS this_month_sum, + CAST((SELECT COUNT(*) FROM oil_order WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_count, + CAST((SELECT SUM(pay_amount) FROM oil_order WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_sum, -- 昨天的数据 - CAST((SELECT COUNT(*) FROM oil_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)) AS CHAR) AS yesterday_count, - CAST((SELECT SUM(pay_amount) FROM oil_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)) AS CHAR) AS yesterday_sum, + CAST((SELECT COUNT(*) FROM oil_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_count, + CAST((SELECT SUM(pay_amount) FROM oil_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_sum, -- 上周的数据 - CAST((SELECT COUNT(*) FROM oil_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))) AS CHAR) AS last_week_count, - CAST((SELECT SUM(pay_amount) FROM oil_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))) AS CHAR) AS last_week_sum, + CAST((SELECT COUNT(*) FROM oil_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_count, + CAST((SELECT SUM(pay_amount) FROM oil_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_sum, -- 上个月的数据 - CAST((SELECT COUNT(*) FROM oil_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))) AS CHAR) AS last_month_count, - CAST((SELECT SUM(pay_amount) FROM oil_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))) AS CHAR) AS last_month_sum; + CAST((SELECT COUNT(*) FROM oil_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_count, + CAST((SELECT SUM(pay_amount) FROM oil_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_sum; +