WholeProcessPlatform/backend/src/main/resources/mapper/qgc_base/SdRvcdDicMapper.xml
2026-08-04 17:19:25 +08:00

256 lines
9.0 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yfd.platform.qgc_base.mapper.SdRvcdDicMapper">
<resultMap id="BaseResultMap" type="com.yfd.platform.qgc_base.domain.SdRvcdDic">
<id column="RVCD" property="rvcd"/>
<result column="RVNM" property="rvnm"/>
<result column="PRVCD" property="prvcd"/>
<result column="GRD" property="grd"/>
<result column="PATH" property="path"/>
<result column="ORDER_INDEX" property="orderIndex"/>
<result column="LGTD" property="lgtd"/>
<result column="LTTD" property="lttd"/>
<result column="AREA" property="area"/>
<result column="PERIMETER" property="perimeter"/>
<result column="COUNTRY" property="country"/>
<result column="LOGO" property="logo"/>
<result column="INTRODUCE" property="introduce"/>
<result column="INFFILE" property="inffile"/>
<result column="SHORTNAME" property="shortname"/>
<result column="SHEPRANGE" property="sheprange"/>
<result column="BASEID" property="baseid"/>
<result column="ENABLED" property="enabled"/>
<result column="RECORD_USER" property="recordUser"/>
<result column="RECORD_TIME" property="recordTime"/>
<result column="MODIFY_USER" property="modifyUser"/>
<result column="MODIFY_TIME" property="modifyTime"/>
<result column="IS_DELETED" property="isDeleted"/>
<result column="DELETE_USER" property="deleteUser"/>
<result column="DELETE_TIME" property="deleteTime"/>
</resultMap>
<select id="selectByPrvcd" resultMap="BaseResultMap">
SELECT * FROM SD_RVCD_DIC
WHERE 1=1
AND NVL(ENABLED, 1) = 1
AND NVL(IS_DELETED, 0) = 0
<if test="prvcd != null and prvcd != ''">
AND PRVCD = #{prvcd}
</if>
<if test="prvcd == null or prvcd == ''">
AND (PRVCD IS NULL OR PRVCD = '')
</if>
ORDER BY ORDER_INDEX ASC
</select>
<select id="selectRootList" resultMap="BaseResultMap">
SELECT * FROM SD_RVCD_DIC
WHERE NVL(ENABLED, 1) = 1
AND NVL(IS_DELETED, 0) = 0
AND (PRVCD IS NULL OR PRVCD = '' OR PRVCD = '0')
ORDER BY ORDER_INDEX ASC
</select>
<select id="selectRegDropdown" resultMap="BaseResultMap">
SELECT *
FROM V_SD_RVCD_DIC_TREE
WHERE 1=1
<if test="rvcd != null and rvcd != ''">
AND RVCD = #{rvcd}
</if>
<if test="rvnm != null and rvnm != ''">
AND RVNM LIKE '%' || #{rvnm} || '%'
</if>
ORDER BY ORDER_PATH ASC, RVCD ASC
</select>
<!-- <select id="selectRegDropdown" resultMap="BaseResultMap">-->
<!-- SELECT-->
<!-- t.RVCD,-->
<!-- t.DISPLAY_RVNM AS RVNM,-->
<!-- t.PRVCD,-->
<!-- t.GRD,-->
<!-- t.PATH,-->
<!-- t.ORDER_INDEX,-->
<!--&#45;&#45; t.LGTD,-->
<!--&#45;&#45; t.LTTD,-->
<!--&#45;&#45; t.AREA,-->
<!--&#45;&#45; t.PERIMETER,-->
<!--&#45;&#45; t.COUNTRY,-->
<!--&#45;&#45; t.LOGO,-->
<!--&#45;&#45; t.INTRODUCE,-->
<!--&#45;&#45; t.INFFILE,-->
<!-- t.SHORTNAME,-->
<!-- t.SHEPRANGE,-->
<!-- t.BASEID-->
<!--&#45;&#45; ,-->
<!--&#45;&#45; t.ENABLED,-->
<!--&#45;&#45; t.RECORD_USER,-->
<!--&#45;&#45; t.RECORD_TIME,-->
<!--&#45;&#45; t.MODIFY_USER,-->
<!--&#45;&#45; t.MODIFY_TIME,-->
<!--&#45;&#45; t.IS_DELETED,-->
<!--&#45;&#45; t.DELETE_USER,-->
<!--&#45;&#45; t.DELETE_TIME-->
<!-- FROM (-->
<!-- SELECT-->
<!-- d.RVCD,-->
<!-- LTRIM(SYS_CONNECT_BY_PATH(d.RVNM, '-'), '-') AS DISPLAY_RVNM,-->
<!-- d.PRVCD,-->
<!-- d.GRD,-->
<!-- d.PATH,-->
<!-- d.ORDER_INDEX,-->
<!--&#45;&#45; d.LGTD,-->
<!--&#45;&#45; d.LTTD,-->
<!--&#45;&#45; d.AREA,-->
<!--&#45;&#45; d.PERIMETER,-->
<!--&#45;&#45; d.COUNTRY,-->
<!--&#45;&#45; d.LOGO,-->
<!--&#45;&#45; d.INTRODUCE,-->
<!--&#45;&#45; d.INFFILE,-->
<!-- d.SHORTNAME,-->
<!-- d.SHEPRANGE,-->
<!-- d.BASEID,-->
<!--&#45;&#45; d.ENABLED,-->
<!--&#45;&#45; d.RECORD_USER,-->
<!--&#45;&#45; d.RECORD_TIME,-->
<!--&#45;&#45; d.MODIFY_USER,-->
<!--&#45;&#45; d.MODIFY_TIME,-->
<!--&#45;&#45; d.IS_DELETED,-->
<!--&#45;&#45; d.DELETE_USER,-->
<!--&#45;&#45; d.DELETE_TIME,-->
<!-- SYS_CONNECT_BY_PATH(LPAD(NVL(d.ORDER_INDEX, 999999999), 10, '0'), '/') AS ORDER_PATH,-->
<!-- LEVEL AS TREE_LEVEL-->
<!-- FROM (-->
<!-- SELECT *-->
<!-- FROM SD_RVCD_DIC-->
<!-- WHERE NVL(ENABLED, 1) = 1-->
<!-- AND NVL(IS_DELETED, 0) = 0-->
<!-- ) d-->
<!-- START WITH d.PRVCD IS NULL OR d.PRVCD = '' OR d.PRVCD = '0'-->
<!-- CONNECT BY PRIOR d.RVCD = d.PRVCD-->
<!-- ORDER SIBLINGS BY d.ORDER_INDEX ASC, d.RVCD ASC-->
<!-- ) t-->
<!-- WHERE t.TREE_LEVEL > 1-->
<!-- <if test="rvcd != null and rvcd != ''">-->
<!-- AND t.RVCD = #{rvcd}-->
<!-- </if>-->
<!-- <if test="rvnm != null and rvnm != ''">-->
<!-- AND t.DISPLAY_RVNM LIKE '%' || #{rvnm} || '%'-->
<!-- </if>-->
<!-- ORDER BY t.ORDER_PATH ASC, t.RVCD ASC-->
<!-- </select>-->
<select id="selectRegDropdownWithEng" resultMap="BaseResultMap">
SELECT
t.RVCD,
t.DISPLAY_RVNM AS RVNM,
t.PRVCD,
t.GRD,
t.PATH,
t.ORDER_INDEX,
-- t.LGTD,
-- t.LTTD,
-- t.AREA,
-- t.PERIMETER,
-- t.COUNTRY,
-- t.LOGO,
-- t.INTRODUCE,
-- t.INFFILE,
t.SHORTNAME,
t.SHEPRANGE,
t.BASEID
-- ,
-- t.ENABLED,
-- t.RECORD_USER,
-- t.RECORD_TIME,
-- t.MODIFY_USER,
-- t.MODIFY_TIME,
-- t.IS_DELETED,
-- t.DELETE_USER,
-- t.DELETE_TIME
FROM (
SELECT
d.RVCD,
LTRIM(SYS_CONNECT_BY_PATH(d.RVNM, '-'), '-') AS DISPLAY_RVNM,
d.PRVCD,
d.GRD,
d.PATH,
d.ORDER_INDEX,
-- d.LGTD,
-- d.LTTD,
-- d.AREA,
-- d.PERIMETER,
-- d.COUNTRY,
-- d.LOGO,
-- d.INTRODUCE,
-- d.INFFILE,
d.SHORTNAME,
d.SHEPRANGE,
d.BASEID,
-- d.ENABLED,
-- d.RECORD_USER,
-- d.RECORD_TIME,
-- d.MODIFY_USER,
-- d.MODIFY_TIME,
-- d.IS_DELETED,
-- d.DELETE_USER,
-- d.DELETE_TIME,
SYS_CONNECT_BY_PATH(LPAD(NVL(d.ORDER_INDEX, 999999999), 10, '0'), '/') AS ORDER_PATH,
LEVEL AS TREE_LEVEL
FROM (
SELECT *
FROM SD_RVCD_DIC
WHERE NVL(ENABLED, 1) = 1
AND NVL(IS_DELETED, 0) = 0
) d
START WITH d.PRVCD IS NULL OR d.PRVCD = '' OR d.PRVCD = '0'
CONNECT BY PRIOR d.RVCD = d.PRVCD
ORDER SIBLINGS BY d.ORDER_INDEX ASC, d.RVCD ASC
) t
WHERE t.TREE_LEVEL > 1
AND EXISTS (
SELECT 1
FROM SD_ENGINFO_B_H eng
WHERE eng.REACHCD = t.RVCD
AND NVL(eng.IS_DELETED, 0) = 0
)
<if test="rvcd != null and rvcd != ''">
AND t.RVCD = #{rvcd}
</if>
<if test="rvnm != null and rvnm != ''">
AND t.DISPLAY_RVNM LIKE '%' || #{rvnm} || '%'
</if>
ORDER BY t.ORDER_PATH ASC, t.RVCD ASC
</select>
<select id="selectRvcdDropdown" resultType="com.yfd.platform.qgc_base.domain.SdRvcdDic">
SELECT
RVCD,
RVNM,
PRVCD,
GRD,
PATH,
ORDER_INDEX,
SHORTNAME,
SHEPRANGE,
BASEID
FROM SD_RVCD_DIC
WHERE NVL(ENABLED, 1) = 1
AND NVL(IS_DELETED, 0) = 0
AND (PRVCD IS NULL OR PRVCD = '' OR PRVCD = '0')
<if test="baseId != null and baseId != ''">
AND BASEID = #{baseId}
</if>
<if test="rvnm != null and rvnm != ''">
AND RVNM LIKE '%' || #{rvnm} || '%'
</if>
ORDER BY ORDER_INDEX ASC, RVCD ASC
</select>
</mapper>