-- ========================================
-- 入库管理系统 - 菜单导入SQL（修复版）
-- 使用 3000 系列ID避免冲突
-- ========================================

-- 1. 主菜单 - 入库管理
INSERT INTO `sys_menu` VALUES (3000, '入库管理', 0, 5, 'warehouse', NULL, '', 1, 0, 'M', '0', '0', '', 'education', 'admin', NOW(), '', NULL, '入库管理目录');

-- 2. 入库单管理菜单
INSERT INTO `sys_menu` VALUES (3001, '入库单管理', 3000, 1, 'receipt', 'warehouse/receipt/index', '', 1, 0, 'C', '0', '0', 'warehouse:receipt:list', 'form', 'admin', NOW(), '', NULL, '入库单管理菜单');
INSERT INTO `sys_menu` VALUES (3002, '入库单查询', 3001, 1, '', '', '', 1, 0, 'F', '0', '0', 'warehouse:receipt:query', '#', 'admin', NOW(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (3003, '入库单新增', 3001, 2, '', '', '', 1, 0, 'F', '0', '0', 'warehouse:receipt:add', '#', 'admin', NOW(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (3004, '入库单修改', 3001, 3, '', '', '', 1, 0, 'F', '0', '0', 'warehouse:receipt:edit', '#', 'admin', NOW(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (3005, '入库单删除', 3001, 4, '', '', '', 1, 0, 'F', '0', '0', 'warehouse:receipt:remove', '#', 'admin', NOW(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (3006, '入库单导出', 3001, 5, '', '', '', 1, 0, 'F', '0', '0', 'warehouse:receipt:export', '#', 'admin', NOW(), '', NULL, '');

-- 3. 样品管理菜单
INSERT INTO `sys_menu` VALUES (3011, '样品管理', 3000, 2, 'sample', 'warehouse/sample/index', '', 1, 0, 'C', '0', '0', 'warehouse:sample:list', 'list', 'admin', NOW(), '', NULL, '样品管理菜单');
INSERT INTO `sys_menu` VALUES (3012, '样品查询', 3011, 1, '', '', '', 1, 0, 'F', '0', '0', 'warehouse:sample:query', '#', 'admin', NOW(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (3013, '样品新增', 3011, 2, '', '', '', 1, 0, 'F', '0', '0', 'warehouse:sample:add', '#', 'admin', NOW(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (3014, '样品修改', 3011, 3, '', '', '', 1, 0, 'F', '0', '0', 'warehouse:sample:edit', '#', 'admin', NOW(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (3015, '样品删除', 3011, 4, '', '', '', 1, 0, 'F', '0', '0', 'warehouse:sample:remove', '#', 'admin', NOW(), '', NULL, '');
INSERT INTO `sys_menu` VALUES (3016, '样品导出', 3011, 5, '', '', '', 1, 0, 'F', '0', '0', 'warehouse:sample:export', '#', 'admin', NOW(), '', NULL, '');

-- 4. 为 admin 角色分配菜单权限（假设role_id=1）
INSERT INTO sys_role_menu (role_id, menu_id) VALUES 
(1, 3000),
(1, 3001),
(1, 3002),
(1, 3003),
(1, 3004),
(1, 3005),
(1, 3006),
(1, 3011),
(1, 3012),
(1, 3013),
(1, 3014),
(1, 3015),
(1, 3016);

-- ========================================
-- 验证SQL：执行完后运行以下查询验证
-- SELECT menu_id, menu_name, parent_id FROM sys_menu WHERE menu_id >= 3000 AND menu_id <= 3016;
-- ========================================






