From bf23d66c841f7bc7de098a93b9a61fffe04d9cfb Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期三, 28 二月 2024 18:41:13 +0800
Subject: [PATCH] 提交右键菜单以及拖拉选中功能

---
 north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml |   61 ++++++++++++++++++++++++------
 1 files changed, 49 insertions(+), 12 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
index 9383dd5..86b29c8 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -158,24 +158,19 @@
         group by od.order_id, ogd.production_id
     </select>
 
+    <!--    鏇存柊鍒嗘灦鐘舵��-->
     <update id="UpdateDeleteState">
-        update sd.order_glass_detail as ogd
-        set ogd.production_id=null,
-            ogd.production_time=null,
-            ogd.founder=null
-        where ogd.production_id = #{processId}
+        update
+            sd.order_glass_detail as ogd left join flow_card as fc
+                on ogd.order_id=fc.order_id and ogd.order_number=fc.order_number
+        set ogd.splitting_status=0
+        where ogd.order_id=#{orderId}  and fc.process_id=#{processId}
 
     </update>
 
     <!--    鍒犻櫎娴佺▼鍗�-->
     <update id="DeleteFlowCardMp">
-        update sd.order_detail as od left join sd.order_glass_detail as ogd
-            on od.order_id = ogd.order_id and od.order_number = ogd.order_number
-        set ogd.production_id=null,
-            ogd.production_time=null,
-            ogd.founder=null
-        where od.order_id = #{orderId}
-          and ogd.production_id = #{processId}
+        delete from flow_card as fc where fc.process_id=#{processId}
     </update>
 
     <!--    鍒嗘灦鏂板鏄庣粏鏌ヨ-->
@@ -240,6 +235,7 @@
             technology_number,
             quantity,
             founder,
+            layers_number,
             splitFrame_time,
             create_time
         )
@@ -252,6 +248,7 @@
             ogd.technology_number,
             #{quantity},
             #{userName},
+            #{layer},
             NOW(),
             NOW()
 
@@ -281,4 +278,44 @@
         set o.processing_card=#{state}
         where o.order_id=left(#{productionId},10)
     </update>
+
+<!--    鏌ヨ宸叉帓鐗堟暟鎹�-->
+    <select id="SelectOkSchedulingMp">
+        select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
+               round(od.width*od.height*od.quantity/1000000,2),
+               (od.quantity-IFNULL(ps.scheduling_quantity,0)),
+               round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2),
+               IFNULL(ps.scheduling_quantity,0),
+               round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2),
+               od.product_name,od.shape
+        from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id
+                                   left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
+        where od.order_id=#{orderId} and ps.processes=#{processes} and ps.scheduling_id IS NOT NULL
+
+    </select>
+<!--    鏌ヨ鏈帓鐗堟暟鎹�-->
+    <select id="SelectNoSchedulingMp">
+
+    </select>
+<!--    棣栨鏌ヨ鎺掔増鏁版嵁-->
+    <select id="selectLastSchedulingMp">
+        select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
+               round(od.width*od.height*od.quantity/1000000,2) as area,
+               (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity,
+               round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea,
+               IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity,
+               round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea,
+               od.product_name,od.shape
+        from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id
+                                   left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
+        where od.create_time between #{selectTime1} and #{selectTime2}
+    </select>
+
+<!--   鏌ヨ瀵瑰簲搴忓彿鐨勫眰鏁�-->
+    <select id="SelectLayer">
+        select COUNT(ogd.order_number)
+        from sd.order_glass_detail as ogd
+        where ogd.production_id = #{productionId}
+          and ogd.order_number=#{orderNumber}
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0