From 1612759809f61b59a78c5dddc85b60ee8def21c8 Mon Sep 17 00:00:00 2001
From: lihang <lihang@vci-tech.com>
Date: 星期二, 09 五月 2023 16:54:49 +0800
Subject: [PATCH] 业务类型修正

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml |   36 +++++++++++++++++++++++++++---------
 1 files changed, 27 insertions(+), 9 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 761683d..f1fa535 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
@@ -87,12 +87,11 @@
                            on codeclassify0.codeKeyAttrRepeatOid = codekeyattrrepeatoid.oid
                  left join pl_code_resemblerule coderesembleruleoid
                            on codeclassify0.codeResembleRuleOid = coderesembleruleoid.oid
-        where
         <where>
             <if test="oid != null and oid != ''">
-                codeclassify0.parentcodeclassifyoid = #{oid}
+                codeclassify0.parentcodeclassifyoid = '${oid}'
             </if>
-            <if test="oid = null or oid = ''">
+            <if test="oid = null">
                 codeclassify0.parentcodeclassifyoid is null
             </if>
         </where>
@@ -132,15 +131,34 @@
                  left join pl_code_resemblerule coderesembleruleoid
                            on codeclassify0.codeResembleRuleOid = coderesembleruleoid.oid
             START WITH
-        <where>
-            <if test="oid != null and oid != ''">
-                codeclassify0.parentCodeClassifyOid = #{oid}
+            <if test="oid != null ">
+                codeclassify0.parentCodeClassifyOid = '${oid}'
             </if>
-            <if test="oid = null or oid = ''">
-                codeclassify0.parentCodeClassifyOid = is null
+            <if test="oid = null ">
+                codeclassify0.parentCodeClassifyOid is null
             </if>
-        </where>
         CONNECT BY PRIOR codeclassify0.OID = codeclassify0.parentCodeClassifyOid
     </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>
+
+    <select id="selectByFieldPath" resultType="java.util.HashMap">
+        select *
+        from (select oid, SYS_CONNECT_BY_PATH(id, '/') as paths
+              from pl_code_classify
+                       START WITH parentCodeClassifyOid is null
+              CONNECT BY PRIOR OID = parentCodeClassifyOid) a
+        where a.paths = #{fieldPath}
+    </select>
+
+    <select id="selectAllLevelParents" resultType="java.util.HashMap">
+        select oid, id, name, btmtypeid, btmtypename
+            from PL_CODE_CLASSIFY
+            where btmtypeid is not null
+                start with oid = #{oid}
+            connect by prior PARENTCODECLASSIFYOID = oid
+    </select>
+
 </mapper>

--
Gitblit v1.9.3