-
admin
2024-05-17 1ccd6932893e47722574e6d1147e63b2ec4972c1
提交 | 用户 | 时间
e57a89 1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper
3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 <mapper namespace="com.jcdm.system.mapper.SysRoleMenuMapper">
6
7     <resultMap type="SysRoleMenu" id="SysRoleMenuResult">
8         <result property="roleId"     column="role_id"      />
9         <result property="menuId"     column="menu_id"      />
10     </resultMap>
11     
12     <select id="checkMenuExistRole" resultType="Integer">
13         select count(1) from sys_role_menu where menu_id = #{menuId}
14     </select>
15
16     <delete id="deleteRoleMenuByRoleId" parameterType="Long">
17         delete from sys_role_menu where role_id=#{roleId}
18     </delete>
19     
20     <delete id="deleteRoleMenu" parameterType="Long">
21          delete from sys_role_menu where role_id in
22          <foreach collection="array" item="roleId" open="(" separator="," close=")">
23              #{roleId}
24         </foreach> 
25      </delete>
26     
27     <insert id="batchRoleMenu">
28         insert into sys_role_menu(role_id, menu_id) values
29         <foreach item="item" index="index" collection="list" separator=",">
30             (#{item.roleId},#{item.menuId})
31         </foreach>
32     </insert>
33     
34 </mapper>