| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.smartor.mapper.SysUserRole2Mapper"> |
| | | |
| | | <resultMap type="SysUserRole" id="SysUserRoleResult"> |
| | | <resultMap type="com.ruoyi.common.core.domain.entity.SysUserRole" id="SysUserRoleResult"> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="roleId" column="role_id"/> |
| | | <result property="guid" column="guid"/> |
| | |
| | | where role_id = #{roleId} |
| | | </select> |
| | | |
| | | <select id="selectUserRoleByRoleIdAndUserId" resultMap="SysUserRoleResult"> |
| | | select user_id,role_id,guid,orgid |
| | | from sys_user_role |
| | | <where> |
| | | <if test="roleId != null ">and role_id = #{roleId}</if> |
| | | <if test="userId != null ">and user_id = #{userId}</if> |
| | | |
| | | </where> |
| | | </select> |
| | | |
| | | <delete id="deleteUserRole" parameterType="Long"> |
| | | delete from sys_user_role where user_id in |
| | | <foreach collection="array" item="userId" open="(" separator="," close=")"> |