<?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.sims.authMgt.mapper.AuthMgtMapper">
  <select id="selectAccessConfigList" resultType="AccessConfig" parameterType="hashMap">
    select a.menu_key,
           a.cat1_cd as cat1Cd,
           a.cat2_cd as cat2Cd,
           a.cat3_cd as cat3Cd,
           b.access_auth
    from menu_mgt a
           left outer join access_config b
                           on a.menu_key = b.menu_key and b.user_seq = #{userSeq}
    where a.use_chk = 'T'
      <if test='menuUrl != null and menuUrl != ""'>
        and a.menu_url = #{menuUrl}
      </if>
    order by cat1_cd, cat2_cd, cat3_cd
  </select>

  <select id="selectApprovalConfigList" resultType="ApprovalConfig" parameterType="hashMap">
    select a.menu_key,
           a.cat1_cd as cat1Cd,
           a.cat2_cd as cat2Cd,
           a.cat3_cd as cat3Cd,
           b.approval_auth
    from menu_mgt a
           left outer join approval_config b
                           on a.menu_key = b.menu_key and b.user_seq = #{userSeq}
    where a.approval_chk = 'T'
      and a.use_chk = 'T'
    <if test='menuUrl != null and menuUrl != ""'>
      and a.menu_url = #{menuUrl}
    </if>
    order by cat1_cd, cat2_cd, cat3_cd
  </select>
</mapper>