<?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.usky.system.mapper.SysMobileRoleMenuMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.usky.system.domain.SysMobileRoleMenu">
        <id column="role_id" property="roleId" />
        <result column="menu_id" property="menuId" />
    </resultMap>

    <insert id="batchMobileRoleMenu">
        insert into sys_mobile_role_menu(role_id, menu_id) values
        <foreach item="item" index="index" collection="list" separator=",">
            (#{item.roleId},#{item.menuId})
        </foreach>
    </insert>

    <delete id="deleteMobileRoleMenuByRoleId" parameterType="Long">
		delete from sys_mobile_role_menu where role_id=#{roleId}
	</delete>

    <delete id="deleteMobileRoleMenu">
        delete from sys_mobile_role_menu where role_id in
        <foreach collection="roleId" item="roleId" open="(" separator="," close=")">
            #{roleId}
        </foreach>
    </delete>
</mapper>
