Ver código fonte

部门增加删除条件

gao.qiang 5 meses atrás
pai
commit
82ed46618d

+ 3 - 3
base-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -67,7 +67,7 @@
         from sys_dept d
         left join sys_role_dept rd on d.dept_id = rd.dept_id
         where rd.role_id = #{roleId}
-        and del_flag = 1
+        and d.del_flag = 1
         <if test="deptCheckStrictly">
             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})
@@ -80,11 +80,11 @@
 			(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
 		from sys_dept d
 		where d.dept_id = #{deptId}
-          and del_flag = 1
+          and d.del_flag = 1
 	</select>
 
     <select id="selectDeptByDeptName" parameterType="string" resultMap="SysDeptResult">
-		select * from sys_dept where dept_name = #{deptName}
+		select * from sys_dept where dept_name = #{deptName} and del_flag = 1
 	</select>
 
     <select id="checkDeptExistUser" parameterType="Long" resultType="int">

+ 4 - 4
base-system/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -71,12 +71,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.id = ur.user_id
-	    where u.id = #{userId}
+	    where u.id = #{userId} and r.del_flag = '1'
 	</select>
 
 	<select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
-		where r.role_id = #{roleId}
+		where r.role_id = #{roleId}  and r.del_flag = '1'
 	</select>
 
 	<select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
@@ -94,7 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		 where r.role_key=#{roleKey} and r.del_flag = '1' limit 1
 	</select>
 	<select id="getRoleId" resultType="java.lang.Long">
-		select role_id from sys_role where role_name = #{roleName}
+		select role_id from sys_role where role_name = #{roleName}  and del_flag = '1'
 	</select>
 	<select id="selectSysRoleList" resultMap="SysRoleResult" parameterType="com.ozs.common.core.domain.vo.SysRoleRequestVo">
 		select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
@@ -134,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		     order by r.role_sort
 	</select>
 	<select id="getRoleKey" resultType="java.lang.String">
-		select role_key from sys_role where role_id = #{roleId}
+		select role_key from sys_role where role_id = #{roleId}  and del_flag = '1'
 	</select>
 	<select id="roleList" resultMap="SysRoleResult" parameterType="com.ozs.common.core.domain.vo.SysRoleRequestVo">
 		select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,

+ 1 - 1
base-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -130,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 	<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
 		<include refid="selectUserVo"/>
-		where u.id = #{id}
+		where u.id = #{id} and u.del_flag = '1'
 	</select>
 
 	<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">