reset
parent
2401c5552e
commit
f6f8c0b03a
@ -1,32 +0,0 @@
|
|||||||
package com.ruoyi.project.system.role.domain;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色和部门关联 sys_role_dept
|
|
||||||
*/
|
|
||||||
public class RoleDept {
|
|
||||||
/** 角色ID */
|
|
||||||
private Long roleId;
|
|
||||||
/** 部门ID */
|
|
||||||
private Long deptId;
|
|
||||||
|
|
||||||
public Long getRoleId() {
|
|
||||||
return roleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoleId(Long roleId) {
|
|
||||||
this.roleId = roleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getDeptId() {
|
|
||||||
return deptId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeptId(Long deptId) {
|
|
||||||
this.deptId = deptId;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return "RoleDept [roleId=" + roleId + ", deptId=" + deptId + "]";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
<?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.project.system.role.mapper.RoleDeptMapper">
|
|
||||||
|
|
||||||
<resultMap type="RoleDept" id="RoleDeptResult">
|
|
||||||
<result property="roleId" column="role_id" />
|
|
||||||
<result property="deptId" column="dept_id" />
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<delete id="deleteRoleDeptByRoleId" parameterType="Long">
|
|
||||||
delete from sys_role_dept where role_id=#{roleId}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<select id="selectCountRoleDeptByDetpId" resultType="Integer">
|
|
||||||
select count(*) from sys_role_dept where dept_id=#{detpId}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<delete id="deleteRoleDept" parameterType="Long">
|
|
||||||
delete from sys_role_dept where role_id in
|
|
||||||
<foreach collection="array" item="roleId" open="(" separator="," close=")">
|
|
||||||
#{roleId}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<insert id="batchRoleDept">
|
|
||||||
insert into sys_role_dept(role_id, dept_id) values
|
|
||||||
<foreach item="item" index="index" collection="list" separator=",">
|
|
||||||
(#{item.roleId},#{item.deptId})
|
|
||||||
</foreach>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
</mapper>
|
|
Loading…
Reference in New Issue