WholeProcessPlatform/backend/src/main/resources/mapper/qgc_base/SdRvcdDicMapper.xml
2026-06-09 17:17:59 +08:00

217 lines
7.2 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
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
<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>
</mapper>