diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 984f89ccc..42ff5bc14 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -52,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from sys_dept d left join sys_role_dept rd on d.dept_id = rd.dept_id where rd.role_id = #{roleId} + and d.del_flag = '0' and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId}) @@ -60,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - where dept_name=#{deptName} and parent_id = #{parentId} limit 1 + where d.dept_name=#{deptName} and d.parent_id = #{parentId} and d.del_flag = '0' limit 1 - + insert into sys_dept( dept_id, parent_id, @@ -127,7 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by = #{updateBy}, update_time = sysdate() - where dept_id = #{deptId} + where dept_id = #{deptId} and del_flag = '0' @@ -141,6 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" separator="," open="(" close=")"> #{item.deptId} + and del_flag = '0' @@ -148,10 +150,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{deptId} + and del_flag = '0' - update sys_dept set del_flag = '2' where dept_id = #{deptId} + update sys_dept set del_flag = '2' where dept_id = #{deptId} and del_flag = '0' \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml index a8d3ede58..ab704aaad 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml @@ -70,12 +70,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from sys_role r left join sys_user_role ur on ur.role_id = r.role_id left join sys_user u on u.user_id = ur.user_id - where u.user_id = #{userId} + where u.user_id = #{userId} and r.del_flag = '0' - where r.role_name=#{roleName} limit 1 + where r.role_name=#{roleName} and r.del_flag = '0' limit 1 @@ -135,18 +135,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by = #{updateBy}, update_time = sysdate() - where role_id = #{roleId} + where role_id = #{roleId} and del_flag = '0' - update sys_role set del_flag = '2' where role_id = #{roleId} + update sys_role set del_flag = '2' where role_id = #{roleId} and del_flag = '0' update sys_role set del_flag = '2' where role_id in #{roleId} - + + and del_flag = '0' \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 16a64c2a3..a4972e031 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -122,24 +122,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -193,6 +193,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time = sysdate() where user_id = #{userId} + and del_flag ='0' @@ -208,14 +209,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update sys_user set del_flag = '2' where user_id = #{userId} + update sys_user set del_flag = '2' where user_id = #{userId} and del_flag ='0' update sys_user set del_flag = '2' where user_id in #{userId} - + + and del_flag ='0' \ No newline at end of file