ludc
2023-10-09 c2c0c9370a72d253c624ff11d630d27c9cd0040d
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml
@@ -45,9 +45,9 @@
    </sql>
    <select id="selectPlCodeClassifyPage" resultMap="plCodeClassifyResultMap">
        select * from PL_CODE_CLASSIFY where is_deleted = 0
        select * from PL_CODE_CLASSIFY where
        <if test="tenantId != null and tenantId != ''">
            and tenant_id = #{tenantId}
            tenant_id = #{tenantId}
        </if>
    </select>
@@ -177,8 +177,14 @@
    </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 b.oid as oid,level from
                pl_code_classify  b
                    join (select oid
                          from  pl_code_classify
                                    start with oid = #{oid}
                          connect by oid = prior PARENTCODECLASSIFYOID) a on b.oid = a.OID
                start with b.PARENTCODECLASSIFYOID is null
            connect by prior b.oid = b.PARENTCODECLASSIFYOID
    </select>
    <select id="getIdPathToNamePathByParentId"  resultMap="plCodeClassifyResultMap">
@@ -241,7 +247,6 @@
                        SYS_CONNECT_BY_PATH(id, '#')   as paths
                    </otherwise>
                </choose>
        from pl_code_classify  plcodeclassify
                  START WITH parentCodeClassifyOid is null
              CONNECT BY PRIOR OID = parentCodeClassifyOid) codeclassify0
@@ -266,7 +271,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,
@@ -307,7 +312,7 @@
        <if test="tenantId != null and tenantId != ''">
            and codeclassify0.tenant_id = #{tenantId}
        </if>
        order by lastmodifytime desc
        order by id asc
    </select>
    <select id="selectClassifyByKeyAndReseRel" resultMap="plCodeClassifyResultMap">
@@ -363,7 +368,6 @@
        <if test="parentOid == null or parentOid == ''">
            and codeclassify0.parentcodeclassifyoid is null
        </if>
        <if test="tenantId != null and tenantId != ''">
            and codeclassify0.tenant_id = #{tenantId}
        </if>
@@ -410,7 +414,7 @@
            </foreach>
        </if>
        <if test="tenantId != null and tenantId != ''">
            codeclassify0.tenant_id = #{tenantId}
            and codeclassify0.tenant_id = #{tenantId}
        </if>
        order by id asc
    </select>
@@ -450,7 +454,6 @@
        <if test="desc != null">
            and  codeclassify0.DESCRIPTION = #{desc}
        </if>
        <if test="tenantId != null and tenantId != ''">
          and  codeclassify0.tenant_id = #{tenantId}
        </if>
@@ -513,4 +516,11 @@
        </foreach>
        ;END;
    </update>
    <select id="selectAllParents" resultMap="plCodeClassifyResultMap">
        select * from PL_CODE_CLASSIFY p
            start with p.OID =#{oid}
        connect by p.oid = prior p.PARENTCODECLASSIFYOID
    </select>
</mapper>