-- 调试用户管理路由配置
USE soybean_admin;

SELECT '=== 用户管理所有路由 ===' AS info;
SELECT route_id, name, path, component, order_num, status
FROM sys_route 
WHERE name LIKE '%user%' OR name LIKE '%manage%'
ORDER BY order_num;

SELECT '' AS '';
SELECT '=== R_SUPER 角色的菜单配置 ===' AS info;
SELECT role_code, menus 
FROM sys_role 
WHERE role_code = 'R_SUPER';

SELECT '' AS '';
SELECT '=== 检查子路由是否在角色配置中 ===' AS info;
SELECT 
    r.name AS route_name,
    CASE 
        WHEN role.menus LIKE CONCAT('%', r.name, '%') THEN 'YES'
        ELSE 'NO'
    END AS in_role_config
FROM sys_route r
CROSS JOIN sys_role role
WHERE role.role_code = 'R_SUPER'
  AND r.name LIKE '%user%'
ORDER BY r.order_num;
