From e0e1694d28c1eeb2edddfde6a738dd6259b0ad1d Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期二, 15 十月 2024 10:03:38 +0800
Subject: [PATCH] add:短信模板通知

---
 src/main/resources/mapper/report/OrderReportMapper.xml |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/main/resources/mapper/report/OrderReportMapper.xml b/src/main/resources/mapper/report/OrderReportMapper.xml
index 98ec9dd..9cd635b 100644
--- a/src/main/resources/mapper/report/OrderReportMapper.xml
+++ b/src/main/resources/mapper/report/OrderReportMapper.xml
@@ -310,9 +310,9 @@
                        IFNULL(ois.lack_fee_supplier,0) as lack_fee_supplier,
                        IFNULL(ois.replace_fee,0) as replace_fee
 
-                      ,IFNULL( (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'replace'),0) as replace_num
-                      ,IFNULL( (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'reduce'),0) as reduce_num
-                      ,IFNULL( (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'lack'),0) as lack_num
+                      ,IFNULL( (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'replace' and oic.audit_status='AGREED'),0) as replace_num
+                      ,IFNULL( (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'reduce' and oic.audit_status='AGREED'),0) as reduce_num
+                      ,IFNULL( (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'lack' and oic.audit_status='AGREED'),0) as lack_num
                    FROM  t_order o
                    left join t_order_item oi
                    on oi.order_id=o.id
@@ -401,9 +401,9 @@
             IFNULL(ois.lack_fee_supplier,0) as lack_fee_supplier,
             IFNULL(ois.replace_fee,0) as replace_fee
 
-            ,IFNULL( (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'replace'),0) as replace_num
-            ,IFNULL( (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'reduce'),0) as reduce_num
-            ,IFNULL( (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'lack'),0) as lack_num
+            ,IFNULL( (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'replace' and oic.audit_status='AGREED'),0) as replace_num
+            ,IFNULL( (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'reduce' and oic.audit_status='AGREED'),0) as reduce_num
+            ,IFNULL( (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'lack' and oic.audit_status='AGREED'),0) as lack_num
             FROM  t_order o
             left join t_order_item oi
             on oi.order_id=o.id
@@ -479,7 +479,7 @@
         IFNULL( ois.check_fee, 0 ) AS check_fee,
         IFNULL( ois.replace_fee, 0 ) AS replace_fee,
         IFNULL( ois.lack_fee_supplier, 0 ) AS lack_fee_supplier,
-        IFNULL( (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'lack'),0) as lack_num
+        IFNULL( (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'lack' and oic.audit_status='AGREED'),0) as lack_num
         FROM
         t_order o
         LEFT JOIN t_order_item oi ON oi.order_id = o.id
@@ -489,6 +489,7 @@
         WHERE
         oi.deleted = 0
         and  o.payment_time is not null
+        and  o.status_backend not in ('PENDING','CANCEL','REFUND')
         <if test="dto.startDate != null">
             and o.payment_time >= #{dto.startDate}
         </if>
@@ -527,7 +528,7 @@
         on vor.supplier_id=p.id
         left join t_order o
         on vor.order_id= o.id
-        and o.status_backend not in ('PENDING','CANCEL','REFUND')
+--         and o.status_backend not in ('PENDING','CANCEL','REFUND')
         )  s group by dateinfo,supplier_id
     </select>
 
@@ -554,7 +555,7 @@
         on vor.supplier_id=p.id
         left join t_order o
         on vor.order_id= o.id
-        and o.status_backend not in ('PENDING','CANCEL','REFUND')
+--         and o.status_backend not in ('PENDING','CANCEL','REFUND')
         )  s group by dateinfo,supplier_id
     </select>
 
@@ -588,7 +589,7 @@
         on vor.supplier_id=p.id
         left join t_order o
         on vor.order_id= o.id
-        and o.status_backend not in ('PENDING','CANCEL','REFUND')
+--         and o.status_backend not in ('PENDING','CANCEL','REFUND')
         )  s group by dateinfo,supplier_id
         ) s2
     </select>

--
Gitblit v1.9.3