-- 建表 SQL
CREATE TABLE `pos_appeal` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `dd_id` bigint DEFAULT NULL COMMENT '订单号',
  `user_id` bigint DEFAULT NULL COMMENT '用户ID',
  `user_type` varchar(1) DEFAULT NULL COMMENT '用户类型',
  `nick_name` varchar(30) DEFAULT NULL COMMENT '昵称',
  `content` varchar(4000) DEFAULT NULL COMMENT '内容',
  `imgs` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '上传图片',
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户留言表';

-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component,query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('用户留言信息', '2006', '1', 'appeal', 'system/appeal/index','{\"type\":0}', 1, 0, 'C', '0', '0', 'system:appeal:list', '#', 'admin', sysdate(), '', null, '用户留言信息菜单');
insert into sys_menu (menu_name, parent_id, order_num, path, component,query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('商家留言信息', '2006', '2', 'appeal', 'system/appeal/index','{\"type\":1}', 1, 0, 'C', '0', '0', 'system:appeal:list', '#', 'admin', sysdate(), '', null, '商家留言信息菜单');
insert into sys_menu (menu_name, parent_id, order_num, path, component,query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('骑手留言信息', '2006', '3', 'appeal', 'system/appeal/index','{\"type\":2}', 1, 0, 'C', '0', '0', 'system:appeal:list', '#', 'admin', sysdate(), '', null, '骑手留言信息菜单');

-- 按钮父菜单ID
SELECT @parentId := 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('留言信息查询', @parentId, '1',  '#', '', 1, 0, 'F', '0', '0', 'system:appeal: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('留言信息新增', @parentId, '2',  '#', '', 1, 0, 'F', '0', '0', 'system:appeal: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('留言信息修改', @parentId, '3',  '#', '', 1, 0, 'F', '0', '0', 'system:appeal: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('留言信息删除', @parentId, '4',  '#', '', 1, 0, 'F', '0', '0', 'system:appeal: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('留言信息导出', @parentId, '5',  '#', '', 1, 0, 'F', '0', '0', 'system:appeal:export',       '#', 'admin', sysdate(), '', null, '');
