FAISP/src/main/resources/mybatisMapper/FipTarget.xml

82 lines
2.5 KiB
XML
Raw Normal View History

2022-09-28 07:56:31 +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.fipTarget.mapper.FipTargetMapper">
<select id="selectPartInfoManagerList" resultType="com.dbnt.faisp.util.ParamMap" parameterType="com.dbnt.faisp.util.ParamMap">
select user_seq,
user_id
user_name
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>
<select id="selectPartInfoList" resultType="PartInfo" parameterType="PartInfo">
select pi.pi_seq,
version_no,
(select item_value from code_mgt where item_cd = mgt_organ) as mgt_organ,
land_police,
(select item_value from code_mgt where item_cd = mp_work_type) as mp_work_type,
mp_people_cnt,
mp_description,
(select item_value from code_mgt where item_cd = pl_work_type) as pl_work_type,
pl_people_cnt,
pl_description,
(select user_nm from user_info where user_seq = pi_user_seq ) as pi_manager_name,
rent_type,
rent_price,
utility_type,
utility_price,
wrt_dt
from part_info pi,
(select pi_seq,max(version_no) as lastVer
from part_info group by pi_seq) b
where pi.pi_seq = b.pi_seq
and pi.version_no = b.lastVer
and wrt_organ in
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
order by wrt_dt desc
limit #{rowCnt} offset #{firstIndex}
</select>
<select id="selectPartInfoListCnt" resultType="int" parameterType="PartInfo">
select count(*)
from(
select pi.pi_seq,
version_no,
mgt_organ,
land_police,
mp_work_type,
mp_people_cnt,
mp_description,
pl_work_type,
pl_people_cnt,
pl_description,
(select user_nm from user_info where user_seq = pi_user_seq ) as pi_manager_name,
rent_type,
rent_price,
utility_type,
utility_price,
wrt_dt
from part_info pi,
(select pi_seq,max(version_no) as lastVer
from part_info group by pi_seq) b
where pi.pi_seq = b.pi_seq
and pi.version_no = b.lastVer
and wrt_organ in
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
order by wrt_dt desc
) a
</select>
</mapper>