-- ============================================================
-- 盘古用户平台 - 业务菜单初始化脚本
-- 作者：湖北新华业务中台研发团队
-- 创建时间：2026-01-31
-- 说明：在 RuoYi 基础上添加盘古业务模块菜单
-- ============================================================

-- 一级菜单：盘古管理（放在系统管理之前）
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2000, '盘古管理', 0, 0, 'pangu', NULL, '', '', 1, 0, 'M', '0', '0', '', 'peoples', 'admin', sysdate(), '', NULL, '盘古用户平台业务菜单');

-- 二级菜单：学校管理
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2001, '学校管理', 2000, 1, 'school', 'school/index', '', 'School', 1, 0, 'C', '0', '0', 'pangu:school:list', 'education', 'admin', sysdate(), '', NULL, '学校管理菜单');

-- 学校管理按钮权限
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2011, '学校查询', 2001, 1, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:school:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2012, '学校新增', 2001, 2, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:school:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2013, '学校修改', 2001, 3, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:school:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2014, '学校删除', 2001, 4, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:school:remove', '#', 'admin', sysdate(), '', NULL, '');

-- 二级菜单：会员管理
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2002, '会员管理', 2000, 2, 'member', 'member/index', '', 'Member', 1, 0, 'C', '0', '0', 'pangu:member:list', 'peoples', 'admin', sysdate(), '', NULL, '会员管理菜单');

-- 会员管理按钮权限
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2021, '会员查询', 2002, 1, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:member:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2022, '会员新增', 2002, 2, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:member:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2023, '会员修改', 2002, 3, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:member:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2024, '会员删除', 2002, 4, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:member:remove', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2025, '重置密码', 2002, 5, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:member:resetPwd', '#', 'admin', sysdate(), '', NULL, '');

-- 二级菜单：学生管理
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2003, '学生管理', 2000, 3, 'student', 'student/index', '', 'Student', 1, 0, 'C', '0', '0', 'pangu:student:list', 'people', 'admin', sysdate(), '', NULL, '学生管理菜单');

-- 学生管理按钮权限
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2031, '学生查询', 2003, 1, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:student:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2032, '学生新增', 2003, 2, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:student:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2033, '学生修改', 2003, 3, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:student:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2034, '学生删除', 2003, 4, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:student:remove', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2035, '学生导入', 2003, 5, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:student:import', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2036, '学生导出', 2003, 6, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:student:export', '#', 'admin', sysdate(), '', NULL, '');

-- 二级菜单：应用管理
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2004, '应用管理', 2000, 4, 'application', 'application/index', '', 'Application', 1, 0, 'C', '0', '0', 'pangu:application:list', 'component', 'admin', sysdate(), '', NULL, '应用管理菜单');

-- 应用管理按钮权限
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2041, '应用查询', 2004, 1, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:application:query', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2042, '应用新增', 2004, 2, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:application:add', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2043, '应用修改', 2004, 3, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:application:edit', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2044, '应用删除', 2004, 4, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:application:remove', '#', 'admin', sysdate(), '', NULL, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2045, '重置密钥', 2004, 5, '', '', '', '', 1, 0, 'F', '0', '0', 'pangu:application:resetSecret', '#', 'admin', sysdate(), '', NULL, '');

-- 二级菜单：基础数据（目录）
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2005, '基础数据', 2000, 5, 'base', NULL, '', '', 1, 0, 'M', '0', '0', '', 'dict', 'admin', sysdate(), '', NULL, '基础数据目录');

-- 三级菜单：年级管理
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2051, '年级管理', 2005, 1, 'grade', 'base/grade/index', '', 'Grade', 1, 0, 'C', '0', '0', 'pangu:grade:list', 'tree-table', 'admin', sysdate(), '', NULL, '年级管理菜单');

-- 三级菜单：班级管理
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2052, '班级管理', 2005, 2, 'class', 'base/class/index', '', 'Class', 1, 0, 'C', '0', '0', 'pangu:class:list', 'list', 'admin', sysdate(), '', NULL, '班级管理菜单');

-- 三级菜单：学科管理
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2053, '学科管理', 2005, 3, 'subject', 'base/subject/index', '', 'Subject', 1, 0, 'C', '0', '0', 'pangu:subject:list', 'education', 'admin', sysdate(), '', NULL, '学科管理菜单');

-- 三级菜单：区域管理
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) 
VALUES (2054, '区域管理', 2005, 4, 'region', 'base/region/index', '', 'Region', 1, 0, 'C', '0', '0', 'pangu:region:list', 'tree', 'admin', sysdate(), '', NULL, '区域管理菜单');

-- 为管理员角色分配菜单权限
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2000);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2001);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2002);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2003);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2004);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2005);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2011);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2012);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2013);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2014);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2021);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2022);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2023);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2024);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2025);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2031);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2032);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2033);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2034);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2035);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2036);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2041);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2042);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2043);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2044);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2045);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2051);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2052);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2053);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2054);
