From bb80ead86615da40c73ed60a04944461e52929e7 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期五, 20 三月 2026 16:19:25 +0800
Subject: [PATCH] fix: 工艺路线查询未携带状态

---
 src/main/resources/mapper/production/ProcessRouteMapper.xml |   32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/src/main/resources/mapper/production/ProcessRouteMapper.xml b/src/main/resources/mapper/production/ProcessRouteMapper.xml
index 1baf536..d44a4bd 100644
--- a/src/main/resources/mapper/production/ProcessRouteMapper.xml
+++ b/src/main/resources/mapper/production/ProcessRouteMapper.xml
@@ -26,25 +26,31 @@
         <if test="c.dictCode != null">
             and ps.dict_code = #{c.dictCode}
         </if>
+        <if test="c.status != null">
+            and ps.status = #{c.status}
+        </if>
         order by ps.id
     </select>
 
     <select id="latestTypeDate" resultType="com.ruoyi.production.pojo.ProcessRoute">
         SELECT *
         FROM process_route pr
-        WHERE pr.dict_code = (SELECT d.dict_code
-                              FROM sys_dict_data d
-                              WHERE d.dict_label =
-                                <choose>
-                                    <when test="strength != null and strength != ''">
-                                        CONCAT(#{productName}, '-', #{strength})
-                                    </when>
-                                    <otherwise>
-                                        #{productName}
-                                    </otherwise>
-                                </choose>
-                                AND d.dict_type = 'product_type'
-                              LIMIT 1)
+        WHERE
+        pr.status = 1
+        and
+        pr.dict_code = (SELECT d.dict_code
+        FROM sys_dict_data d
+        WHERE d.dict_label =
+        <choose>
+            <when test="strength != null and strength != ''">
+                CONCAT(#{productName}, '-', #{strength})
+            </when>
+            <otherwise>
+                #{productName}
+            </otherwise>
+        </choose>
+        AND d.dict_type = 'product_type'
+        LIMIT 1)
         ORDER BY pr.create_time DESC
         LIMIT 1
     </select>

--
Gitblit v1.9.3