-- 诊断知识库管理菜单配置问题
-- 1. 查看知识库管理的当前配置
SELECT menu_id, menu_name, parent_id, path, component, perms, menu_type, visible, status
FROM sys_menu 
WHERE menu_name = '知识库管理';

-- 2. 查看其他psychology相关菜单的配置（对比参考）
SELECT menu_id, menu_name, parent_id, path, component, perms, menu_type, visible, status
FROM sys_menu 
WHERE component LIKE 'psychology/%'
ORDER BY menu_id
LIMIT 10;

-- 3. 查看心理健康父菜单的配置
SELECT menu_id, menu_name, parent_id, path, component, menu_type, visible, status
FROM sys_menu 
WHERE menu_name = '心理健康';

-- 4. 检查是否有权限问题
SELECT r.role_name, rm.menu_id, m.menu_name
FROM sys_role r
LEFT JOIN sys_role_menu rm ON r.role_id = rm.role_id
LEFT JOIN sys_menu m ON rm.menu_id = m.menu_id
WHERE m.menu_name = '知识库管理';
