-- 客户满意度评价管理菜单 SQL

-- 1. 评价管理主菜单
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', '6', 'evaluation', null, 1, 0, 'M', '0', '0', null, 'star', 'admin', sysdate(), '', null, '客户满意度评价管理目录');

-- 获取评价管理主菜单ID
SELECT @evaluationParentId := LAST_INSERT_ID();

-- 2. 客户评价菜单
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('客户评价', @evaluationParentId, '1', 'customer', 'evaluation/customer/index', 1, 0, 'C', '0', '0', 'evaluation:customer:list', 'message', 'admin', sysdate(), '', null, '客户评价菜单');

-- 获取客户评价菜单ID
SELECT @customerParentId := 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('客户评价查询', @customerParentId, '1', '#', '', 1, 0, 'F', '0', '0', 'evaluation:customer: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('客户评价删除', @customerParentId, '2', '#', '', 1, 0, 'F', '0', '0', 'evaluation:customer: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('客户评价导出', @customerParentId, '3', '#', '', 1, 0, 'F', '0', '0', 'evaluation:customer:export', '#', 'admin', sysdate(), '', null, '');

-- 3. 评价维度配置菜单
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('评价维度', @evaluationParentId, '2', 'dimension', 'evaluation/dimension/index', 1, 0, 'C', '0', '0', 'evaluation:dimension:list', 'edit', 'admin', sysdate(), '', null, '评价维度配置菜单');

-- 获取评价维度菜单ID
SELECT @dimensionParentId := 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('评价维度查询', @dimensionParentId, '1', '#', '', 1, 0, 'F', '0', '0', 'evaluation:dimension: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('评价维度新增', @dimensionParentId, '2', '#', '', 1, 0, 'F', '0', '0', 'evaluation:dimension: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('评价维度修改', @dimensionParentId, '3', '#', '', 1, 0, 'F', '0', '0', 'evaluation:dimension: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('评价维度删除', @dimensionParentId, '4', '#', '', 1, 0, 'F', '0', '0', 'evaluation:dimension:remove', '#', 'admin', sysdate(), '', null, '');

-- 4. 车辆二维码管理菜单
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('车辆二维码', @evaluationParentId, '3', 'qrcode', 'evaluation/qrcode/index', 1, 0, 'C', '0', '0', 'evaluation:qrcode:list', 'qrcode', 'admin', sysdate(), '', null, '车辆评价二维码管理菜单');

-- 获取车辆二维码菜单ID
SELECT @qrcodeParentId := 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('二维码查询', @qrcodeParentId, '1', '#', '', 1, 0, 'F', '0', '0', 'evaluation:qrcode: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('二维码生成', @qrcodeParentId, '2', '#', '', 1, 0, 'F', '0', '0', 'evaluation:qrcode:generate', '#', '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('批量生成', @qrcodeParentId, '3', '#', '', 1, 0, 'F', '0', '0', 'evaluation:qrcode:batch', '#', '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('二维码删除', @qrcodeParentId, '4', '#', '', 1, 0, 'F', '0', '0', 'evaluation:qrcode:remove', '#', 'admin', sysdate(), '', null, '');

-- 5. 评价统计菜单
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('评价统计', @evaluationParentId, '4', 'statistics', 'evaluation/statistics/index', 1, 0, 'C', '0', '0', 'evaluation:statistics:list', 'chart', 'admin', sysdate(), '', null, '评价统计分析菜单');

-- 获取评价统计菜单ID
SELECT @statisticsParentId := 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('统计查询', @statisticsParentId, '1', '#', '', 1, 0, 'F', '0', '0', 'evaluation:statistics: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('统计导出', @statisticsParentId, '2', '#', '', 1, 0, 'F', '0', '0', 'evaluation:statistics:export', '#', 'admin', sysdate(), '', null, '');
