2023-01-13 08:52:43 +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.intelligenceNetwork.mapper.IntelligenceNetworkMapper">
|
|
|
|
|
<sql id="selectOperationPlanListWhere">
|
|
|
|
|
<where>
|
|
|
|
|
<if test='wrtUserSeq != null and wrtUserSeq != ""'>
|
|
|
|
|
and op.wrt_user_seq = #{wrtUserSeq}
|
|
|
|
|
</if>
|
2023-01-16 07:46:49 +00:00
|
|
|
<if test='opName != null and opName != ""'>
|
|
|
|
|
and op.op_name like '%'||#{opName}||'%'
|
2023-01-13 08:52:43 +00:00
|
|
|
</if>
|
|
|
|
|
<if test='wrtOrgan != null and wrtOrgan != ""'>
|
|
|
|
|
and op.wrt_organ = #{wrtOrgan}
|
|
|
|
|
</if>
|
|
|
|
|
<if test='opState != null and opState != ""'>
|
|
|
|
|
and op.op_state = #{opState}
|
|
|
|
|
</if>
|
|
|
|
|
<if test='startDate != null and startDate != ""'>
|
|
|
|
|
and op.wrt_dt >= #{startDate}::date
|
|
|
|
|
</if>
|
|
|
|
|
<if test='endDate != null and endDate != ""'>
|
|
|
|
|
and op.wrt_dt <= #{endDate}::date+1
|
|
|
|
|
</if>
|
|
|
|
|
<if test="downOrganCdList != null">
|
|
|
|
|
and op.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 op_state in ('DST002')
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType == "normalCommitList"'>
|
|
|
|
|
and op_state in ('DST003', 'DST004', 'DST005', 'DST006')
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType == "sectionCommitList"'>
|
|
|
|
|
and op_state in ('DST003', 'DST004', 'DST005', 'DST006')
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType == "managerStayList"'>
|
|
|
|
|
and op_state in ('DST002')
|
|
|
|
|
</if>
|
|
|
|
|
<if test='userType == "managerCommitList"'>
|
|
|
|
|
and op_state in ('DST003', 'DST004', 'DST005', 'DST006')
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</sql>
|
|
|
|
|
<select id="selectOperationPlanList" resultType="OperationPlan" parameterType="OperationPlan">
|
|
|
|
|
select op.op_key,
|
|
|
|
|
op_name,
|
2023-01-16 07:46:49 +00:00
|
|
|
op_birth,
|
|
|
|
|
op_position,
|
|
|
|
|
op_phone,
|
|
|
|
|
op_rank,
|
|
|
|
|
op_state as status,
|
2023-01-13 08:52:43 +00:00
|
|
|
(select item_value from code_mgt where item_cd = op_state) as op_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 operation_plan op
|
|
|
|
|
left outer join (select op_key,
|
|
|
|
|
count(file_seq) as fileCnt
|
|
|
|
|
from operation_plan_file
|
|
|
|
|
group by op_key) b
|
|
|
|
|
on op.op_key = b.op_key
|
|
|
|
|
<include refid="selectOperationPlanListWhere"></include>
|
|
|
|
|
order by op.op_key desc
|
|
|
|
|
limit #{rowCnt} offset #{firstIndex}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectOperationPlanListCnt" resultType="Integer" parameterType="OperationPlan">
|
|
|
|
|
select count(*)
|
|
|
|
|
from operation_plan op
|
|
|
|
|
<include refid="selectOperationPlanListWhere"></include>
|
|
|
|
|
</select>
|
2023-01-17 09:04:23 +00:00
|
|
|
|
|
|
|
|
<select id="selectAffairCnt" resultType="IntelligenceAnalyze" parameterType="IntelligenceAnalyze">
|
|
|
|
|
select sum("AAR001"+"AAR003"+"AAR004"+"AAR006"+"AAR008") as total_cnt,
|
|
|
|
|
sum("AAR001") as special_cnt,
|
|
|
|
|
sum("AAR003") as middle_cnt,
|
|
|
|
|
sum("AAR004") as tong_cnt,
|
|
|
|
|
sum("AAR006") as jo_cnt,
|
|
|
|
|
sum("AAR008") as mu_cnt
|
|
|
|
|
from(
|
|
|
|
|
select ab.affair_key,
|
|
|
|
|
case
|
|
|
|
|
when ar.affair_rate = 'AAR001' then 1
|
|
|
|
|
else 0
|
|
|
|
|
end as "AAR001",
|
|
|
|
|
case
|
|
|
|
|
when ar.affair_rate = 'AAR003' then 1
|
|
|
|
|
else 0
|
|
|
|
|
end as "AAR003",
|
|
|
|
|
case
|
|
|
|
|
when ar.affair_rate = 'AAR004' then 1
|
|
|
|
|
else 0
|
|
|
|
|
end as "AAR004",
|
|
|
|
|
case
|
|
|
|
|
when ar.affair_rate = 'AAR006' then 1
|
|
|
|
|
else 0
|
|
|
|
|
end as "AAR006",
|
|
|
|
|
case
|
|
|
|
|
when ar.affair_rate = 'AAR008' then 1
|
|
|
|
|
else 0
|
|
|
|
|
end as "AAR008"
|
|
|
|
|
from affair_board ab,
|
|
|
|
|
affair_rating ar
|
|
|
|
|
where ab.affair_key = ar.affair_key
|
|
|
|
|
and ab.affair_category = 'CAT216'
|
|
|
|
|
and ab.affair_key in
|
|
|
|
|
<foreach collection="affairList" item="affairKey" separator="," open="(" close=")">
|
|
|
|
|
#{affairKey}
|
|
|
|
|
</foreach>
|
|
|
|
|
and (ar.organ_up != 'T' or ar.organ_up is null)
|
|
|
|
|
) a
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
2023-01-13 08:52:43 +00:00
|
|
|
</mapper>
|