<?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.zyd.blog.persistence.mapper.SysUserRoleMapper">
    <resultMap id="rm" type="com.zyd.blog.persistence.beans.SysUserRole">
        <result property="id" jdbcType="BIGINT" column="id"/>
        <result property="userId" jdbcType="BIGINT" column="user_id"/>
        <result property="roleId" jdbcType="BIGINT" column="role_id"/>
        <result property="createTime" jdbcType="TIMESTAMP" column="create_time"/>
        <result property="updateTime" jdbcType="TIMESTAMP" column="update_time"/>
    </resultMap>

    <select id="findUserIdByRoleId" parameterType="Integer" resultType="Integer">
        SELECT
            user_id
        FROM
            sys_user_role
        WHERE
            role_id = #{roleId}
    </select>
</mapper>