-- ----------------------------
-- 洪水知识库系统菜单SQL
-- ----------------------------

-- 1. 洪水管理（父菜单）
insert into sys_menu values('2000', '洪水管理', '0', '5', 'flood', null, '', '', 1, 0, 'M', '0', '0', '', 'guide', 'admin', sysdate(), '', null, '洪水知识库系统管理目录');

-- 2. 知识库管理（子菜单）
insert into sys_menu values('2001', '知识库管理', '2000', '1', 'knowledge', 'flood/knowledge/index', '', '', 1, 0, 'C', '0', '0', 'flood:knowledge:list', 'documentation', 'admin', sysdate(), '', null, '知识库管理菜单');

-- 知识库管理按钮
insert into sys_menu values('20011', '知识库查询', '2001', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:knowledge:query', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20012', '知识库新增', '2001', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:knowledge:add', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20013', '知识库修改', '2001', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:knowledge:edit', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20014', '知识库删除', '2001', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:knowledge:remove', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20015', '知识库导出', '2001', '5', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:knowledge:export', '#', 'admin', sysdate(), '', null, '');

-- 知识库文件管理按钮
insert into sys_menu values('20016', '文件上传', '2001', '6', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:knowledge:upload', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20017', '文件删除', '2001', '7', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:knowledge:file:remove', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20018', '文件预览', '2001', '8', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:knowledge:file:preview', '#', 'admin', sysdate(), '', null, '');

-- 3. 应急预案管理（子菜单）
insert into sys_menu values('2002', '应急预案管理', '2000', '2', 'plan', 'flood/emergency/index', '', '', 1, 0, 'C', '0', '0', 'flood:plan:list', 'list', 'admin', sysdate(), '', null, '应急预案管理菜单');

-- 应急预案管理按钮
insert into sys_menu values('20021', '预案查询', '2002', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:plan:query', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20022', '预案新增', '2002', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:plan:add', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20023', '预案修改', '2002', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:plan:edit', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20024', '预案删除', '2002', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:plan:remove', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20025', '预案导出', '2002', '5', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:plan:export', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20026', '预案导入', '2002', '6', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:plan:import', '#', 'admin', sysdate(), '', null, '');

-- 4. 案例库管理（子菜单）
insert into sys_menu values('2003', '案例库管理', '2000', '3', 'case', 'flood/case/index', '', '', 1, 0, 'C', '0', '0', 'flood:case:list', 'example', 'admin', sysdate(), '', null, '案例库管理菜单');

-- 案例库管理按钮
insert into sys_menu values('20031', '案例查询', '2003', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:case:query', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20032', '案例新增', '2003', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:case:add', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20033', '案例修改', '2003', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:case:edit', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20034', '案例删除', '2003', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:case:remove', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20035', '案例导出', '2003', '5', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:case:export', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20036', '案例导入', '2003', '6', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:case:import', '#', 'admin', sysdate(), '', null, '');

-- 5. 知识图谱（子菜单）
insert into sys_menu values('2004', '知识图谱', '2000', '4', 'graph', 'flood/graph/index', '', '', 1, 0, 'C', '0', '0', 'flood:graph:list', 'tree', 'admin', sysdate(), '', null, '知识图谱菜单');

-- 知识图谱按钮
insert into sys_menu values('20041', '图谱查询', '2004', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:graph:query', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('20042', '节点查询', '2004', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'flood:graph:node:query', '#', 'admin', sysdate(), '', null, '');

-- ----------------------------
-- 为超级管理员角色分配所有菜单权限
-- ----------------------------
insert into sys_role_menu values('1', '2000');
insert into sys_role_menu values('1', '2001');
insert into sys_role_menu values('1', '20011');
insert into sys_role_menu values('1', '20012');
insert into sys_role_menu values('1', '20013');
insert into sys_role_menu values('1', '20014');
insert into sys_role_menu values('1', '20015');
insert into sys_role_menu values('1', '20016');
insert into sys_role_menu values('1', '20017');
insert into sys_role_menu values('1', '20018');
insert into sys_role_menu values('1', '2002');
insert into sys_role_menu values('1', '20021');
insert into sys_role_menu values('1', '20022');
insert into sys_role_menu values('1', '20023');
insert into sys_role_menu values('1', '20024');
insert into sys_role_menu values('1', '20025');
insert into sys_role_menu values('1', '20026');
insert into sys_role_menu values('1', '2003');
insert into sys_role_menu values('1', '20031');
insert into sys_role_menu values('1', '20032');
insert into sys_role_menu values('1', '20033');
insert into sys_role_menu values('1', '20034');
insert into sys_role_menu values('1', '20035');
insert into sys_role_menu values('1', '20036');
insert into sys_role_menu values('1', '2004');
insert into sys_role_menu values('1', '20041');
insert into sys_role_menu values('1', '20042');
