From a862e80c1ee46a77fc8a2dacf59b0110b3669550 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期一, 22 四月 2024 16:32:02 +0800
Subject: [PATCH] 参数修改

---
 lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/MdcProductionMapper.xml |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 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 ce695b0..119e935 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
@@ -2,4 +2,33 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.system.mapper.MdcProductionMapper">
 
+    <!--閫掑綊鏌ヨ鎵�鏈夊瓙鑺傜偣-->
+    <select id="recursionChildren" resultType="java.lang.String">
+        WITH temp ( id ) AS (
+            SELECT
+                id
+            FROM
+                mdc_production
+            WHERE
+                id = #{ productionId } UNION ALL
+            SELECT
+                a.id
+            FROM
+                mdc_production a
+                    INNER JOIN temp ON a.parent_id = temp.id
+        ) SELECT
+            *
+        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>
+
+    <!--鏍规嵁鐢ㄦ埛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>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3