From 103f52ade0f77e420dec306ea3b51d0a3c0ac3ee Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期三, 19 三月 2025 13:23:12 +0800
Subject: [PATCH] art: 设备管理-系统业务编码生成,工艺参数维护功能修改

---
 lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/MdcProductionMapper.xml |   39 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/MdcProductionMapper.xml b/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/MdcProductionMapper.xml
index 119e935..963f879 100644
--- a/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/MdcProductionMapper.xml
+++ b/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/MdcProductionMapper.xml
@@ -31,4 +31,41 @@
     <select id="findThreeProductionId" resultType="java.lang.String">
         SELECT TOP 1 t2.id id FROM mdc_user_production t1 LEFT JOIN mdc_production t2 ON t1.pro_id = t2.id WHERE t1.user_id = #{userId} AND t2.org_type = '3'
     </select>
-</mapper>
\ No newline at end of file
+    <select id="findAllProductionId" resultType="org.jeecg.modules.system.entity.MdcProduction">
+        SELECT
+            t1.*
+        FROM
+            mdc_production t1
+                LEFT JOIN mdc_user_production t2 ON t1.id = t2.pro_id
+                LEFT JOIN sys_user t3 on t3.ID=t2.user_id
+        WHERE
+            t3.id = #{userId}
+          AND t1.org_type = '3'
+    </select>
+    <select id="recursionChildrenByList" resultType="java.lang.String">
+        WITH temp (id) AS (
+            -- 鍒濆鏌ヨ锛岃幏鍙栨寚瀹� id 鐨勮褰�
+            SELECT
+                id
+            FROM
+                mdc_production
+            WHERE
+                id IN
+            <foreach collection = "productionIds" item = "id" index = "index" open = "(" close = ")" separator = ",">
+                 #{id}
+            </foreach>
+            UNION ALL
+            -- 閫掑綊鏌ヨ锛屾煡鎵惧瓙鑺傜偣
+            SELECT
+                a.id
+            FROM
+                mdc_production a
+                    INNER JOIN temp ON a.parent_id = temp.id
+        )
+-- 鏈�缁堟煡璇紝浣跨敤 DISTINCT 鍘婚噸
+        SELECT DISTINCT
+            id
+        FROM
+            temp;
+    </select>
+</mapper>

--
Gitblit v1.9.3