sql修改

This commit is contained in:
dinggang 2022-11-25 16:45:11 +08:00
parent 0d3d6f61ec
commit 8342c4b978
2 changed files with 3 additions and 2 deletions

View File

@ -20,11 +20,12 @@
--> -->
<update id="deleteByUserIds"> <update id="deleteByUserIds">
UPDATE sys_role_user SET del_flag = 0, update_date = NOW(), updater = #{updater} UPDATE sys_role_user SET del_flag = 1, update_date = NOW(), updater = #{updater}
where user_id in where user_id in
<foreach item="userId" collection="userIds" open="(" separator="," close=")"> <foreach item="userId" collection="userIds" open="(" separator="," close=")">
#{userId} #{userId}
</foreach> </foreach>
AND del_flag = 0
</update> </update>
<select id="getRoleIdList" resultType="long"> <select id="getRoleIdList" resultType="long">

View File

@ -33,7 +33,7 @@
</if> </if>
<if test="role_id != null"> <if test="role_id != null">
AND EXISTS(SELECT 1 FROM sys_role_user WHERE sys_role_user.user_id = t1.id AND sys_role_user.role_id = AND EXISTS(SELECT 1 FROM sys_role_user WHERE sys_role_user.user_id = t1.id AND sys_role_user.role_id =
#{role_id}) AND sys_role_user.del_flag = 0 #{role_id} AND sys_role_user.del_flag = 0)
</if> </if>
</select> </select>