Browse Source

优化数据接口权限授权展示逻辑,修复sqlserver兼容性

test
smallchill 4 years ago
parent
commit
d8c5ae27ac
  1. 40
      blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.xml

40
blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.xml

@ -328,10 +328,13 @@
category = 1
AND is_deleted = 0
AND id IN ( SELECT menu_id FROM blade_scope_data WHERE is_deleted = 0 AND menu_id IS NOT NULL )
AND id IN ( select menu_id from blade_role_menu where role_id in
AND (
id IN (
select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
</foreach>
)
OR id IN (
select parent_id from blade_menu where is_deleted = 0
and id in ( select menu_id from blade_role_menu where role_id in
@ -339,8 +342,7 @@
#{item}
</foreach> )
)
ORDER BY
sort
)
) menu
UNION ALL
@ -355,10 +357,13 @@
blade_scope_data
WHERE
is_deleted = 0
AND menu_id IN ( select menu_id from blade_role_menu where role_id in
AND (
menu_id IN (
select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
</foreach>
)
OR menu_id IN (
select parent_id from blade_menu where is_deleted = 0
and id in ( select menu_id from blade_role_menu where role_id in
@ -366,6 +371,7 @@
#{item}
</foreach> )
)
)
AND menu_id IS NOT NULL
</select>
@ -386,19 +392,22 @@
category = 1
AND is_deleted = 0
AND id IN ( SELECT menu_id FROM blade_scope_api WHERE is_deleted = 0 AND menu_id IS NOT NULL )
AND id IN ( select menu_id from blade_role_menu where role_id in
AND (
id IN (
select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
</foreach>
)
OR id IN (
select parent_id from blade_menu where is_deleted = 0
and id in ( select menu_id from blade_role_menu where role_id in
and id in (
select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
)
ORDER BY
sort
)
) menu
UNION ALL
@ -413,10 +422,14 @@
blade_scope_api
WHERE
is_deleted = 0
AND menu_id IN ( select menu_id from blade_role_menu where role_id in
AND
(
menu_id IN (
select menu_id from blade_role_menu where role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
</foreach>
)
OR menu_id IN (
select parent_id from blade_menu where is_deleted = 0
and id in ( select menu_id from blade_role_menu where role_id in
@ -424,6 +437,7 @@
#{item}
</foreach> )
)
)
AND menu_id IS NOT NULL
</select>

Loading…
Cancel
Save