-- 检查路由命名问题
USE soybean_admin;

SELECT '=== 检查 my_device 和 my_application 路由命名 ===' AS info;

SELECT 
    route_id,
    name,
    path,
    component,
    JSON_EXTRACT(meta, '$.title') as title
FROM sys_route 
WHERE name LIKE 'my_%device%' OR name LIKE 'my_%application%'
ORDER BY order_num;

SELECT '=== 前端期望的路由命名（使用连字符） ===' AS info;
SELECT 'my-device (父路由)' AS expected_name UNION ALL
SELECT 'my-device_status (子路由)' UNION ALL
SELECT 'my-device_power-control (子路由)' UNION ALL
SELECT 'my-device_remote-control (子路由)' UNION ALL
SELECT 'my-application (父路由)' UNION ALL
SELECT 'my-application_apply (子路由)' UNION ALL
SELECT 'my-application_my-list (子路由)';

SELECT '=== 问题分析 ===' AS info;
SELECT '数据库中使用下划线: my_device, my_application' AS issue UNION ALL
SELECT '前端期望使用连字符: my-device, my-application' AS expected UNION ALL
SELECT '这导致路由无法匹配，页面显示异常' AS result;
