<?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.heketai.website.mapper.SysRoleMenuMapper">

    <resultMap id="BaseResultMap" type="com.heketai.website.entity.SysRoleMenu">
        <id column="id" property="id"/>
        <result column="role_id" property="roleId"/>
        <result column="menu_id" property="menuId"/>
        <result column="create_time" property="createTime"/>
        <result column="modify_time" property="modifyTime"/>
    </resultMap>

    <sql id="BaseColumnList">
        id,
        role_id,
        menu_id,
        create_time,
        modify_time
    </sql>

    <select id="findByRoleIds" resultMap="BaseResultMap">
        SELECT
        <include refid="BaseColumnList"/>
        FROM sys_role_menu
        WHERE role_id IN
        <foreach collection="ids" item="id" index="index" open="("
                 close=")" separator=",">
            #{id}
        </foreach>
    </select>
</mapper>
