Browse Source

优化按钮查询逻辑

test
smallchill 5 years ago
parent
commit
80f54319f2
  1. 51
      blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.xml

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

@ -139,44 +139,23 @@
<select id="allButtons" resultMap="menuResultMap"> <select id="allButtons" resultMap="menuResultMap">
SELECT SELECT
* id,
parent_id,
CODE,
NAME,
alias,
path,
source,
action,
sort
FROM FROM
blade_menu
WHERE
( (
SELECT category = 2 OR id IN ( SELECT parent_id FROM blade_menu WHERE is_deleted = 0 AND category = 2 )
id, )
parent_id, AND is_deleted = 0
CODE, ORDER BY sort
NAME,
alias,
path,
source,
action,
sort
FROM
blade_menu
WHERE
id IN ( SELECT parent_id FROM blade_menu WHERE is_deleted = 0 AND category = 2 )
UNION ALL
SELECT
id,
parent_id,
CODE,
NAME,
alias,
path,
source,
action,
sort
FROM
blade_menu
WHERE
is_deleted = 0
AND category = 2
) menu
ORDER BY
sort
</select> </select>
<select id="buttons" resultMap="menuResultMap"> <select id="buttons" resultMap="menuResultMap">

Loading…
Cancel
Save