From aa3b56b8ab335277351f503b8d38e1a0a5fe7477 Mon Sep 17 00:00:00 2001
From: yuxc <653031404@qq.com>
Date: 星期四, 14 九月 2023 18:28:51 +0800
Subject: [PATCH] 1、处理层级码段生成问题。

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml b/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml
index 69dba1b..40dfb07 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml
@@ -177,8 +177,14 @@
     </select>
 
     <select id="selectAllLevelParentByOid" resultType="java.util.HashMap">
-        select oid,
-               level from pl_code_classify start with oid= #{oid} connect by prior PARENTCODECLASSIFYOID = oid
+            select b.oid as oid,level from
+                pl_code_classify  b
+                    join (select oid
+                          from  pl_code_classify
+                                    start with oid = #{oid}
+                          connect by oid = prior PARENTCODECLASSIFYOID) a on b.oid = a.OID
+                start with b.PARENTCODECLASSIFYOID is null
+            connect by prior b.oid = b.PARENTCODECLASSIFYOID
     </select>
 
     <select id="getIdPathToNamePathByParentId"  resultMap="plCodeClassifyResultMap">
@@ -510,4 +516,11 @@
         </foreach>
         ;END;
     </update>
+
+    <select id="selectAllParents" resultMap="plCodeClassifyResultMap">
+        select * from PL_CODE_CLASSIFY p
+            start with p.OID =#{oid}
+        connect by p.oid = prior p.PARENTCODECLASSIFYOID
+    </select>
+
 </mapper>

--
Gitblit v1.9.3