-- ============================================================
-- 盘古用户平台 - 业务菜单数据（根据需求文档调整）
-- 作者：pangu
-- 创建时间：2026-02-02
-- 说明：按需求文档布局，业务模块为一级菜单
-- ============================================================

USE `pguser-db`;

-- 删除现有业务菜单
DELETE FROM sys_menu WHERE menu_id >= 2000;

-- 隐藏不需要的系统菜单
UPDATE sys_menu SET visible = '1' WHERE menu_id IN (4, 5, 6);

-- ===================== 学校管理（一级菜单） =====================
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time)
VALUES (2000, '学校管理', 0, 4, 'school', 'business/school/index', '', 1, 0, 'C', '0', '0', 'business:school:list', 'education', 103, 1, NOW());
INSERT INTO sys_menu VALUES (2001, '学校查询', 2000, 1, '', '', '', 1, 0, 'F', '0', '0', 'business:school:query', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2002, '学校新增', 2000, 2, '', '', '', 1, 0, 'F', '0', '0', 'business:school:add', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2003, '学校修改', 2000, 3, '', '', '', 1, 0, 'F', '0', '0', 'business:school:edit', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2004, '学校删除', 2000, 4, '', '', '', 1, 0, 'F', '0', '0', 'business:school:remove', '#', 103, 1, NOW(), NULL, NULL, '');

-- ===================== 会员管理（一级菜单） =====================
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time)
VALUES (2100, '会员管理', 0, 5, 'member', 'business/member/index', '', 1, 0, 'C', '0', '0', 'business:member:list', 'user', 103, 1, NOW());
INSERT INTO sys_menu VALUES (2101, '会员查询', 2100, 1, '', '', '', 1, 0, 'F', '0', '0', 'business:member:query', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2102, '会员新增', 2100, 2, '', '', '', 1, 0, 'F', '0', '0', 'business:member:add', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2103, '会员修改', 2100, 3, '', '', '', 1, 0, 'F', '0', '0', 'business:member:edit', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2104, '会员删除', 2100, 4, '', '', '', 1, 0, 'F', '0', '0', 'business:member:remove', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2105, '重置密码', 2100, 5, '', '', '', 1, 0, 'F', '0', '0', 'business:member:resetPwd', '#', 103, 1, NOW(), NULL, NULL, '');

-- ===================== 学生管理（一级菜单） =====================
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time)
VALUES (2200, '学生管理', 0, 6, 'student', 'business/student/index', '', 1, 0, 'C', '0', '0', 'business:student:list', 'peoples', 103, 1, NOW());
INSERT INTO sys_menu VALUES (2201, '学生查询', 2200, 1, '', '', '', 1, 0, 'F', '0', '0', 'business:student:query', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2202, '学生新增', 2200, 2, '', '', '', 1, 0, 'F', '0', '0', 'business:student:add', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2203, '学生修改', 2200, 3, '', '', '', 1, 0, 'F', '0', '0', 'business:student:edit', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2204, '学生删除', 2200, 4, '', '', '', 1, 0, 'F', '0', '0', 'business:student:remove', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2205, '学生导入', 2200, 5, '', '', '', 1, 0, 'F', '0', '0', 'business:student:import', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2206, '学生导出', 2200, 6, '', '', '', 1, 0, 'F', '0', '0', 'business:student:export', '#', 103, 1, NOW(), NULL, NULL, '');

-- ===================== 应用管理（一级菜单） =====================
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time)
VALUES (2300, '应用管理', 0, 7, 'application', 'business/application/index', '', 1, 0, 'C', '0', '0', 'business:application:list', 'component', 103, 1, NOW());
INSERT INTO sys_menu VALUES (2301, '应用查询', 2300, 1, '', '', '', 1, 0, 'F', '0', '0', 'business:application:query', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2302, '应用新增', 2300, 2, '', '', '', 1, 0, 'F', '0', '0', 'business:application:add', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2303, '应用修改', 2300, 3, '', '', '', 1, 0, 'F', '0', '0', 'business:application:edit', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2304, '应用删除', 2300, 4, '', '', '', 1, 0, 'F', '0', '0', 'business:application:remove', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2305, '重置密钥', 2300, 5, '', '', '', 1, 0, 'F', '0', '0', 'business:application:resetSecret', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2306, '接口授权', 2300, 6, '', '', '', 1, 0, 'F', '0', '0', 'business:application:api', '#', 103, 1, NOW(), NULL, NULL, '');

