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

41 lines
1.2 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.fpiMgt.monthPlan.mapper.MonthPlanMapper">
<select id="selectBoardPlanList" resultType="BoardPlan" parameterType="BoardPlan">
select a.plan_key,
a.content_title,
a.plan_state,
a.plan_dt,
a.section_apprv,
a.head_apprv,
a.wrt_organ,
a.wrt_nm,
a.wrt_dt,
b.file_seq
from board_plan a
left outer join (select plan_key,
max(file_seq) as file_seq
from plan_file
group by plan_key) b
on a.plan_key = b.plan_key
<where>
<if test='wrtNm != null and wrtNm != ""'>
and a.wrt_nm = #{wrtNm}
</if>
</where>
order by plan_key desc
limit #{rowCnt} offset #{firstIndex}
</select>
<select id="selectBoardPlanListCnt" resultType="int" parameterType="BoardPlan">
select count(*)
from board_plan a
<where>
<if test='wrtNm != null and wrtNm != ""'>
and a.wrt_nm = #{wrtNm}
</if>
</where>
</select>
</mapper>