From 087511862a295eda0cf808a92f2ed2df348d54ff Mon Sep 17 00:00:00 2001
From: fujunling <2984387807@qq.com>
Date: 星期五, 26 五月 2023 19:00:23 +0800
Subject: [PATCH] 动态表单
---
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml | 65 +++++++++++++++++++++++++++-----
1 files changed, 54 insertions(+), 11 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..b054ef5 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
@@ -52,9 +52,9 @@
</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