From 73dbe864eb18a1a4df4f41caed1dd128faf1b2ec Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 02 六月 2023 19:11:27 +0800
Subject: [PATCH] 引用码段关于业务类型接口的联调,重复使用的界面抽离成单独组件

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml |   67 +++++++++++++++++++++++++++------
 1 files changed, 55 insertions(+), 12 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 32e88c9..8485e2a 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
@@ -47,14 +47,14 @@
     <select id="selectAllLevelChildOid" resultType="java.util.HashMap">
         select oid, level
         from PL_CODE_CLASSIFY
-                 START WITH parentCodeClassifyOid = #{oid}CONNECT BY
+                 START WITH parentCodeClassifyOid = #{oid} CONNECT BY
             PRIOR OID = parentCodeClassifyOid
     </select>
 
     <select id="checkHasChild" resultType="java.lang.Boolean">
-        select count(oid)
+        <![CDATA[select count(oid)
         from PL_CODE_CLASSIFY
-        where parentCodeClassifyOid = #{oid}
+        where parentCodeClassifyOid = #{oid}]]>
     </select>
 
     <select id="selectCodeClassifyVOByTree" resultMap="plCodeClassifyResultMap">
@@ -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,19 +131,55 @@
                  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 = ''">
+            <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 oid,
+               level from pl_code_classify start with oid= #{oid} connect by prior PARENTCODECLASSIFYOID = oid
+    </select>
+
+    <select id="selectByFieldNamePath"  resultMap="plCodeClassifyResultMap">
+        select codeclassify0.OWNER                 as owner,
+               codeclassify0.BTMTYPEID             as btmtypeid,
+               codeclassify0.CREATOR               as creator,
+               codeclassify0.CREATETIME            as createtime,
+               codeclassify0.LASTMODIFIER          as lastmodifier,
+               codeclassify0.DESCRIPTION           as description,
+               codeclassify0.ORDERNUM              as ordernum,
+               codeclassify0.CODERULEOID           as coderuleoid,
+               codeclassify0.OID                   as oid,
+               codeclassify0.BTMNAME               as btmname,
+               codeclassify0.BTMTYPENAME           as btmtypename,
+               codeclassify0.CODEKEYATTRREPEATOID  as codekeyattrrepeatoid,
+               codeclassify0.PARENTCODECLASSIFYOID as parentcodeclassifyoid,
+               codeclassify0.NAME                  as name,
+               codeclassify0.LASTMODIFYTIME        as lastmodifytime,
+               codeclassify0.ID                    as id,
+               codeclassify0.CODERESEMBLERULEOID   as coderesembleruleoid,
+               codeclassify0.LCSTATUS              as lcstatus,
+               codeclassify0.TS                    as ts,
+               codeclassify0.paths                 as paths
+        from (select plcodeclassify.*,
+                <choose>
+                     <when test='fieldName=="name"'>
+                         SUBSTR(SYS_CONNECT_BY_PATH(name, '##'),3)   as paths
+                     </when>
+                    <otherwise>
+                        SUBSTR(SYS_CONNECT_BY_PATH(id, '##'),3)   as paths
+                    </otherwise>
+                </choose>
+
+        from pl_code_classify  plcodeclassify
+                  START WITH parentCodeClassifyOid is null
+              CONNECT BY PRIOR OID = parentCodeClassifyOid) codeclassify0
+        where codeclassify0.paths =#{fieldPath}
     </select>
 
     <select id="selectByFieldPath" resultType="java.util.HashMap">
@@ -156,4 +191,12 @@
         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