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

83 lines
2.7 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.menuMgt.mapper.MenuMgtMapper">
<sql id="selectMenuMgtListWhere">
<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 like '%'||#{menuUrl}||'%'
</if>
</sql>
<select id="selectMenuMgtList" resultType="MenuMgt" parameterType="MenuMgt">
select menu_key as menuKey,
cat1_cd as cat1Cd,
cat2_cd as cat2Cd,
cat3_cd as cat3Cd,
menu_url as menuUrl,
approval_chk as approvalChk,
deadline_chk as deadlineChk,
use_chk as useChk
from menu_mgt
<where>
<include refid="selectMenuMgtListWhere"></include>
</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>
<include refid="selectMenuMgtListWhere"></include>
</where>
</select>
<select id="selectAccessMenuListWhereUserSeq" resultType="MenuMgt" parameterType="int">
select ab.cat1_cd,
ab.cat2_cd,
ab.cat3_cd,
ab.menu_url
from access_config aa
inner join menu_mgt ab on aa.menu_key = ab.menu_key
where aa.user_seq = #{userSeq}
and aa.access_auth is not null
and aa.access_auth &lt;> ''
order by cat1_cd, cat2_cd, cat3_cd
</select>
<select id="selectMenuMgtListToAccessAuth" resultType="MenuMgt" parameterType="MenuMgt">
select ab.menu_key,
ab.cat1_cd,
ab.cat2_cd,
ab.cat3_cd,
ab.menu_url
from access_config aa
inner join menu_mgt ab on aa.menu_key = ab.menu_key
where aa.user_seq = #{userSeq}
and aa.access_auth is not null
and aa.access_auth &lt;> ''
<include refid="selectMenuMgtListWhere"></include>
order by cat1_cd, cat2_cd, cat3_cd
limit #{rowCnt} offset #{firstIndex}
</select>
<select id="selectMenuMgtListToAccessAuthCnt" resultType="int" parameterType="MenuMgt">
select count(*)
from access_config aa
inner join menu_mgt ab on aa.menu_key = ab.menu_key
where aa.user_seq = #{userSeq}
and aa.access_auth is not null
and aa.access_auth &lt;> ''
<include refid="selectMenuMgtListWhere"></include>
</select>
</mapper>