提交 | 用户 | 时间
|
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.SysRoleDeptMapper"> |
|
6 |
|
|
7 |
<resultMap type="SysRoleDept" id="SysRoleDeptResult"> |
|
8 |
<result property="roleId" column="role_id" /> |
|
9 |
<result property="deptId" column="dept_id" /> |
|
10 |
</resultMap> |
|
11 |
|
|
12 |
<delete id="deleteRoleDeptByRoleId" parameterType="Long"> |
|
13 |
delete from sys_role_dept where role_id=#{roleId} |
|
14 |
</delete> |
|
15 |
|
|
16 |
<select id="selectCountRoleDeptByDeptId" resultType="Integer"> |
|
17 |
select count(1) from sys_role_dept where dept_id=#{deptId} |
|
18 |
</select> |
|
19 |
|
|
20 |
<delete id="deleteRoleDept" parameterType="Long"> |
|
21 |
delete from sys_role_dept where role_id in |
|
22 |
<foreach collection="array" item="roleId" open="(" separator="," close=")"> |
|
23 |
#{roleId} |
|
24 |
</foreach> |
|
25 |
</delete> |
|
26 |
|
|
27 |
<insert id="batchRoleDept"> |
|
28 |
insert into sys_role_dept(role_id, dept_id) values |
|
29 |
<foreach item="item" index="index" collection="list" separator=","> |
|
30 |
(#{item.roleId},#{item.deptId}) |
|
31 |
</foreach> |
|
32 |
</insert> |
|
33 |
|
|
34 |
</mapper> |