ludc
2024-02-01 a8d80ddd0aef61cbaf1dbe9fe7abec12f0835399
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml
@@ -60,6 +60,13 @@
            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">
        <![CDATA[select count(oid)
        from PL_CODE_CLASSIFY
@@ -101,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
@@ -110,7 +117,7 @@
               and  codeclassify0.tenant_id = #{tenantId}
            </if>
        </where>
        order by lastmodifytime asc
        order by id asc
    </select>
    <select id="selectAllLevelChildHasPath" resultMap="plCodeClassifyResultMap">
@@ -313,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>
@@ -601,5 +605,26 @@
        and oid != #{currentOid}
    </select>
    <!--根据顶层节点oid查询所有叶子节点分类oid-->
    <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 &lt; 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>