my sql学习

SELECT DISTINCT
m.menu_id,
m.parent_id,
m.menu_name,
m.url,
m.visible,
ifnull(m.perms, '') AS perms,
m.target,
m.menu_type,
m.icon,
m.order_num,
m.create_time
FROM
sys_menu m
LEFT JOIN sys_role_menu rm ON m.menu_id = rm.menu_id
LEFT JOIN sys_user_role ur ON rm.role_id = ur.role_id
LEFT JOIN sys_role ro ON ur.role_id = ro.role_id
WHERE
ur.user_id = 2
AND m.menu_type IN ('M', 'C')
AND m.visible = 0
AND ro. STATUS = 0
ORDER BY
m.parent_id,
m.order_num

posted @ 2020-03-11 21:21  周周vs笨小孩  阅读(190)  评论(0编辑  收藏  举报