From 6cd08fe4de88df0a21851f96bdc4e617c5d92e36 Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期三, 29 四月 2026 11:57:31 +0800
Subject: [PATCH] 工单相关功能完善

---
 src/main/resources/mapper/LocDetlMapper.xml |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/LocDetlMapper.xml b/src/main/resources/mapper/LocDetlMapper.xml
index 98a357d..93599d8 100644
--- a/src/main/resources/mapper/LocDetlMapper.xml
+++ b/src/main/resources/mapper/LocDetlMapper.xml
@@ -342,6 +342,9 @@
         <if test="specs!=null and specs!='' ">
             and a.specs like '%' + #{specs} + '%'
         </if>
+        <if test="standby1!=null and standby1!='' ">
+            and a.standby1 like '%' + #{standby1} + '%'
+        </if>
     </sql>
 
     <select id="getStockOutPage" resultMap="BaseResultMap">
@@ -661,6 +664,20 @@
     <update id="frozenInventory">
         update asr_loc_detl set frozen = #{frozen} where loc_no = #{locNo} and matnr = #{matnr} and batch = #{batch}
     </update>
+    <update id="updateDangerByLocNo">
+        UPDATE d
+        SET danger = CASE
+                         WHEN t.cnt = 1 THEN 1
+                         ELSE 2
+            END
+        FROM asr_loc_detl d
+                 JOIN (
+            SELECT loc_no, COUNT(DISTINCT standby1) AS cnt
+            FROM asr_loc_detl
+            WHERE loc_no = #{locNo}
+            GROUP BY loc_no
+        ) t ON d.loc_no = t.loc_no
+    </update>
 
     <select id="selectSameDetlTodayBatch" resultType="java.lang.String">
         SELECT ld.loc_no FROM asr_loc_detl ld

--
Gitblit v1.9.1