<?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.kcim.dao.mapper.RoleMenuMapper">

    <!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.kcim.dao.model.RoleMenu" id="roleMenuMap">
        <result property="id" column="id"/>
        <result property="roleId" column="role_id"/>
        <result property="menuId" column="menu_id"/>
        <result property="hospId" column="hosp_id"/>
    </resultMap>
    <select id="getMenuByRoleId" resultType="com.kcim.vo.CommonVO">
        select sm.menu_id as id, sm.name as name
        from sys_role_menu srm left join sys_menu sm
        on sm.menu_id = srm.menu_id
        where srm.role_id = #{roleId}
          and srm.hosp_id = #{hospId}
          and sm.hosp_id = #{hospId}
    </select>


</mapper>