-- ----------------------------
-- 通用任务管理菜单权限配置
-- ----------------------------

-- 任务管理菜单
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('任务管理', '0', '5', 'task', null, 1, 0, 'M', '0', '0', '', 'task', 'admin', sysdate(), '', null, '任务管理目录');

-- 任务管理父菜单ID
SELECT @taskParentId := LAST_INSERT_ID();

-- 通用任务菜单
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('通用任务', @taskParentId, '1', 'general', 'task/general/index', 1, 0, 'C', '0', '0', 'task:general:view', 'list', 'admin', sysdate(), '', null, '通用任务菜单');

-- 通用任务按钮父菜单ID
SELECT @generalParentId := LAST_INSERT_ID();

-- 通用任务按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('任务查询', @generalParentId, '1',  '#', '', 1, 0, 'F', '0', '0', 'task:general:query',        '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('任务新增', @generalParentId, '2',  '#', '', 1, 0, 'F', '0', '0', 'task:general:add',          '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('任务修改', @generalParentId, '3',  '#', '', 1, 0, 'F', '0', '0', 'task:general:edit',         '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('任务删除', @generalParentId, '4',  '#', '', 1, 0, 'F', '0', '0', 'task:general:remove',       '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('任务分配', @generalParentId, '5',  '#', '', 1, 0, 'F', '0', '0', 'task:general:assign',       '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('状态变更', @generalParentId, '6',  '#', '', 1, 0, 'F', '0', '0', 'task:general:status',       '#', 'admin', sysdate(), '', null, '');

-- 车辆管理菜单
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('车辆管理', @taskParentId, '2', 'vehicle', 'task/vehicle/index', 1, 0, 'C', '0', '0', 'task:vehicle:view', 'car', 'admin', sysdate(), '', null, '车辆管理菜单');

-- 车辆管理按钮父菜单ID
SELECT @vehicleParentId := LAST_INSERT_ID();

-- 车辆管理按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('车辆查询', @vehicleParentId, '1',  '#', '', 1, 0, 'F', '0', '0', 'task:vehicle:query',        '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('车辆新增', @vehicleParentId, '2',  '#', '', 1, 0, 'F', '0', '0', 'task:vehicle:add',          '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('车辆修改', @vehicleParentId, '3',  '#', '', 1, 0, 'F', '0', '0', 'task:vehicle:edit',         '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('车辆删除', @vehicleParentId, '4',  '#', '', 1, 0, 'F', '0', '0', 'task:vehicle:remove',       '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('车辆分配', @vehicleParentId, '5',  '#', '', 1, 0, 'F', '0', '0', 'task:vehicle:assign',       '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('车辆导出', @vehicleParentId, '6',  '#', '', 1, 0, 'F', '0', '0', 'task:vehicle:export',       '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('车辆列表', @vehicleParentId, '7',  '#', '', 1, 0, 'F', '0', '0', 'task:vehicle:list',         '#', 'admin', sysdate(), '', null, '');