Pārlūkot izejas kodu

用户&角色单条删除时使其逻辑删除

RuoYi 5 gadi atpakaļ
vecāks
revīzija
89a9188dd4

+ 4 - 8
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -97,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
97 97
  			<if test="roleKey != null and roleKey != ''">role_key,</if>
98 98
  			<if test="roleSort != null and roleSort != ''">role_sort,</if>
99 99
  			<if test="dataScope != null and dataScope != ''">data_scope,</if>
100
-            <if test="menuCheckStrictly != null">menu_check_strictly,</if>
100
+ 			<if test="menuCheckStrictly != null">menu_check_strictly,</if>
101 101
  			<if test="deptCheckStrictly != null">dept_check_strictly,</if>
102 102
  			<if test="status != null and status != ''">status,</if>
103 103
  			<if test="remark != null and remark != ''">remark,</if>
@@ -109,7 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
109 109
  			<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
110 110
  			<if test="roleSort != null and roleSort != ''">#{roleSort},</if>
111 111
  			<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
112
-            <if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
112
+ 			<if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
113 113
  			<if test="deptCheckStrictly != null">#{deptCheckStrictly},</if>
114 114
  			<if test="status != null and status != ''">#{status},</if>
115 115
  			<if test="remark != null and remark != ''">#{remark},</if>
@@ -125,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
125 125
  			<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
126 126
  			<if test="roleSort != null and roleSort != ''">role_sort = #{roleSort},</if>
127 127
  			<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
128
-            <if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if>
128
+ 			<if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if>
129 129
  			<if test="deptCheckStrictly != null">dept_check_strictly = #{deptCheckStrictly},</if>
130 130
  			<if test="status != null and status != ''">status = #{status},</if>
131 131
  			<if test="remark != null">remark = #{remark},</if>
@@ -135,12 +135,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
135 135
  		where role_id = #{roleId}
136 136
 	</update>
137 137
 	
138
-	<update id="updateRoleStatus" parameterType="SysRole">
139
- 		update sys_user set status = #{status} where user_id = #{userId}
140
-	</update>
141
-	
142 138
 	<delete id="deleteRoleById" parameterType="Long">
143
- 		delete from sys_role where role_id = #{roleId}
139
+		update sys_role set del_flag = '2' where role_id = #{roleId}
144 140
  	</delete>
145 141
  	
146 142
  	<delete id="deleteRoleByIds" parameterType="Long">

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

@@ -169,7 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
169 169
 	</update>
170 170
 	
171 171
 	<delete id="deleteUserById" parameterType="Long">
172
- 		delete from sys_user where user_id = #{userId}
172
+		update sys_user set del_flag = '2' where user_id = #{userId}
173 173
  	</delete>
174 174
  	
175 175
  	<delete id="deleteUserByIds" parameterType="Long">