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

master
RuoYi 2 years ago
parent aee5d417ed
commit e0cd5381e2
  1. 2
      ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
  2. 6
      ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
  3. 10
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@ -82,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkDeptNameUnique" resultMap="SysDeptResult"> <select id="checkDeptNameUnique" resultMap="SysDeptResult">
<include refid="selectDeptVo"/> <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>
<insert id="insertDept" parameterType="SysDept"> <insert id="insertDept" parameterType="SysDept">

@ -85,12 +85,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult"> <select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/> <include refid="selectRoleVo"/>
where r.role_name=#{roleName} limit 1 where r.role_name=#{roleName} and r.del_flag = '0' limit 1
</select> </select>
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult"> <select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/> <include refid="selectRoleVo"/>
where r.role_key=#{roleKey} limit 1 where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
</select> </select>
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId"> <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
@ -139,7 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteRoleById" parameterType="Long"> <delete id="deleteRoleById" parameterType="Long">
update sys_role set del_flag = '2' where role_id = #{roleId} update sys_role set del_flag = '2' where role_id = #{roleId}
</delete> </delete>
<delete id="deleteRoleByIds" parameterType="Long"> <delete id="deleteRoleByIds" parameterType="Long">

@ -122,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/> <include refid="selectUserVo"/>
where u.user_name = #{userName} where u.user_name = #{userName} and u.del_flag = '0'
</select> </select>
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult"> <select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
@ -131,15 +131,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="checkUserNameUnique" parameterType="String" resultType="int"> <select id="checkUserNameUnique" parameterType="String" resultType="int">
select count(1) from sys_user where user_name = #{userName} limit 1 select count(1) from sys_user where user_name = #{userName} and del_flag = '0' limit 1
</select> </select>
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult"> <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>
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> <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>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
@ -208,7 +208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteUserById" parameterType="Long"> <delete id="deleteUserById" parameterType="Long">
update sys_user set del_flag = '2' where user_id = #{userId} update sys_user set del_flag = '2' where user_id = #{userId}
</delete> </delete>
<delete id="deleteUserByIds" parameterType="Long"> <delete id="deleteUserByIds" parameterType="Long">

Loading…
Cancel
Save