ソースを参照

数据逻辑删除不进行唯一验证

RuoYi 3 年 前
コミット
d6db5963d5

+ 1 - 1
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	
 	<select id="checkDeptNameUnique" resultMap="SysDeptResult">
 	    <include refid="selectDeptVo"/>
-		where dept_name=#{deptName} and parent_id = #{parentId} limit 1
+		where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
 	</select>
 
 	<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">

+ 2 - 2
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -73,12 +73,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	
 	<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
-		 where r.role_name=#{roleName} limit 1
+		 where r.role_name=#{roleName} and del_flag = '0' limit 1
 	</select>
 	
 	<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
-		 where r.role_key=#{roleKey} limit 1
+		 where r.role_key=#{roleKey} and del_flag = '0' limit 1
 	</select>
 	
 	<delete id="deleteRoleById" parameterType="Long">

+ 6 - 6
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -125,29 +125,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	
 	<select id="selectUserByLoginName" parameterType="String" resultMap="SysUserResult">
 	    <include refid="selectUserVo"/>
-		where u.login_name = #{userName}
+		where u.login_name = #{userName} and u.del_flag = '0'
 	</select>
 	
 	<select id="selectUserByPhoneNumber" parameterType="String" resultMap="SysUserResult">
 		<include refid="selectUserVo"/>
-		where u.phonenumber = #{phonenumber}
+		where u.phonenumber = #{phonenumber} and u.del_flag = '0'
 	</select>
 	
 	<select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult">
 	    <include refid="selectUserVo"/>
-		where u.email = #{email}
+		where u.email = #{email} and u.del_flag = '0'
 	</select>
 	
 	<select id="checkLoginNameUnique" parameterType="String" resultType="int">
-		select count(1) from sys_user where login_name=#{loginName} limit 1
+		select count(1) from sys_user where login_name=#{loginName} and del_flag = '0' limit 1
 	</select>
 	
 	<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
-		select user_id, phonenumber from sys_user where phonenumber=#{phonenumber} limit 1
+		select user_id, phonenumber from sys_user where phonenumber=#{phonenumber} and del_flag = '0' limit 1
 	</select>
 	
 	<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
-		select user_id, email from sys_user where email=#{email} limit 1
+		select user_id, email from sys_user where email=#{email} and del_flag = '0' limit 1
 	</select>
 	
 	<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">