72 lines
2.5 KiB
XML
72 lines
2.5 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.dbnt.faisp.main.counterIntelligence.activityCase.mapper.ActivityCaseMapper">
|
||
|
|
<sql id="selectActivityCaseListWhere">
|
||
|
|
<where>
|
||
|
|
<if test='wrtUserNm != null and wrtUserNm != ""'>
|
||
|
|
and a.wrt_user_nm like '%'||#{wrtUserNm}||'%'
|
||
|
|
</if>
|
||
|
|
<if test='wrtOrgan != null and wrtOrgan != ""'>
|
||
|
|
and a.wrt_organ = #{wrtOrgan}
|
||
|
|
</if>
|
||
|
|
<if test='dateSelector == "receiptDt"'>
|
||
|
|
<if test='startDate != null and startDate != ""'>
|
||
|
|
and a.receipt_dt >= #{startDate}::date
|
||
|
|
</if>
|
||
|
|
<if test='endDate != null and endDate != ""'>
|
||
|
|
and a.receipt_dt <= #{endDate}::date+1
|
||
|
|
</if>
|
||
|
|
</if>
|
||
|
|
<if test='dateSelector == "resultDt"'>
|
||
|
|
<if test='startDate != null and startDate != ""'>
|
||
|
|
and a.result_dt >= #{startDate}::date
|
||
|
|
</if>
|
||
|
|
<if test='endDate != null and endDate != ""'>
|
||
|
|
and a.result_dt <= #{endDate}::date+1
|
||
|
|
</if>
|
||
|
|
</if>
|
||
|
|
<if test='dateSelector == "wrtDt"'>
|
||
|
|
<if test='startDate != null and startDate != ""'>
|
||
|
|
and a.wrt_dt >= #{startDate}::date
|
||
|
|
</if>
|
||
|
|
<if test='endDate != null and endDate != ""'>
|
||
|
|
and a.wrt_dt <= #{endDate}::date+1
|
||
|
|
</if>
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
</sql>
|
||
|
|
<select id="selectActivityCaseList" parameterType="ActivityCase" resultType="ActivityCase">
|
||
|
|
select a.ciw_key,
|
||
|
|
a.status,
|
||
|
|
a.work_rating,
|
||
|
|
a.work_start_date,
|
||
|
|
a.work_end_date,
|
||
|
|
a.re_rating_date1,
|
||
|
|
a.re_rating_date2,
|
||
|
|
a.title,
|
||
|
|
a.wrt_organ,
|
||
|
|
a.wrt_part,
|
||
|
|
a.wrt_user_seq,
|
||
|
|
a.wrt_user_grd,
|
||
|
|
a.wrt_user_nm,
|
||
|
|
a.wrt_dt,
|
||
|
|
b.fileCnt
|
||
|
|
from counter_intelligence_work a
|
||
|
|
left outer join (select ciw_key, count(*) as fileCnt from ciw_file group by ciw_key) b
|
||
|
|
on a.ciw_key = b.ciw_key
|
||
|
|
<include refid="selectActivityCaseListWhere"></include>
|
||
|
|
ORDER BY a.ciw_key DESC
|
||
|
|
LIMIT #{rowCnt} OFFSET #{firstIndex}
|
||
|
|
</select>
|
||
|
|
<select id="selectActivityCaseCnt" parameterType="ActivityCase" resultType="int">
|
||
|
|
select count(*)
|
||
|
|
from counter_intelligence_work a
|
||
|
|
left outer join (select ciw_key, count(*) as fileCnt from ciw_file group by ciw_key) b
|
||
|
|
on a.ciw_key = b.ciw_key
|
||
|
|
<include refid="selectActivityCaseListWhere"></include>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
</mapper>
|