update 优化 大数据量下join卡顿问题 使用子查询提高性能
This commit is contained in:
@@ -48,9 +48,7 @@
|
||||
r.data_scope,
|
||||
r.status
|
||||
from sys_role r
|
||||
left join sys_user_role sur on sur.role_id = r.role_id
|
||||
left join sys_user u on u.user_id = sur.user_id
|
||||
WHERE r.del_flag = '0' and sur.user_id = #{userId}
|
||||
WHERE r.del_flag = '0' and r.role_id in (select role_id from sys_user_role where user_id = #{userId})
|
||||
</select>
|
||||
|
||||
<select id="selectRoleById" resultMap="SysRoleResult">
|
||||
|
||||
Reference in New Issue
Block a user