Files
Mediation-Backend/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml
T

48 lines
1.6 KiB
XML
Raw Normal View History

2024-01-04 16:58:19 +08:00
<?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.ruoyi.system.mapper.SysUserRoleMapper">
2024-01-08 15:05:57 +08:00
<resultMap type="com.ruoyi.system.domain.SysUserRole" id="SysUserRoleResult">
2024-01-04 16:58:19 +08:00
<result property="userId" column="user_id" />
<result property="roleId" column="role_id" />
</resultMap>
<delete id="deleteUserRoleByUserId" parameterType="Long">
2024-01-05 11:54:46 +08:00
delete from ms_sys_user_role where user_id=#{userId}
2024-01-04 16:58:19 +08:00
</delete>
<select id="countUserRoleByRoleId" resultType="Integer">
2024-01-05 11:54:46 +08:00
select count(1) from ms_sys_user_role where role_id=#{roleId}
2024-01-04 16:58:19 +08:00
</select>
<delete id="deleteUserRole" parameterType="Long">
2024-01-05 11:54:46 +08:00
delete from ms_sys_user_role where user_id in
2024-01-04 16:58:19 +08:00
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<insert id="batchUserRole">
2024-01-05 11:54:46 +08:00
insert into ms_sys_user_role(user_id, role_id) values
2024-01-04 16:58:19 +08:00
<foreach item="item" index="index" collection="list" separator=",">
(#{item.userId},#{item.roleId})
</foreach>
</insert>
2024-01-08 15:05:57 +08:00
<delete id="deleteUserRoleInfo" parameterType="com.ruoyi.system.domain.SysUserRole">
2024-01-05 11:54:46 +08:00
delete from ms_sys_user_role where user_id=#{userId} and role_id=#{roleId}
2024-01-04 16:58:19 +08:00
</delete>
<delete id="deleteUserRoleInfos">
2024-01-05 11:54:46 +08:00
delete from ms_sys_user_role where role_id=#{roleId} and user_id in
2024-01-04 16:58:19 +08:00
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
2024-01-10 11:34:33 +08:00
<insert id="insertUserRole">
insert into ms_sys_user_role(user_id, role_id) values(#{userId}, #{roleId})
</insert>
2024-01-04 16:58:19 +08:00
</mapper>