From ac14111c40d4e202ac41eeb88cc57ae521a3139b Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期一, 19 八月 2024 08:39:17 +0800
Subject: [PATCH] 次破明细表添加实体类禁止用于查询

---
 north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml |   39 ++++++++++++++++++++++++++++++++++-----
 1 files changed, 34 insertions(+), 5 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 fe00038..f212323 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -217,7 +217,7 @@
             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}
+        where fc.process_id = #{processId}
 
     </update>
 
@@ -225,7 +225,7 @@
     <update id="deleteFlowCardMp">
         delete
         from flow_card as fc
-        where fc.order_id = left(#{processId}, 10)
+        where fc.process_id = #{processId}
     </update>
 
     <!--    鍒嗘灦鏂板鏄庣粏鏌ヨ-->
@@ -442,7 +442,7 @@
     <delete id="deleteReportingWork">
         delete
         from sd.order_process_detail
-        where order_id = left(#{processId}, 10)
+        where process_id = #{processId}
     </delete>
 
     <select id="selectPrintFlowCardMp">
@@ -807,8 +807,8 @@
                  left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number
         where fc.process_id = #{processId}
           and position(fc.technology_number in #{technologyNumber})
-
-        order by IF(fc.sort != NULL or fc.sort != '', fc.sort, fc.order_number)
+        GROUP BY fc.process_id,fc.order_number,fc.technology_number
+        order by IF(fcs.sort != NULL or fcs.sort != '', fcs.sort, fc.order_number)
     </select>
 
     <update id="printSortMp">
@@ -2034,4 +2034,33 @@
                  fcs.order_number,
                  fcs.technology_number
     </select>
+
+    <select id="countFlowCard">
+        select count(distinct process_id) from flow_card where order_id = #{orderId}
+    </select>
+
+    <select id="remakList">
+        SELECT
+            JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S01')) AS S01,
+            JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S04')) AS S02,
+            JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S05')) AS S03,
+            JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S06')) AS S04,
+            JSON_UNQUOTE(JSON_EXTRACT(other_columns, '$.S07')) AS S05
+        FROM flow_card as fc left join sd.order_detail as od on  fc.order_id = od.order_id
+        and fc.order_number = od.order_number
+        WHERE fc.process_id=#{processId}
+        GROUP BY fc.order_number
+    </select>
+
+    <select id="selectMaxFlowCard">
+        select ifnull((select fc.process_id
+                       from 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
+                                left join flow_card as fc on fc.order_id=od.order_id and fc.order_number=od.order_number and fc.technology_number=ogd.technology_number
+                       where od.order_id = #{orderId}
+                         and ogd.production_id = #{productionId}
+                       GROUP BY od.order_number
+                       order by fc.process_id desc LIMIT 1),'') as process_id
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0