2023-01-10 08:59:17 +00:00
|
|
|
<?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.dbnt.faisp.main.fpiMgt.monitoring.mapper.MonitoringMapper">
|
|
|
|
|
<sql id="selectDesignationListWhere">
|
|
|
|
|
<where>
|
2023-05-09 04:39:34 +00:00
|
|
|
md_state <> 'DST008'
|
2023-01-10 08:59:17 +00:00
|
|
|
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
|
|
|
|
and md.wrt_user_seq = #{wrtUserSeq}
|
|
|
|
|
</if>
|
|
|
|
|
<if test='wrtUserNm != null and wrtUserNm != ""'>
|
|
|
|
|
and md.wrt_user_nm like '%'||#{wrtUserNm}||'%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test='wrtOrgan != null and wrtOrgan != ""'>
|
|
|
|
|
and md.wrt_organ = #{wrtOrgan}
|
|
|
|
|
</if>
|
|
|
|
|
<if test='mdTitle != null and mdTitle != ""'>
|
|
|
|
|
and md.md_title like '%'||#{mdTitle}||'%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test='mdState != null and mdState != ""'>
|
|
|
|
|
and md.md_state = #{mdState}
|
|
|
|
|
</if>
|
2023-01-11 03:14:41 +00:00
|
|
|
<if test='dateSelector == "mdDt"'>
|
2023-01-10 08:59:17 +00:00
|
|
|
<if test='startDate != null and startDate != ""'>
|
|
|
|
|
and md.md_dt >= #{startDate}::date
|
|
|
|
|
</if>
|
|
|
|
|
<if test='endDate != null and endDate != ""'>
|
2023-01-11 03:14:41 +00:00
|
|
|
and md.md_dt <= #{endDate}::date
|
2023-01-10 08:59:17 +00:00
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test='dateSelector == "wrtDt"'>
|
|
|
|
|
<if test='startDate != null and startDate != ""'>
|
|
|
|
|
and md.wrt_dt >= #{startDate}::date
|
|
|
|
|
</if>
|
|
|
|
|
<if test='endDate != null and endDate != ""'>
|
|
|
|
|
and md.wrt_dt <= #{endDate}::date+1
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="downOrganCdList != null">
|
|
|
|
|
and md.wrt_organ in
|
|
|
|
|
<foreach collection="downOrganCdList" item="organCd" separator="," open="(" close=")">
|
|
|
|
|
#{organCd}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType != null and userType != ""'>
|
|
|
|
|
<if test='userType == "normalStayList"'>
|
|
|
|
|
and md_state in ('DST002', 'DST004')
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType == "normalCommitList"'>
|
|
|
|
|
and md_state in ('DST003', 'DST005', 'DST006')
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType == "sectionCommitList"'>
|
|
|
|
|
and md_state in ('DST003', 'DST004', 'DST005', 'DST006')
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType == "headCommitList"'>
|
|
|
|
|
and md_state in ('DST003', 'DST005', 'DST006')
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType == "managerStayList"'>
|
|
|
|
|
and md_state in ('DST002', 'DST004')
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType == "managerCommitList"'>
|
|
|
|
|
and md_state in ('DST003', 'DST005', 'DST006')
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</sql>
|
|
|
|
|
<select id="selectDesignationList" resultType="MonitoringDesignation" parameterType="MonitoringDesignation">
|
|
|
|
|
select md.md_key,
|
|
|
|
|
md_dt,
|
|
|
|
|
md_title,
|
|
|
|
|
md_name,
|
|
|
|
|
md_nationality,
|
|
|
|
|
md_rank,
|
|
|
|
|
md_birth,
|
|
|
|
|
md_address,
|
|
|
|
|
(select item_value from code_mgt where item_cd = md_state) as md_state,
|
|
|
|
|
wrt_user_seq,
|
|
|
|
|
(select item_value from code_mgt where item_cd = wrt_organ) as wrt_organ,
|
|
|
|
|
(select item_value from code_mgt where item_cd = wrt_part) as wrt_part,
|
|
|
|
|
(select item_value from code_mgt where item_cd = wrt_user_grd) as wrt_user_grd,
|
|
|
|
|
wrt_user_nm,
|
|
|
|
|
wrt_dt,
|
|
|
|
|
b.fileCnt
|
|
|
|
|
from monitoring_designation md
|
|
|
|
|
left outer join (select md_key,
|
|
|
|
|
count(file_seq) as fileCnt
|
|
|
|
|
from monitoring_designation_file mdf
|
|
|
|
|
group by md_key) b
|
|
|
|
|
on md.md_key = b.md_key
|
|
|
|
|
<include refid="selectDesignationListWhere"></include>
|
|
|
|
|
order by md.md_key desc
|
|
|
|
|
limit #{rowCnt} offset #{firstIndex}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectDesignationListCnt" resultType="Integer" parameterType="MonitoringDesignation">
|
|
|
|
|
select count(*)
|
|
|
|
|
from monitoring_designation md
|
|
|
|
|
<include refid="selectDesignationListWhere"></include>
|
|
|
|
|
</select>
|
2023-02-02 08:36:59 +00:00
|
|
|
|
|
|
|
|
<sql id="selectResultListWhere">
|
2023-05-09 04:39:34 +00:00
|
|
|
and mr_state <> 'DST008'
|
2023-02-02 08:36:59 +00:00
|
|
|
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
|
|
|
|
and mr.wrt_user_seq = #{wrtUserSeq}
|
|
|
|
|
</if>
|
|
|
|
|
<if test='wrtUserNm != null and wrtUserNm != ""'>
|
|
|
|
|
and mr.wrt_user_nm like '%'||#{wrtUserNm}||'%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test='wrtOrgan != null and wrtOrgan != ""'>
|
|
|
|
|
and mr.wrt_organ = #{wrtOrgan}
|
|
|
|
|
</if>
|
2023-02-09 06:26:05 +00:00
|
|
|
<if test='clearTitle != null and clearTitle != ""'>
|
|
|
|
|
and mr.clear_title like '%'||#{clearTitle}||'%'
|
2023-02-02 08:36:59 +00:00
|
|
|
</if>
|
|
|
|
|
<if test='mrState != null and mrState != ""'>
|
|
|
|
|
and mr.mr_state = #{mrState}
|
|
|
|
|
</if>
|
2023-02-03 04:00:53 +00:00
|
|
|
<if test='dateSelector == "mrDt"'>
|
|
|
|
|
<if test='startDate != null and startDate != ""'>
|
|
|
|
|
and mr.mr_sdate >= #{startDate}::date
|
|
|
|
|
</if>
|
|
|
|
|
<if test='endDate != null and endDate != ""'>
|
|
|
|
|
and mr.mr_edate <= #{endDate}::date
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
2023-02-02 08:36:59 +00:00
|
|
|
<if test='dateSelector == "wrtDt"'>
|
|
|
|
|
<if test='startDate != null and startDate != ""'>
|
|
|
|
|
and mr.wrt_dt >= #{startDate}::date
|
|
|
|
|
</if>
|
|
|
|
|
<if test='endDate != null and endDate != ""'>
|
|
|
|
|
and mr.wrt_dt <= #{endDate}::date+1
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="downOrganCdList != null">
|
|
|
|
|
and mr.wrt_organ in
|
|
|
|
|
<foreach collection="downOrganCdList" item="organCd" separator="," open="(" close=")">
|
|
|
|
|
#{organCd}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType != null and userType != ""'>
|
|
|
|
|
<if test='userType == "normalStayList"'>
|
|
|
|
|
and mr_state in ('DST002', 'DST004')
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType == "normalCommitList"'>
|
|
|
|
|
and mr_state in ('DST003', 'DST005', 'DST006')
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType == "sectionCommitList"'>
|
|
|
|
|
and mr_state in ('DST003', 'DST004', 'DST005', 'DST006')
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType == "headCommitList"'>
|
|
|
|
|
and mr_state in ('DST003', 'DST005', 'DST006')
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType == "managerStayList"'>
|
|
|
|
|
and mr_state in ('DST002', 'DST004')
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType == "managerCommitList"'>
|
|
|
|
|
and mr_state in ('DST003', 'DST005', 'DST006')
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectResultList" resultType="MonitoringResult" parameterType="MonitoringResult">
|
|
|
|
|
select mr_key,
|
|
|
|
|
mr_title,
|
2023-02-09 06:26:05 +00:00
|
|
|
clear_title,
|
2023-02-02 08:36:59 +00:00
|
|
|
mr_sdate,
|
|
|
|
|
mr_edate,
|
|
|
|
|
md_dt,
|
|
|
|
|
md_name,
|
|
|
|
|
md_nationality,
|
|
|
|
|
md_rank,
|
|
|
|
|
mr.wrt_user_seq,
|
|
|
|
|
(select item_value from code_mgt where item_cd = mr.wrt_organ) as wrt_organ,
|
|
|
|
|
(select item_value from code_mgt where item_cd = mr.wrt_part) as wrt_part,
|
|
|
|
|
(select item_value from code_mgt where item_cd = mr.wrt_user_grd) as wrt_user_grd,
|
|
|
|
|
mr.wrt_user_nm,
|
|
|
|
|
mr.wrt_dt,
|
|
|
|
|
(select item_value from code_mgt where item_cd = mr_state) as mr_state
|
|
|
|
|
from monitoring_result mr,
|
|
|
|
|
monitoring_designation md
|
|
|
|
|
where mr.md_key = md.md_key
|
|
|
|
|
<include refid="selectResultListWhere"></include>
|
|
|
|
|
order by mr_key desc
|
|
|
|
|
limit #{rowCnt} offset #{firstIndex}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectResultListCnt" resultType="Integer" parameterType="MonitoringResult">
|
|
|
|
|
select count(*)
|
|
|
|
|
from(
|
|
|
|
|
select mr_key,
|
|
|
|
|
mr_title,
|
|
|
|
|
mr_sdate,
|
|
|
|
|
mr_edate,
|
|
|
|
|
md_dt,
|
|
|
|
|
md_name,
|
|
|
|
|
md_nationality,
|
|
|
|
|
md_rank,
|
|
|
|
|
mr.wrt_user_seq,
|
|
|
|
|
(select item_value from code_mgt where item_cd = mr.wrt_organ) as wrt_organ,
|
|
|
|
|
(select item_value from code_mgt where item_cd = mr.wrt_part) as wrt_part,
|
|
|
|
|
(select item_value from code_mgt where item_cd = mr.wrt_user_grd) as wrt_user_grd,
|
|
|
|
|
mr.wrt_user_nm,
|
|
|
|
|
mr.wrt_dt,
|
|
|
|
|
(select item_value from code_mgt where item_cd = mr_state) as mr_state
|
|
|
|
|
from monitoring_result mr,
|
|
|
|
|
monitoring_designation md
|
|
|
|
|
where mr.md_key = md.md_key
|
|
|
|
|
<include refid="selectResultListWhere"></include>
|
|
|
|
|
order by mr_key desc
|
|
|
|
|
)a
|
|
|
|
|
</select>
|
2023-01-10 08:59:17 +00:00
|
|
|
</mapper>
|