2022-08-18 06:21:44 +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">
|
|
|
|
|
|
2022-10-27 00:02:05 +00:00
|
|
|
<mapper namespace="com.dbnt.faisp.main.userInfo.mapper.UserInfoMapper">
|
2022-10-19 06:23:11 +00:00
|
|
|
<sql id="selectUserInfoWhere">
|
|
|
|
|
<where>
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="userStatus != null and userStatus != ''">
|
|
|
|
|
user_status = #{userStatus}
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
user_status != 'D'
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
<if test="userId != null and userId != ''">
|
|
|
|
|
and user_id like '%'||#{userId}||'%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="userNm != null and userNm != ''">
|
|
|
|
|
and user_nm like '%'||#{userNm}||'%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ogCd != null and ogCd != ''">
|
|
|
|
|
and og_cd = #{ogCd}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ofcCd != null and ofcCd != ''">
|
|
|
|
|
and ofc_cd = #{ofcCd}
|
|
|
|
|
</if>
|
2022-10-28 09:00:38 +00:00
|
|
|
<if test="titleCd != null and titleCd != ''">
|
|
|
|
|
and title_cd = #{titleCd}
|
|
|
|
|
</if>
|
2022-10-19 06:23:11 +00:00
|
|
|
</where>
|
|
|
|
|
</sql>
|
2022-08-18 06:21:44 +00:00
|
|
|
<select id="selectUserInfoList" resultType="UserInfo" parameterType="UserInfo">
|
2022-08-25 09:39:21 +00:00
|
|
|
select user_seq,
|
2022-10-31 02:35:08 +00:00
|
|
|
dic_code,
|
2022-08-25 09:39:21 +00:00
|
|
|
user_id,
|
|
|
|
|
user_nm,
|
2022-08-31 00:57:37 +00:00
|
|
|
user_role,
|
2022-08-25 09:39:21 +00:00
|
|
|
email,
|
|
|
|
|
og_cd,
|
|
|
|
|
ofc_cd,
|
2022-10-27 06:38:53 +00:00
|
|
|
title_cd,
|
2022-08-25 09:39:21 +00:00
|
|
|
wrt_dt
|
|
|
|
|
from user_info
|
2022-10-19 06:23:11 +00:00
|
|
|
<include refid="selectUserInfoWhere"></include>
|
2022-10-27 06:38:53 +00:00
|
|
|
order by og_cd, ofc_cd, title_cd desc
|
2022-08-25 09:39:21 +00:00
|
|
|
limit #{rowCnt} offset #{firstIndex}
|
2022-08-18 06:21:44 +00:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectUserInfoListCnt" resultType="int" parameterType="UserInfo">
|
2022-08-25 09:39:21 +00:00
|
|
|
select count(*)
|
|
|
|
|
from user_info
|
2022-10-19 06:23:11 +00:00
|
|
|
<include refid="selectUserInfoWhere"></include>
|
2022-08-18 06:21:44 +00:00
|
|
|
</select>
|
2022-10-12 02:42:00 +00:00
|
|
|
|
|
|
|
|
<select id="selectManagerList" resultType="com.dbnt.faisp.util.ParamMap" parameterType="com.dbnt.faisp.util.ParamMap">
|
|
|
|
|
select user_seq,
|
2022-11-01 04:27:40 +00:00
|
|
|
user_id,
|
|
|
|
|
(select item_value from code_mgt where item_cd = title_cd) as title_cd,
|
|
|
|
|
user_nm
|
2022-10-12 02:42:00 +00:00
|
|
|
from user_info
|
|
|
|
|
where og_cd in
|
|
|
|
|
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
order by user_nm asc
|
|
|
|
|
</select>
|
2022-10-13 09:34:32 +00:00
|
|
|
|
|
|
|
|
<select id="selectDashboardConfigList" resultType="DashboardConfig" parameterType="int">
|
|
|
|
|
select a.menu_key ,
|
|
|
|
|
a.cat1_cd ,
|
|
|
|
|
a.cat2_cd ,
|
|
|
|
|
a.cat3_cd ,
|
|
|
|
|
a.menu_url ,
|
|
|
|
|
b.order_num
|
|
|
|
|
from menu_mgt a
|
|
|
|
|
inner join dashboard_config b
|
|
|
|
|
on a.menu_key = b.menu_key
|
|
|
|
|
where b.user_seq = #{userSeq}
|
|
|
|
|
order by b.order_num
|
|
|
|
|
</select>
|
2022-11-07 04:23:10 +00:00
|
|
|
|
|
|
|
|
<sql id="selectPoliceListWhere">
|
|
|
|
|
<where>
|
|
|
|
|
user_status = #{userStatus}
|
|
|
|
|
and og_cd in
|
|
|
|
|
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
2022-11-08 08:42:36 +00:00
|
|
|
<if test="ogCd != null and ogCd != ''">
|
|
|
|
|
and og_cd = #{ogCd}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="sex != null and sex != ''">
|
|
|
|
|
and sex = #{sex}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="userNm != null and userNm != ''">
|
|
|
|
|
and user_nm like '%'||#{userNm}||'%'
|
|
|
|
|
</if>
|
2022-11-07 04:23:10 +00:00
|
|
|
</where>
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectPoliceList" resultType="UserInfo" parameterType="UserInfo">
|
2022-11-08 08:42:36 +00:00
|
|
|
select (ROW_NUMBER() OVER(order by user_nm desc)) AS rownum,
|
|
|
|
|
user_seq,
|
2022-11-07 04:23:10 +00:00
|
|
|
(select item_value from code_mgt where item_cd = title_cd) as title_cd,
|
|
|
|
|
user_nm,
|
|
|
|
|
og_cd,
|
|
|
|
|
(select item_value from code_mgt where item_cd = og_cd) as organ_nm,
|
|
|
|
|
(select item_value from code_mgt where item_cd = ofc_cd) as ofc_cd,
|
|
|
|
|
birth_date,
|
|
|
|
|
(select item_value from code_mgt where item_cd = sex) as sex,
|
|
|
|
|
police_in_date,
|
|
|
|
|
title_in_date,
|
|
|
|
|
ofc_in_date,
|
|
|
|
|
(select item_value from code_mgt where item_cd = outturn_cd) as outturn_cd,
|
|
|
|
|
(select item_value from code_mgt where item_cd = job_in_cd) as job_in_cd,
|
|
|
|
|
wrt_dt
|
|
|
|
|
from user_info
|
|
|
|
|
<include refid="selectPoliceListWhere"></include>
|
2022-11-08 08:42:36 +00:00
|
|
|
order by rownum desc
|
|
|
|
|
<if test='excel != "Y"'>
|
2022-11-07 04:23:10 +00:00
|
|
|
limit #{rowCnt} offset #{firstIndex}
|
2022-11-08 08:42:36 +00:00
|
|
|
</if>
|
2022-11-07 04:23:10 +00:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectPoliceListCnt" resultType="Integer" parameterType="UserInfo">
|
|
|
|
|
select count(*)
|
|
|
|
|
from(
|
|
|
|
|
select user_seq,
|
|
|
|
|
(select item_value from code_mgt where item_cd = title_cd) as title_cd,
|
|
|
|
|
user_nm,
|
|
|
|
|
og_cd,
|
|
|
|
|
(select item_value from code_mgt where item_cd = og_cd) as organ_nm,
|
|
|
|
|
(select item_value from code_mgt where item_cd = ofc_cd) as ofc_cd,
|
|
|
|
|
birth_date,
|
|
|
|
|
(select item_value from code_mgt where item_cd = sex) as sex,
|
|
|
|
|
police_in_date,
|
|
|
|
|
title_in_date,
|
|
|
|
|
ofc_in_date,
|
|
|
|
|
(select item_value from code_mgt where item_cd = outturn_cd) as outturn_cd,
|
|
|
|
|
(select item_value from code_mgt where item_cd = job_in_cd) as job_in_cd,
|
|
|
|
|
wrt_dt
|
|
|
|
|
from user_info
|
|
|
|
|
<include refid="selectPoliceListWhere"></include>
|
|
|
|
|
order by user_seq desc
|
|
|
|
|
) a
|
|
|
|
|
</select>
|
2022-11-08 08:42:36 +00:00
|
|
|
|
|
|
|
|
<select id="selectPoliceHisList" resultType="UserInfoHistory" parameterType="UserInfoHistory">
|
|
|
|
|
select user_seq,
|
|
|
|
|
version_no,
|
|
|
|
|
(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_title) as wrt_title,
|
|
|
|
|
wrt_nm,
|
|
|
|
|
wrt_dt
|
|
|
|
|
from user_info_history
|
|
|
|
|
where user_seq = #{userSeq}
|
|
|
|
|
order by version_no desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectpoliceHistoryView" resultType="UserInfoHistory" parameterType="UserInfoHistory">
|
|
|
|
|
select user_seq,
|
|
|
|
|
version_no,
|
|
|
|
|
dic_code,
|
|
|
|
|
user_id,
|
|
|
|
|
user_nm,
|
|
|
|
|
phone_no,
|
|
|
|
|
email,
|
|
|
|
|
(select item_value from code_mgt where item_cd = sex) as sex,
|
|
|
|
|
birth_date,
|
|
|
|
|
police_in_date,
|
|
|
|
|
(select item_value from code_mgt where item_cd = og_cd) as og_cd,
|
|
|
|
|
organ_in_date,
|
|
|
|
|
ofc_cd,
|
|
|
|
|
ofc_in_date,
|
|
|
|
|
(select item_value from code_mgt where item_cd = title_cd) as title_cd,
|
|
|
|
|
title_in_date,
|
|
|
|
|
(select item_value from code_mgt where item_cd = outturn_cd) as outturn_cd,
|
|
|
|
|
(select item_value from code_mgt where item_cd = series_cd) as series_cd,
|
|
|
|
|
(select item_value from code_mgt where item_cd = language_cd) as language_cd
|
|
|
|
|
from user_info_history
|
|
|
|
|
where user_seq = #{userSeq}
|
|
|
|
|
and version_no = #{versionNo}
|
|
|
|
|
</select>
|
2022-11-15 09:51:45 +00:00
|
|
|
<select id="selectPersonnelStatusList" parameterType="PersonnelStatus" resultType="PersonnelStatus">
|
|
|
|
|
select
|
|
|
|
|
case
|
|
|
|
|
when a.year is null then #{year}
|
|
|
|
|
else a.year
|
|
|
|
|
end as year,
|
|
|
|
|
case
|
|
|
|
|
when a.og_cd is null then c.organ_cd
|
|
|
|
|
else a.og_cd
|
|
|
|
|
end as og_cd,
|
|
|
|
|
a.version_no,
|
|
|
|
|
jt007_max,
|
|
|
|
|
jt007_now,
|
|
|
|
|
jt006_max,
|
|
|
|
|
jt006_now,
|
|
|
|
|
jt005_max,
|
|
|
|
|
jt005_now,
|
|
|
|
|
jt004_max,
|
|
|
|
|
jt004_now,
|
|
|
|
|
jt003_max,
|
|
|
|
|
jt003_now,
|
|
|
|
|
jt002_max,
|
|
|
|
|
jt002_now,
|
|
|
|
|
jt001_max,
|
|
|
|
|
jt001_now,
|
|
|
|
|
a.organ_cd,
|
|
|
|
|
part_cd,
|
|
|
|
|
wrt_user_seq,
|
|
|
|
|
wrt_user_grd,
|
|
|
|
|
wrt_user_nm,
|
|
|
|
|
wrt_dt
|
|
|
|
|
from personnel_status a
|
|
|
|
|
inner join (select year, og_cd, max(version_no) as version_no
|
|
|
|
|
from personnel_status
|
|
|
|
|
group by year, og_cd) b
|
|
|
|
|
on a.year = b.year and a.og_cd = b.og_cd and a.version_no = b.version_no
|
|
|
|
|
right outer join organ_config c
|
|
|
|
|
on a.og_cd = c.organ_cd and a.year = #{year}
|
|
|
|
|
where c.organ_cd in
|
|
|
|
|
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
order by c.organ_type, c.parent_organ, c.organ_cd
|
|
|
|
|
</select>
|
2022-08-18 06:21:44 +00:00
|
|
|
</mapper>
|