| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.SysRoleMapper"> |
| | | <mapper namespace="org.dromara.system.mapper.SysRoleMapper"> |
| | | |
| | | <resultMap type="com.ruoyi.system.domain.vo.SysRoleVo" id="SysRoleResult"> |
| | | <resultMap type="org.dromara.system.domain.vo.SysRoleVo" id="SysRoleResult"> |
| | | </resultMap> |
| | | |
| | | <sql id="selectRoleVo"> |
| | |
| | | WHERE r.del_flag = '0' and sur.user_id = #{userId} |
| | | </select> |
| | | |
| | | <select id="selectRoleListByUserId" parameterType="Long" resultType="Long"> |
| | | select r.role_id |
| | | <select id="selectRolesByUserId" parameterType="Long" resultMap="SysRoleResult"> |
| | | select r.role_id, |
| | | r.role_name, |
| | | r.role_key, |
| | | r.role_sort, |
| | | r.data_scope, |
| | | r.status |
| | | from sys_role r |
| | | left join sys_user_role sur on sur.role_id = r.role_id |
| | | left join sys_user u on u.user_id = sur.user_id |
| | | where u.user_id = #{userId} |
| | | WHERE r.del_flag = '0' and sur.user_id = #{userId} |
| | | </select> |
| | | |
| | | <select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult"> |
| | | <select id="selectRoleById" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | WHERE r.del_flag = '0' and u.user_name = #{userName} |
| | | WHERE r.del_flag = '0' and r.role_id = #{roleId} |
| | | </select> |
| | | |
| | | </mapper> |