From a8d80ddd0aef61cbaf1dbe9fe7abec12f0835399 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期四, 01 二月 2024 14:52:14 +0800 Subject: [PATCH] 代码合并 --- Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml | 110 ++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 84 insertions(+), 26 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 229b39f..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,6 +37,7 @@ <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> @@ -57,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"> @@ -88,7 +96,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 @@ -99,7 +108,7 @@ <where> 1=1 <if test="oid != null and oid != ''"> - and codeclassify0.parentcodeclassifyoid = ${oid} + and codeclassify0.parentcodeclassifyoid = ${oid} </if> <if test="oid = null"> and codeclassify0.parentcodeclassifyoid is null @@ -108,7 +117,7 @@ and codeclassify0.tenant_id = #{tenantId} </if> </where> - order by lastmodifytime asc + order by id asc </select> <select id="selectAllLevelChildHasPath" resultMap="plCodeClassifyResultMap"> @@ -131,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, @@ -155,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> @@ -209,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 @@ -239,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"'> @@ -292,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 @@ -304,16 +320,13 @@ 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> + START WITH + codeclassify0.ID = #{id} + CONNECT BY + PRIOR codeclassify0.OID = codeclassify0.parentCodeClassifyOid order by id asc </select> @@ -355,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 @@ -377,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, @@ -397,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 @@ -442,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 @@ -461,9 +477,10 @@ </if> order by id asc </select> + <!--鑾峰彇鎵�鏈変笅绾ц妭鐐�,涓嶈鍔ㄨ繖涓柟娉晄ql--> <select id="selectAllClassifyByOid" resultMap="plCodeClassifyResultMap"> - select codeclassify0.OWNER as owner, + select codeclassify0.OWNER as owner, codeclassify0.BTMTYPEID as btmtypeid, codeclassify0.CREATOR as creator, codeclassify0.CREATETIME as createtime, @@ -483,6 +500,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 @@ -526,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 @@ -542,12 +561,6 @@ and codeclassify0.tenant_id = #{tenantId} </if> connect by prior codeclassify0.PARENTCODECLASSIFYOID = codeclassify0.oid - </select> - - <select id="selectStartWithCurrentOid" resultMap="plCodeClassifyResultMap"> - select * from <include refid="tableName"/> - start with oid = #{oid} - connect by prior oid = parentcodeclassifyoid; </select> <update id="batchUpdateLcStatus" parameterType="java.util.List"> @@ -569,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