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

48 lines
1.4 KiB
XML
Raw Normal View History

<?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.menuMgt.mapper.MenuMgtMapper">
<select id="selectMenuMgtList" resultType="MenuMgt" parameterType="MenuMgt">
select cat1_cd as cat1Cd,
cat2_cd as cat2Cd,
cat3_cd as cat3Cd,
menu_url as menuUrl
from menu_mgt
<where>
<if test='cat1Cd != null and cat1Cd != ""'>
and cat1_cd = #{cat1Cd}
</if>
<if test='cat2Cd != null and cat2Cd != ""'>
and cat2_cd = #{cat2Cd}
</if>
<if test='cat3Cd != null and cat3Cd != ""'>
and cat3_cd = #{cat3Cd}
</if>
<if test='menuUrl != null and menuUrl != ""'>
and menu_url = #{menuUrl}
</if>
</where>
order by cat1_cd, cat2_cd, cat3_cd
limit #{rowCnt} offset #{firstIndex}
</select>
<select id="selectMenuMgtListCnt" resultType="int" parameterType="MenuMgt">
select count(*)
from menu_mgt
<where>
<if test='cat1Cd != null and cat1Cd != ""'>
and cat1_cd = #{cat1Cd}
</if>
<if test='cat2Cd != null and cat2Cd != ""'>
and cat2_cd = #{cat2Cd}
</if>
<if test='cat3Cd != null and cat3Cd != ""'>
and cat3_cd = #{cat3Cd}
</if>
<if test='menuUrl != null and menuUrl != ""'>
and menu_url = #{menuUrl}
</if>
</where>
</select>
</mapper>