From b337d966854bb280d187745278aa162e211e9e5b Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期五, 01 八月 2025 18:50:22 +0800
Subject: [PATCH] 提交报表汇总求和

---
 north-glass-erp/src/main/resources/mapper/pp/Report.xml |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/pp/Report.xml b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
index 18bccd0..22349ce 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/Report.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -2960,4 +2960,40 @@
             </otherwise>
         </choose>
     </select>
+    
+    
+    <select id="processCardProgressCollectMp">
+       select * from (select b.product_name,
+            c.detail as 'glassName',
+            concat(a.process_id,'/',a.technology_number)  as processID,
+            a.process_id,
+            a.quantity,
+            a.received_quantity,
+            round(sum(a.received_quantity*b.area),2) as received_area,
+
+            a.technology_number
+            from pp.flow_card as a
+            left join sd.order_detail as b
+            on a.order_id = b.order_id and a.order_number = b.order_number
+            left join sd.product_detail as c
+            on c.prod_id = b.product_id and c.glass_sort = a.technology_number
+            where a.order_id = #{orderId} group by processID
+            ) as a
+       left join (SELECT process_id,
+                         technology_number,
+                         sum(broken_num) as broken_num,
+                         concat('{',GROUP_CONCAT(reporting_work_nums),'}') as reporting_work_num
+                  from (select
+                            opd.process_id,
+                            opd.technology_number,
+                            concat("\"", process, "\":\"", SUM(reporting_work_num), "\"") as  reporting_work_nums,
+                            sum(broken_num) as broken_num
+                        from sd.order_process_detail as opd
+                        where opd.order_id = #{orderId}
+                        group by opd.process_id,opd.technology_number,opd.process) as bb
+                  GROUP BY bb.process_id,bb.technology_number) as b
+       on a.process_id = b.process_id and a.technology_number = b.technology_number
+       order by a.process_id
+
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0