-- 达梦 8 增量脚本：工具栏公司/部门切换权限点
-- 请在执行前确认 system_menu 表中尚不存在相同 ID 或 permission 的记录

INSERT INTO system_menu (id, name, permission, type, sort, parent_id, path, icon, component, component_name, status, visible, keep_alive, always_show, creator, create_time, updater, update_time, deleted)
SELECT 5013, '公司切换', 'system:company:visit', 3, 100, 103, '', '', '', '', 0, '1', '1', '1', '1', SYSDATE, '1', SYSDATE, '0'
FROM dual
WHERE NOT EXISTS (
    SELECT 1 FROM system_menu
    WHERE id = 5013 OR permission = 'system:company:visit'
);

INSERT INTO system_menu (id, name, permission, type, sort, parent_id, path, icon, component, component_name, status, visible, keep_alive, always_show, creator, create_time, updater, update_time, deleted)
SELECT 5014, '部门切换', 'system:dept:visit', 3, 101, 103, '', '', '', '', 0, '1', '1', '1', '1', SYSDATE, '1', SYSDATE, '0'
FROM dual
WHERE NOT EXISTS (
    SELECT 1 FROM system_menu
    WHERE id = 5014 OR permission = 'system:dept:visit'
);
