From 1a07db181c732729abc1d6ec71ae206ecffca86d Mon Sep 17 00:00:00 2001
From: lihang <lihang@vci-tech.com>
Date: 星期三, 24 五月 2023 18:33:45 +0800
Subject: [PATCH] 迁移链接类型后台接口,修正属性字段,增加元数据查找应用范围功能
---
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 50 insertions(+), 8 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..44b7b0c 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,19 +131,54 @@
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>
+
+ <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 +190,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