<?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.tuoheng.miniprogram.dao.RoleMapper">

    <!-- 获取用户角色 -->
    <select id="getRolesByUserId" resultType="com.tuoheng.miniprogram.entity.Role">
        SELECT r.* FROM op_roles AS r
        INNER JOIN sys_user_role AS ur ON r.id=ur.role_id
        WHERE ur.user_id=#{userId} AND r.mark=1;
    </select>

</mapper>