<?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.UserRoleMapper">

    <!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.kcim.dao.model.UserRole" id="userRoleMap">
        <result property="id" column="id"/>
        <result property="userId" column="user_id"/>
        <result property="roleId" column="role_id"/>
        <result property="hospId" column="hosp_id"/>
    </resultMap>
    <select id="getUsersByRoleId" resultType="com.kcim.vo.CommonVO">
        select su.id as id, su.name as name
        from sys_user_role sur left join sys_user su
        on su.id = sur.user_id
        where su.delete_time = 0
          and sur.role_id = #{roleId}
          and sur.hosp_id = #{hospId}
          and su.hosp_id = #{hospId}
    </select>


</mapper>