<?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="kr.co.jinwoosi.clfd.framework.menu.mapper.MenuRoleMapper">

	<select id="selectList" parameterType="menuRoleSearch" resultType="menuRole">
		SELECT ROLE_AUTH, MENU_ID
		FROM JCMS_MNGR_MENU_ROLE
		WHERE 1 = 1
			<if test="!empty(roleAuth)" > AND ROLE_AUTH = #{roleAuth} </if>
		<if test="!empty(sort) and !empty(sortOrd)" >
		ORDER BY ${sort} ${sortOrd}
		</if>
		<if test="pagingYn == true" >
		LIMIT #{start}, #{length}
		</if>
	</select>
	
	<insert id="insert" parameterType="menuRole">
		insert into JCMS_MNGR_MENU_ROLE (
			ROLE_AUTH
			,MENU_ID
		) values (
			#{roleAuth}
			, #{menuId}
		)
	</insert>

	<delete id="delete" parameterType="menuRole">
		delete from JCMS_MNGR_MENU_ROLE 
		where 
			ROLE_AUTH = #{roleAuth}
	</delete>
</mapper>
