From 778cde15e534dcb350f1354de6ebae88f279414e Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 08 三月 2024 10:15:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml | 176 ++++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 140 insertions(+), 36 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 40dfb07..3af89eb 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
@@ -37,7 +37,9 @@
<result column="CODERULEOID" property="codeRuleOid"/>
<result column="CODEKEYATTRREPEATOID" property="codeKeyAttrRepeatOid"/>
<result column="CODERESEMBLERULEOID" property="codeResembleRuleOid"/>
+ <result column="ISPARTICIPATECHECK" property="isParticipateCheck"/>
<result column="TENANT_ID" property="tenantId"/>
+ <result column="TOTAL" property="total"/>
</resultMap>
<sql id="tableName">
@@ -56,6 +58,13 @@
from PL_CODE_CLASSIFY
START WITH parentCodeClassifyOid = #{oid} CONNECT BY
PRIOR OID = parentCodeClassifyOid
+ </select>
+
+ <select id="selectAllParentOid" resultType="java.lang.String">
+ SELECT oid
+ FROM PL_CODE_CLASSIFY
+ START WITH oid = #{oid}
+ CONNECT BY PRIOR PARENTCODECLASSIFYOID = oid
</select>
<select id="checkHasChild" resultType="java.lang.Boolean">
@@ -87,26 +96,28 @@
codeclassify0.TENANT_ID as tenantId ,
coderuleoid.name as codeRuleOidName,
codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName,
- coderesembleruleoid.name as codeResembleRuleOidName
+ coderesembleruleoid.name as codeResembleRuleOidName,
+ codeclassify0.ISPARTICIPATECHECK as isParticipateCheck
from pl_code_classify codeclassify0
- left join pl_code_rule coderuleoid
- on codeclassify0.codeRuleOid = coderuleoid.oid
- left join pl_code_keyattrrepeat codekeyattrrepeatoid
- on codeclassify0.codeKeyAttrRepeatOid = codekeyattrrepeatoid.oid
- left join pl_code_resemblerule coderesembleruleoid
- on codeclassify0.codeResembleRuleOid = coderesembleruleoid.oid
+ left join pl_code_rule coderuleoid
+ on codeclassify0.codeRuleOid = coderuleoid.oid
+ left join pl_code_keyattrrepeat codekeyattrrepeatoid
+ on codeclassify0.codeKeyAttrRepeatOid = codekeyattrrepeatoid.oid
+ left join pl_code_resemblerule coderesembleruleoid
+ on codeclassify0.codeResembleRuleOid = coderesembleruleoid.oid
<where>
+ 1=1
<if test="oid != null and oid != ''">
- codeclassify0.parentcodeclassifyoid = '${oid}'
+ and codeclassify0.parentcodeclassifyoid = ${oid}
</if>
<if test="oid = null">
- codeclassify0.parentcodeclassifyoid is null
+ and codeclassify0.parentcodeclassifyoid is null
</if>
<if test="tenantId != null and tenantId != ''">
- codeclassify0.tenant_id = #{tenantId}
+ and codeclassify0.tenant_id = #{tenantId}
</if>
</where>
- order by lastmodifytime asc
+ order by id asc
</select>
<select id="selectAllLevelChildHasPath" resultMap="plCodeClassifyResultMap">
@@ -129,6 +140,7 @@
codeclassify0.CODERESEMBLERULEOID as coderesembleruleoid,
codeclassify0.LCSTATUS as lcstatus,
codeclassify0.TS as ts,
+ codeclassify0.ISPARTICIPATECHECK as isParticipateCheck,
coderuleoid.name as codeRuleOidName,
codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName,
coderesembleruleoid.name as codeResembleRuleOidName,
@@ -153,10 +165,13 @@
on codeclassify0.codeResembleRuleOid = coderesembleruleoid.oid
START WITH
<if test="oid != null ">
- codeclassify0.parentCodeClassifyOid = '${oid}'
+ codeclassify0.parentCodeClassifyOid = #{oid}
</if>
<if test="oid == null ">
codeclassify0.parentCodeClassifyOid is null
+ </if>
+ <if test="tenantId != null and tenantId != ''">
+ and codeclassify0.tenant_id = #{tenantId}
</if>
CONNECT BY PRIOR codeclassify0.OID = codeclassify0.parentCodeClassifyOid
</select>
@@ -207,8 +222,9 @@
codeclassify0.CODERESEMBLERULEOID as coderesembleruleoid,
codeclassify0.LCSTATUS as lcstatus,
codeclassify0.TS as ts,
- codeclassify0.namePath as namepath,
- codeclassify0.idPath as idpath
+ codeclassify0.namePath as namepath,
+ codeclassify0.idPath as idpath,
+ codeclassify0.ISPARTICIPATECHECK as isParticipateCheck
from (select plcodeclassify.*,
SYS_CONNECT_BY_PATH(name, '#') as namePath,
SYS_CONNECT_BY_PATH(id, '#') as idPath
@@ -237,7 +253,8 @@
codeclassify0.CODERESEMBLERULEOID as coderesembleruleoid,
codeclassify0.LCSTATUS as lcstatus,
codeclassify0.TS as ts,
- codeclassify0.paths as paths
+ codeclassify0.paths as paths,
+ codeclassify0.ISPARTICIPATECHECK as isParticipateCheck
from (select plcodeclassify.*,
<choose>
<when test='fieldName=="name"'>
@@ -271,7 +288,7 @@
</select>
<select id="selectCodeClassifyDOByTree" resultMap="plCodeClassifyResultMap">
- select codeclassify0.OWNER as owner,
+ select codeclassify0.OWNER as owner,
codeclassify0.BTMTYPEID as btmtypeid,
codeclassify0.CREATOR as creator,
codeclassify0.CREATETIME as createtime,
@@ -290,7 +307,8 @@
codeclassify0.CODERESEMBLERULEOID as coderesembleruleoid,
codeclassify0.LCSTATUS as lcstatus,
codeclassify0.TS as ts,
- codeclassify0.TENANT_ID as tenantId ,
+ codeclassify0.TENANT_ID as tenantId,
+ codeclassify0.ISPARTICIPATECHECK as isParticipateCheck,
coderuleoid.name as codeRuleOidName,
codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName,
coderesembleruleoid.name as codeResembleRuleOidName
@@ -302,17 +320,14 @@
left join pl_code_resemblerule coderesembleruleoid
on codeclassify0.codeResembleRuleOid = coderesembleruleoid.oid
where codeclassify0.lcstatus = #{lcstatus}
- <if test="parentcodeclassifyoid != null and parentcodeclassifyoid != ''">
- and codeclassify0.parentcodeclassifyoid = #{parentcodeclassifyoid}
- </if>
- <if test="parentcodeclassifyoid == null or parentcodeclassifyoid == ''">
- and codeclassify0.parentcodeclassifyoid is null
- and codeclassify0.id = #{id}
- </if>
<if test="tenantId != null and tenantId != ''">
- and codeclassify0.tenant_id = #{tenantId}
+ AND codeclassify0.tenant_id = #{tenantId}
</if>
- order by lastmodifytime desc
+ START WITH
+ codeclassify0.ID = #{id}
+ CONNECT BY
+ PRIOR codeclassify0.OID = codeclassify0.parentCodeClassifyOid
+ order by id asc
</select>
<select id="selectClassifyByKeyAndReseRel" resultMap="plCodeClassifyResultMap">
@@ -353,7 +368,8 @@
codeclassify0.TENANT_ID as tenantId ,
coderuleoid.name as codeRuleOidName,
codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName,
- coderesembleruleoid.name as codeResembleRuleOidName
+ coderesembleruleoid.name as codeResembleRuleOidName,
+ codeclassify0.ISPARTICIPATECHECK as isParticipateCheck
from pl_code_classify codeclassify0
left join pl_code_rule coderuleoid
on codeclassify0.codeRuleOid = coderuleoid.oid
@@ -375,7 +391,7 @@
</select>
<select id="getRMLibByName" resultMap="plCodeClassifyResultMap">
- select codeclassify0.OWNER as owner,
+ select codeclassify0.OWNER as owner,
codeclassify0.BTMTYPEID as btmtypeid,
codeclassify0.CREATOR as creator,
codeclassify0.CREATETIME as createtime,
@@ -395,6 +411,7 @@
codeclassify0.LCSTATUS as lcstatus,
codeclassify0.TS as ts,
codeclassify0.TENANT_ID as tenantId ,
+ codeclassify0.ISPARTICIPATECHECK as isParticipateCheck,
coderuleoid.name as codeRuleOidName,
codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName,
coderesembleruleoid.name as codeResembleRuleOidName
@@ -440,6 +457,7 @@
codeclassify0.LCSTATUS as lcstatus,
codeclassify0.TS as ts,
codeclassify0.TENANT_ID as tenantId ,
+ codeclassify0.ISPARTICIPATECHECK as isParticipateCheck,
coderuleoid.name as codeRuleOidName,
codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName,
coderesembleruleoid.name as codeResembleRuleOidName
@@ -458,6 +476,52 @@
and codeclassify0.tenant_id = #{tenantId}
</if>
order by id asc
+ </select>
+
+ <!--鑾峰彇鎵�鏈変笅绾ц妭鐐�,涓嶈鍔ㄨ繖涓柟娉晄ql-->
+ <select id="selectAllClassifyByOid" 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.TENANT_ID as tenantId ,
+ codeclassify0.ISPARTICIPATECHECK as isParticipateCheck,
+ coderuleoid.name as codeRuleOidName,
+ codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName,
+ coderesembleruleoid.name as codeResembleRuleOidName
+ from pl_code_classify codeclassify0
+ left join pl_code_rule coderuleoid
+ on codeclassify0.codeRuleOid = coderuleoid.oid
+ left join pl_code_keyattrrepeat codekeyattrrepeatoid
+ on codeclassify0.codeKeyAttrRepeatOid = codekeyattrrepeatoid.oid
+ left join pl_code_resemblerule coderesembleruleoid
+ on codeclassify0.codeResembleRuleOid = coderesembleruleoid.oid
+ start with codeclassify0.oid=#{oid}
+ <if test="tenantId != null and tenantId != ''">
+ and codeclassify0.tenant_id = #{tenantId}
+ </if>
+ connect by prior codeclassify0.oid=codeclassify0.PARENTCODECLASSIFYOID
+ </select>
+
+ <select id="selectStartWithCurrentOid" resultMap="plCodeClassifyResultMap">
+ select * from <include refid="tableName"/>
+ start with oid = #{oid}
+ connect by prior oid = parentcodeclassifyoid;
</select>
<select id="selectAllParenClassifytByOid" resultMap="plCodeClassifyResultMap">
@@ -480,7 +544,8 @@
codeclassify0.CODERESEMBLERULEOID as coderesembleruleoid,
codeclassify0.LCSTATUS as lcstatus,
codeclassify0.TS as ts,
- codeclassify0.TENANT_ID as tenantId ,
+ codeclassify0.TENANT_ID as tenantId,
+ codeclassify0.ISPARTICIPATECHECK as isParticipateCheck,
coderuleoid.name as codeRuleOidName,
codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName,
coderesembleruleoid.name as codeResembleRuleOidName
@@ -495,13 +560,7 @@
<if test="tenantId != null and tenantId != ''">
and codeclassify0.tenant_id = #{tenantId}
</if>
- connect by prior PARENTCODECLASSIFYOID = codeclassify0.oid
- </select>
-
- <select id="selectStartWithCurrentOid" resultMap="plCodeClassifyResultMap">
- select * from <include refid="tableName"/>
- start with oid = #{oid}
- connect by prior oid = parentcodeclassifyoid;
+ connect by prior codeclassify0.PARENTCODECLASSIFYOID = codeclassify0.oid
</select>
<update id="batchUpdateLcStatus" parameterType="java.util.List">
@@ -523,4 +582,49 @@
connect by p.oid = prior p.PARENTCODECLASSIFYOID
</select>
+ <select id="selectLeafByParentClassifyOid" resultType="com.vci.ubcs.code.entity.CodeClassify">
+ select *
+ from (
+ select
+ oid,
+ name,
+ id,
+ level lvl,
+ isparticipatecheck,
+ nvl((select 'N'
+ from PL_CODE_CLASSIFY pcc1
+ where pcc.oid = pcc1.PARENTCODECLASSIFYOID
+ and rownum < 2),'Y') is_leaf
+ from PL_CODE_CLASSIFY pcc
+ start with pcc.PARENTCODECLASSIFYOID = #{topOid}
+ connect by pcc.PARENTCODECLASSIFYOID = prior oid
+ ) plcls
+ where
+ is_leaf = 'Y'
+ and isparticipatecheck = 0
+ and oid != #{currentOid}
+ </select>
+
+ <!--鏍规嵁椤跺眰鑺傜偣oid鏌ヨ鎵�鏈夊彾瀛愯妭鐐瑰垎绫籵id-->
+ <select id="selectLeafByPid" resultType="com.vci.ubcs.code.entity.CodeClassify">
+ select *
+ from (
+ select
+ oid,
+ name,
+ id,
+ level lvl,
+ isparticipatecheck,
+ nvl((select 'N'
+ from PL_CODE_CLASSIFY pcc1
+ where pcc.oid = pcc1.PARENTCODECLASSIFYOID
+ and rownum < 2),'Y') is_leaf
+ from PL_CODE_CLASSIFY pcc
+ start with pcc.oid = #{pid}
+ connect by pcc.PARENTCODECLASSIFYOID = prior oid
+ ) plcls
+ where
+ is_leaf = 'Y'
+ </select>
+
</mapper>
--
Gitblit v1.9.3