From 057d3af95ae0346b98e394bdbbaa2c5a7c34f4af Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期二, 19 八月 2025 13:57:04 +0800
Subject: [PATCH] mdc算法公式自定义

---
 lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/MdcProductionMapper.xml |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 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..e162190 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
@@ -4,31 +4,31 @@
 
     <!--閫掑綊鏌ヨ鎵�鏈夊瓙鑺傜偣-->
     <select id="recursionChildren" resultType="java.lang.String">
-        WITH temp ( id ) AS (
+        WITH RECURSIVE temp ( id ) AS (
             SELECT
                 id
             FROM
                 mdc_production
             WHERE
-                id = #{ productionId } UNION ALL
+                id = #{productionId}  UNION ALL
             SELECT
                 a.id
             FROM
                 mdc_production a
-                    INNER JOIN temp ON a.parent_id = temp.id
+                INNER JOIN temp ON a.parent_id = temp.id
         ) SELECT
             *
-        FROM
-            temp
+      FROM
+          temp
     </select>
 
     <!--鏍规嵁鐢ㄦ埛id鍜岃溅闂磇d鑾峰彇鐢ㄦ埛鎷ユ湁鐨勮溅闂磇d-->
     <select id="findFirstProduction" resultType="java.lang.String">
-        SELECT TOP 1 t2.id FROM mdc_user_production t1 LEFT JOIN mdc_production t2 ON t1.pro_id = t2.id WHERE t1.user_id = #{ userId } AND t2.parent_id = #{productionId}
+        SELECT t2.id FROM mdc_user_production t1 LEFT JOIN mdc_production t2 ON t1.pro_id = t2.id WHERE t1.user_id = #{ userId } AND t2.parent_id = #{productionId} LIMIT 1
     </select>
 
     <!--鏍规嵁鐢ㄦ埛id鏌ヨ鐢ㄦ埛宸ユ鏉冮檺-->
     <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 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' LIMIT 1
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3