From 32199c42f24a31126e63e198cb3b6f249cb58c5e Mon Sep 17 00:00:00 2001 From: likun5 Date: Mon, 2 May 2022 12:02:07 +0800 Subject: [PATCH] =?UTF-8?q?dept/role/user=E7=9A=84where=E4=B8=AD=E8=A1=A5?= =?UTF-8?q?=E5=85=85del=5Fflag=3D'0'=E6=9D=A1=E4=BB=B6=EF=BC=8C=E9=98=B2?= =?UTF-8?q?=E6=AD=A2=E6=9F=A5=E8=AF=A2=E6=88=96=E6=9B=B4=E6=96=B0=E6=97=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/system/SysDeptMapper.xml | 15 +++++++++------ .../resources/mapper/system/SysRoleMapper.xml | 15 ++++++++------- .../resources/mapper/system/SysUserMapper.xml | 16 +++++++++------- 3 files changed, 26 insertions(+), 20 deletions(-) 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