-- ===================== 基础数据（一级目录） =====================
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time)
VALUES (2400, '基础数据', 0, 8, 'base', NULL, '', 1, 0, 'M', '0', '0', '', 'dict', 103, 1, NOW());

-- 年级管理
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time)
VALUES (2410, '年级管理', 2400, 1, 'grade', 'business/base/grade/index', '', 1, 0, 'C', '0', '0', 'business:grade:list', 'skill', 103, 1, NOW());
INSERT INTO sys_menu VALUES (2411, '年级查询', 2410, 1, '', '', '', 1, 0, 'F', '0', '0', 'business:grade:query', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2412, '年级新增', 2410, 2, '', '', '', 1, 0, 'F', '0', '0', 'business:grade:add', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2413, '年级修改', 2410, 3, '', '', '', 1, 0, 'F', '0', '0', 'business:grade:edit', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2414, '年级删除', 2410, 4, '', '', '', 1, 0, 'F', '0', '0', 'business:grade:remove', '#', 103, 1, NOW(), NULL, NULL, '');

-- 班级管理
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time)
VALUES (2420, '班级管理', 2400, 2, 'class', 'business/base/class/index', '', 1, 0, 'C', '0', '0', 'business:class:list', 'peoples', 103, 1, NOW());
INSERT INTO sys_menu VALUES (2421, '班级查询', 2420, 1, '', '', '', 1, 0, 'F', '0', '0', 'business:class:query', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2422, '班级新增', 2420, 2, '', '', '', 1, 0, 'F', '0', '0', 'business:class:add', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2423, '班级修改', 2420, 3, '', '', '', 1, 0, 'F', '0', '0', 'business:class:edit', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2424, '班级删除', 2420, 4, '', '', '', 1, 0, 'F', '0', '0', 'business:class:remove', '#', 103, 1, NOW(), NULL, NULL, '');

-- 学科管理
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time)
VALUES (2430, '学科管理', 2400, 3, 'subject', 'business/base/subject/index', '', 1, 0, 'C', '0', '0', 'business:subject:list', 'list', 103, 1, NOW());
INSERT INTO sys_menu VALUES (2431, '学科查询', 2430, 1, '', '', '', 1, 0, 'F', '0', '0', 'business:subject:query', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2432, '学科新增', 2430, 2, '', '', '', 1, 0, 'F', '0', '0', 'business:subject:add', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2433, '学科修改', 2430, 3, '', '', '', 1, 0, 'F', '0', '0', 'business:subject:edit', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2434, '学科删除', 2430, 4, '', '', '', 1, 0, 'F', '0', '0', 'business:subject:remove', '#', 103, 1, NOW(), NULL, NULL, '');

-- 区域管理
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time)
VALUES (2440, '区域管理', 2400, 4, 'region', 'business/base/region/index', '', 1, 0, 'C', '0', '0', 'business:region:list', 'tree', 103, 1, NOW());
INSERT INTO sys_menu VALUES (2441, '区域查询', 2440, 1, '', '', '', 1, 0, 'F', '0', '0', 'business:region:query', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2442, '区域新增', 2440, 2, '', '', '', 1, 0, 'F', '0', '0', 'business:region:add', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2443, '区域修改', 2440, 3, '', '', '', 1, 0, 'F', '0', '0', 'business:region:edit', '#', 103, 1, NOW(), NULL, NULL, '');
INSERT INTO sys_menu VALUES (2444, '区域删除', 2440, 4, '', '', '', 1, 0, 'F', '0', '0', 'business:region:remove', '#', 103, 1, NOW(), NULL, NULL, '');
