CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_config` (
	`config_id` int NOT NULL AUTO_INCREMENT COMMENT '参数主键',
	`config_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '参数名称',
	`config_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '参数键名',
	`config_value` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '参数键值',
	`config_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'N' COMMENT '系统内置（Y是 N否）',
	`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
	`create_time` datetime DEFAULT NULL COMMENT '创建时间',
	`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
	`update_time` datetime DEFAULT NULL COMMENT '更新时间',
	`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
	PRIMARY KEY USING BTREE (`config_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '参数配置表';

INSERT INTO `sys_config` VALUES (1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', '2023-06-05 10:42:00', '', NULL, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow');
INSERT INTO `sys_config` VALUES (2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', '2023-06-05 10:42:00', '', NULL, '初始化密码 123456');
INSERT INTO `sys_config` VALUES (3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', '2023-06-05 10:42:00', '', NULL, '深色主题theme-dark，浅色主题theme-light');
INSERT INTO `sys_config` VALUES (4, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 'admin', '2023-06-05 10:42:00', '', NULL, '是否开启注册用户功能（true开启，false关闭）');
INSERT INTO `sys_config` VALUES (5, '用户登录-黑名单列表', 'sys.login.blackIPList', '', 'Y', 'admin', '2023-06-05 10:42:00', '', NULL, '设置登录IP黑名单限制，多个匹配项以;分隔，支持匹配（*通配、网段）');
INSERT INTO `sys_config` VALUES (6, '现金积分比例（兑换商品）', 'sys.cash.ratio', '100', 'Y', 'admin', NULL, '18224358736', '2025-05-29 17:52:29', '1元等于100个积分');
INSERT INTO `sys_config` VALUES (7, '客服电话', 'sys.service.phone', '19912345678;19987654321', 'Y', '', NULL, '', NULL, '系统客服电话，多个用分号隔开');
INSERT INTO `sys_config` VALUES (8, '现金积分比例（充值）', 'sys.point.ratio', '10', 'Y', 'admin', '2025-04-18 17:28:40', '18224358736', '2025-05-29 17:52:29', '1元等于100个积分');
INSERT INTO `sys_config` VALUES (9, '积分管理-是否开启转赠积分', 'sys.point.isTransferable', 'true', 'Y', '', NULL, '', NULL, '是否开启积分转赠功能(true开启,false关闭)');

CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_dept` (
	`dept_id` bigint NOT NULL AUTO_INCREMENT COMMENT '部门id',
	`parent_id` bigint DEFAULT '0' COMMENT '父部门id',
	`ancestors` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '祖级列表',
	`dept_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '部门名称',
	`order_num` int DEFAULT '0' COMMENT '显示顺序',
	`leader` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '负责人',
	`phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '联系电话',
	`email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '邮箱',
	`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '部门状态（0正常 1停用）',
	`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志（0代表存在 2代表删除）',
	`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
	`create_time` datetime DEFAULT NULL COMMENT '创建时间',
	`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
	`update_time` datetime DEFAULT NULL COMMENT '更新时间',
	`shop_id` int DEFAULT NULL COMMENT '门店id',
	PRIMARY KEY USING BTREE (`dept_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 110 CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '部门表';

INSERT INTO `sys_dept` VALUES (100, 0, '0', '总部', 0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2023-06-05 10:41:59', 'admin', '2025-01-16 18:14:29', NULL);
INSERT INTO `sys_dept` VALUES (101, 100, '0,100', '深圳市场', 1, '若依', '15888888888', 'ry@qq.com', '0', '2', 'admin', '2023-06-05 10:41:59', 'admin', '2025-02-21 21:27:46', NULL);
INSERT INTO `sys_dept` VALUES (102, 100, '0,100', '长沙分公司', 2, '若依', '15888888888', 'ry@qq.com', '0', '2', 'admin', '2023-06-05 10:41:59', '', NULL, NULL);
INSERT INTO `sys_dept` VALUES (103, 101, '0,100,101', '研发部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '2', 'admin', '2023-06-05 10:41:59', '', NULL, NULL);
INSERT INTO `sys_dept` VALUES (104, 101, '0,100,101', '市场部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '2', 'admin', '2023-06-05 10:41:59', '', NULL, NULL);
INSERT INTO `sys_dept` VALUES (105, 101, '0,100,101', '测试部门', 3, '若依', '15888888888', 'ry@qq.com', '0', '2', 'admin', '2023-06-05 10:41:59', '', NULL, NULL);
INSERT INTO `sys_dept` VALUES (106, 101, '0,100,101', '财务部门', 4, '若依', '15888888888', 'ry@qq.com', '0', '2', 'admin', '2023-06-05 10:41:59', '', NULL, NULL);
INSERT INTO `sys_dept` VALUES (107, 101, '0,100,101', '运维部门', 5, '若依', '15888888888', 'ry@qq.com', '0', '2', 'admin', '2023-06-05 10:41:59', 'admin', '2025-01-02 13:43:59', NULL);
INSERT INTO `sys_dept` VALUES (108, 102, '0,100,102', '市场部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '2', 'admin', '2023-06-05 10:41:59', '', NULL, NULL);
INSERT INTO `sys_dept` VALUES (109, 102, '0,100,102', '财务部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '2', 'admin', '2023-06-05 10:41:59', '', NULL, NULL);
INSERT INTO `sys_dept` VALUES (110, 0, '', '运营部-双流1', 0, NULL, NULL, NULL, '0', '2', '13540218174', '2025-01-03 14:27:50', '13540218174', '2025-01-03 14:28:21', 25);
INSERT INTO `sys_dept` VALUES (111, 0, '', '财务', 0, NULL, NULL, NULL, '0', '2', '13540218174', '2025-01-03 14:28:28', '', NULL, 25);
INSERT INTO `sys_dept` VALUES (112, 0, '', 'a部门', 0, NULL, NULL, NULL, '0', '2', '18280405248', '2025-01-03 16:15:15', '', NULL, 9);
INSERT INTO `sys_dept` VALUES (113, 0, '', '四川岐济生生物科技有限公司', 0, NULL, NULL, NULL, '0', '2', 'admin', '2025-01-04 11:34:09', 'admin', '2025-02-21 21:24:37', NULL);
INSERT INTO `sys_dept` VALUES (114, 0, '', '财务部门', 0, NULL, NULL, NULL, '0', '2', '13540242980', '2025-01-04 14:02:34', '', NULL, 8);
INSERT INTO `sys_dept` VALUES (115, 0, '', '工程部', 0, NULL, NULL, NULL, '0', '2', '15828353127', '2025-01-07 10:07:54', '', NULL, 23);
INSERT INTO `sys_dept` VALUES (116, 0, '', '华阳店-运营部', 0, NULL, NULL, NULL, '0', '2', '18408280894', '2025-01-09 10:14:11', '', NULL, 35);
INSERT INTO `sys_dept` VALUES (117, 0, '', '开发部', 0, NULL, NULL, NULL, '0', '0', '18408280894', '2025-01-09 10:16:47', '18224358736', '2025-05-06 14:37:47', 35);
INSERT INTO `sys_dept` VALUES (118, 0, '', '部门1', 0, NULL, NULL, NULL, '0', '2', '15210183859', '2025-01-10 14:27:38', '', NULL, 28);
INSERT INTO `sys_dept` VALUES (119, 0, '', '部门2', 0, NULL, NULL, NULL, '0', '2', '15210183859', '2025-01-10 14:27:43', '', NULL, 28);
INSERT INTO `sys_dept` VALUES (120, 0, '', '部门3', 0, NULL, NULL, NULL, '0', '2', '15210183859', '2025-01-10 14:27:47', '', NULL, 28);
INSERT INTO `sys_dept` VALUES (121, 0, '', '财务部', 0, NULL, NULL, NULL, '0', '2', '18280405248', '2025-01-12 15:50:31', '18224358736', '2025-05-06 14:37:56', 33);
INSERT INTO `sys_dept` VALUES (122, 0, '', '运营部康复', 0, NULL, NULL, NULL, '0', '2', '13540218174', '2025-01-14 14:27:01', '13540218174', '2025-01-17 11:05:05', 50);
INSERT INTO `sys_dept` VALUES (123, 0, '', '秘书部', 0, NULL, NULL, NULL, '0', '2', '18482186931', '2025-01-14 15:28:34', '', NULL, 51);
INSERT INTO `sys_dept` VALUES (124, 0, '', '测试部', 0, NULL, NULL, NULL, '0', '2', '17780483325', '2025-01-14 20:01:12', '18224358736', '2025-05-06 14:37:59', 64);
INSERT INTO `sys_dept` VALUES (125, 0, '', '测试部', 0, NULL, NULL, NULL, '0', '2', '17780483325', '2025-01-14 20:16:16', '', NULL, 64);
INSERT INTO `sys_dept` VALUES (126, 0, '', '运维部门', 0, NULL, NULL, NULL, '0', '2', '18280405248', '2025-01-15 09:16:44', '', NULL, 55);
INSERT INTO `sys_dept` VALUES (127, 0, '', 'dd', 0, NULL, NULL, NULL, '0', '2', 'admin', '2025-01-15 17:25:48', '', NULL, NULL);
INSERT INTO `sys_dept` VALUES (128, 0, '', '巧部门', 0, NULL, NULL, NULL, '0', '2', '18683812118', '2025-01-16 20:06:43', '', NULL, 71);
INSERT INTO `sys_dept` VALUES (129, 0, '', '112', 0, NULL, NULL, NULL, '0', '2', 'admin', '2025-01-17 15:20:23', 'admin', '2025-01-17 15:20:28', NULL);
INSERT INTO `sys_dept` VALUES (130, 0, '', '1', 0, NULL, NULL, NULL, '0', '2', 'admin', '2025-01-17 15:20:33', '', NULL, NULL);
INSERT INTO `sys_dept` VALUES (131, 0, '', '1', 0, NULL, NULL, NULL, '0', '2', 'admin', '2025-01-18 09:35:22', '', NULL, NULL);
INSERT INTO `sys_dept` VALUES (132, 0, '', '广东市场', 0, NULL, NULL, NULL, '0', '2', 'admin', '2025-02-10 10:43:28', '', NULL, NULL);
INSERT INTO `sys_dept` VALUES (133, 0, '', '大苏打萨达', 0, NULL, NULL, NULL, '0', '2', 'admin', '2025-02-16 15:35:30', '', NULL, NULL);
INSERT INTO `sys_dept` VALUES (134, 0, '', '大撒大撒', 0, NULL, NULL, NULL, '0', '2', 'admin', '2025-02-16 15:35:49', '', NULL, NULL);
INSERT INTO `sys_dept` VALUES (135, 0, '', '公司', 0, NULL, NULL, NULL, '0', '2', '13688133551', '2025-02-23 18:08:44', '', NULL, 80);
INSERT INTO `sys_dept` VALUES (136, 0, '', '技术服务部', 0, NULL, NULL, NULL, '0', '2', '13688133551', '2025-02-23 18:09:03', '', NULL, 80);
INSERT INTO `sys_dept` VALUES (137, 0, '', '后勤管理部', 0, NULL, NULL, NULL, '0', '2', '13688133551', '2025-02-23 18:09:19', '', NULL, 80);
INSERT INTO `sys_dept` VALUES (138, 0, '', '阿斯顿倒萨阿斯顿倒萨阿斯顿倒萨阿斯顿倒萨阿斯顿倒萨阿斯顿倒萨', 0, NULL, NULL, NULL, '0', '2', 'admin', '2025-02-27 19:40:00', '', NULL, NULL);

CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_dict_data` (
	`dict_code` bigint NOT NULL AUTO_INCREMENT COMMENT '字典编码',
	`dict_sort` int DEFAULT '0' COMMENT '字典排序',
	`dict_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '字典标签',
	`dict_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '字典键值',
	`dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '字典类型',
	`css_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '样式属性（其他样式扩展）',
	`list_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '表格回显样式',
	`is_default` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'N' COMMENT '是否默认（Y是 N否）',
	`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '状态（0正常 1停用）',
	`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
	`create_time` datetime DEFAULT NULL COMMENT '创建时间',
	`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
	`update_time` datetime DEFAULT NULL COMMENT '更新时间',
	`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
	PRIMARY KEY USING BTREE (`dict_code`)
) ENGINE = InnoDB AUTO_INCREMENT = 30 CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '字典数据表';


INSERT INTO `sys_dict_data` VALUES (1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '性别男');
INSERT INTO `sys_dict_data` VALUES (2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '性别女');
INSERT INTO `sys_dict_data` VALUES (3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '性别未知');
INSERT INTO `sys_dict_data` VALUES (4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '显示菜单');
INSERT INTO `sys_dict_data` VALUES (5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '隐藏菜单');
INSERT INTO `sys_dict_data` VALUES (6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '正常状态');
INSERT INTO `sys_dict_data` VALUES (7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '停用状态');
INSERT INTO `sys_dict_data` VALUES (8, 1, '正常', '0', 'sys_job_status', '', 'primary', 'Y', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '正常状态');
INSERT INTO `sys_dict_data` VALUES (9, 2, '暂停', '1', 'sys_job_status', '', 'danger', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '停用状态');
INSERT INTO `sys_dict_data` VALUES (10, 1, '默认', 'DEFAULT', 'sys_job_group', '', '', 'Y', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '默认分组');
INSERT INTO `sys_dict_data` VALUES (11, 2, '系统', 'SYSTEM', 'sys_job_group', '', '', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '系统分组');
INSERT INTO `sys_dict_data` VALUES (12, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '系统默认是');
INSERT INTO `sys_dict_data` VALUES (13, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '系统默认否');
INSERT INTO `sys_dict_data` VALUES (14, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '通知');
INSERT INTO `sys_dict_data` VALUES (15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '公告');
INSERT INTO `sys_dict_data` VALUES (16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '正常状态');
INSERT INTO `sys_dict_data` VALUES (17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '关闭状态');
INSERT INTO `sys_dict_data` VALUES (18, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '其他操作');
INSERT INTO `sys_dict_data` VALUES (19, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '新增操作');
INSERT INTO `sys_dict_data` VALUES (20, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '修改操作');
INSERT INTO `sys_dict_data` VALUES (21, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '删除操作');
INSERT INTO `sys_dict_data` VALUES (22, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '授权操作');
INSERT INTO `sys_dict_data` VALUES (23, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '导出操作');
INSERT INTO `sys_dict_data` VALUES (24, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '导入操作');
INSERT INTO `sys_dict_data` VALUES (25, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '强退操作');
INSERT INTO `sys_dict_data` VALUES (26, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '生成操作');
INSERT INTO `sys_dict_data` VALUES (27, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '清空操作');
INSERT INTO `sys_dict_data` VALUES (28, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '正常状态');
INSERT INTO `sys_dict_data` VALUES (29, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '停用状态');


CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_dict_type` (
	`dict_id` bigint NOT NULL AUTO_INCREMENT COMMENT '字典主键',
	`dict_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '字典名称',
	`dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '字典类型',
	`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '状态（0正常 1停用）',
	`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
	`create_time` datetime DEFAULT NULL COMMENT '创建时间',
	`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
	`update_time` datetime DEFAULT NULL COMMENT '更新时间',
	`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
	PRIMARY KEY USING BTREE (`dict_id`),
	UNIQUE KEY `dict_type` USING BTREE (`dict_type`)
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '字典类型表';

INSERT INTO `sys_dict_type` VALUES (1, '用户性别', 'sys_user_sex', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '用户性别列表');
INSERT INTO `sys_dict_type` VALUES (2, '菜单状态', 'sys_show_hide', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '菜单状态列表');
INSERT INTO `sys_dict_type` VALUES (3, '系统开关', 'sys_normal_disable', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '系统开关列表');
INSERT INTO `sys_dict_type` VALUES (4, '任务状态', 'sys_job_status', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '任务状态列表');
INSERT INTO `sys_dict_type` VALUES (5, '任务分组', 'sys_job_group', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '任务分组列表');
INSERT INTO `sys_dict_type` VALUES (6, '系统是否', 'sys_yes_no', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '系统是否列表');
INSERT INTO `sys_dict_type` VALUES (7, '通知类型', 'sys_notice_type', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '通知类型列表');
INSERT INTO `sys_dict_type` VALUES (8, '通知状态', 'sys_notice_status', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '通知状态列表');
INSERT INTO `sys_dict_type` VALUES (9, '操作类型', 'sys_oper_type', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '操作类型列表');
INSERT INTO `sys_dict_type` VALUES (10, '系统状态', 'sys_common_status', '0', 'admin', '2023-06-05 10:42:00', '', NULL, '登录状态列表');

CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_job` (
	`job_id` bigint NOT NULL AUTO_INCREMENT COMMENT '任务ID',
	`job_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '任务名称',
	`job_group` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'DEFAULT' COMMENT '任务组名',
	`invoke_target` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '调用目标字符串',
	`cron_expression` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'cron执行表达式',
	`misfire_policy` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '3' COMMENT '计划执行错误策略（1立即执行 2执行一次 3放弃执行）',
	`concurrent` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '1' COMMENT '是否并发执行（0允许 1禁止）',
	`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '状态（0正常 1暂停）',
	`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
	`create_time` datetime DEFAULT NULL COMMENT '创建时间',
	`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
	`update_time` datetime DEFAULT NULL COMMENT '更新时间',
	`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注信息',
	PRIMARY KEY USING BTREE (`job_id`, `job_name`, `job_group`)
) ENGINE = InnoDB CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '定时任务调度表';

CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_job_log` (
	`job_log_id` bigint NOT NULL AUTO_INCREMENT COMMENT '任务日志ID',
	`job_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务名称',
	`job_group` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务组名',
	`invoke_target` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '调用目标字符串',
	`job_message` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '日志信息',
	`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '执行状态（0正常 1失败）',
	`exception_info` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '异常信息',
	`create_time` datetime DEFAULT NULL COMMENT '创建时间',
	PRIMARY KEY USING BTREE (`job_log_id`)
) ENGINE = InnoDB CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '定时任务调度日志表';
CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_login_log` (
	`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
	`user_id` int DEFAULT NULL COMMENT '用户id',
	`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '登录账号',
	`ip_address` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '登录IP地址',
	`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '登录地址',
	`browser_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '浏览器类型',
	`operating_system` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '操作系统',
	`login_time` datetime DEFAULT NULL COMMENT '登录时间',
	`login_status` int DEFAULT NULL COMMENT '登录状态（1=成功，2=失败）',
	`message` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '提示消息',
	`create_time` datetime DEFAULT NULL COMMENT '添加时间',
	`del_flag` int DEFAULT NULL COMMENT '删除状态（0=否，1=是）',
	PRIMARY KEY USING BTREE (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 463 CHARSET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = DYNAMIC COMMENT '登录日志';

CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_menu` (
	`menu_id` bigint NOT NULL AUTO_INCREMENT COMMENT '菜单ID',
	`menu_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '菜单名称',
	`parent_id` bigint DEFAULT '0' COMMENT '父菜单ID',
	`order_num` int DEFAULT '0' COMMENT '显示顺序',
	`path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '路由地址',
	`component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '组件路径',
	`query` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '路由参数',
	`is_frame` int DEFAULT '1' COMMENT '是否为外链（0是 1否）',
	`is_cache` int DEFAULT '0' COMMENT '是否缓存（0缓存 1不缓存）',
	`menu_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '菜单类型（M目录 C菜单 F按钮）',
	`visible` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '菜单状态（0显示 1隐藏）',
	`status` tinyint(1) DEFAULT '0' COMMENT '菜单状态（0正常 1停用）',
	`perms` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '权限标识',
	`icon` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '#' COMMENT '菜单图标',
	`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
	`create_time` datetime DEFAULT NULL COMMENT '创建时间',
	`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
	`update_time` datetime DEFAULT NULL COMMENT '更新时间',
	`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
	`role_type` int DEFAULT NULL COMMENT '数据类型（1=平台，2=门店）',
	PRIMARY KEY USING BTREE (`menu_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 286 CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '菜单权限表';


INSERT INTO `sys_menu` VALUES (1, '首页统计', 0, 1, '/homeStatistics', NULL, NULL, 1, 0, 'M', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (231, '工作台', 1, 1, '/homeStatistics/storeStatistics', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (235, '系统管理', 0, 2, '/systemManagement', NULL, NULL, 1, 0, 'M', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (236, '部门管理', 235, 1, '/systemManagement/departmentManagement', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (237, '权限管理', 235, 2, '/systemManagement/authorityManagement', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (238, '账号管理', 235, 3, '/systemManagement/accountManagement', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (239, '协议管理', 235, 4, '/systemManagement/protocolManagement', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (240, '客服电话', 235, 5, '/systemManagement/serviceTel', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (241, '广告管理', 0, 3, '/advertisingManagement', NULL, NULL, 1, 0, 'M', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (242, '启动页管理', 241, 1, '/advertisingManagement/startupPageManagement', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (243, '首页配置', 241, 2, '/advertisingManagement/homePageConfiguration', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (244, 'banner管理', 241, 3, '/advertisingManagement/bannerManagement', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (247, '用户管理', 0, 4, '/userManagement', NULL, NULL, 1, 0, 'M', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (250, '用户管理', 247, 3, '/userManagement/userManagement', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (253, '注销记录', 247, 6, '/userManagement/cancellationRecord', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (258, '商品管理', 0, 5, '/goodsManagement', NULL, NULL, 1, 0, 'M', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (259, '商品分类管理', 258, 1, '/goodsManagement/commodityClassificationManagement', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (260, '商品管理', 258, 2, '/goodsManagement/goodsManagement', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (261, '评价管理', 258, 3, '/goodsManagement/evaluationManagement', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (264, '活动管理', 0, 6, '/activityManagement', NULL, NULL, 1, 0, 'M', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (269, '秒杀活动', 264, 5, '/activityManagement/secondKill', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (270, '店铺管理', 0, 7, '/shopManagement', NULL, NULL, 1, 0, 'M', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (271, '店铺管理', 270, 1, '/shopManagement/shopManagement', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (272, '店铺入驻审核', 270, 2, '/store/withdrawal', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (273, '积分管理', 0, 8, '/pointManagement', NULL, NULL, 1, 0, 'M', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (274, '积分配置', 273, 1, '/pointManagement/integralAllocation', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (277, '订单管理', 0, 9, '/orderManagement', NULL, NULL, 1, 0, 'M', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (278, '订单管理', 277, 1, '/orderManagement/orderManagement', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (279, '提现申请', 277, 2, '/orderManage/withdraw', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (280, '财务统计', 0, 10, '/financialStatistics', NULL, NULL, 1, 0, 'M', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (281, '用户积分统计', 280, 1, '/financialStatistics/userPointsStatistics', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (282, '店铺余额汇总', 280, 2, '/financialStatistics/storebalance', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (283, '用户积分汇总', 280, 3, '/financialStatistics/userIntegral', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);
INSERT INTO `sys_menu` VALUES (313, '充电订单', 277, 3, '/orderManage/charging', NULL, NULL, 1, 0, 'C', '0', 0, NULL, '#', '', NULL, '', NULL, '', 1);

CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_notice` (
	`notice_id` int NOT NULL AUTO_INCREMENT COMMENT '公告ID',
	`notice_title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公告标题',
	`notice_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公告类型（1通知 2公告）',
	`notice_content` longblob COMMENT '公告内容',
	`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '公告状态（0正常 1关闭）',
	`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
	`create_time` datetime DEFAULT NULL COMMENT '创建时间',
	`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
	`update_time` datetime DEFAULT NULL COMMENT '更新时间',
	`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
	PRIMARY KEY USING BTREE (`notice_id`)
) ENGINE = InnoDB CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '通知公告表';

CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_oper_log` (
	`oper_id` bigint NOT NULL AUTO_INCREMENT COMMENT '日志主键',
	`title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '模块标题',
	`business_type` int DEFAULT '0' COMMENT '业务类型（0其它 1新增 2修改 3删除）',
	`method` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '方法名称',
	`request_method` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '请求方式',
	`operator_type` int DEFAULT '0' COMMENT '操作类别（0其它 1后台用户 2手机端用户）',
	`oper_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '操作人员',
	`dept_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '部门名称',
	`oper_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '请求URL',
	`oper_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '主机地址',
	`oper_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '操作地点',
	`oper_param` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '请求参数',
	`json_result` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '返回参数',
	`status` int DEFAULT '0' COMMENT '操作状态（0正常 1异常）',
	`error_msg` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '错误消息',
	`oper_time` datetime DEFAULT NULL COMMENT '操作时间',
	`cost_time` bigint DEFAULT '0' COMMENT '消耗时间',
	PRIMARY KEY USING BTREE (`oper_id`),
	KEY `idx_sys_oper_log_bt` USING BTREE (`business_type`),
	KEY `idx_sys_oper_log_s` USING BTREE (`status`),
	KEY `idx_sys_oper_log_ot` USING BTREE (`oper_time`)
) ENGINE = InnoDB CHARSET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = DYNAMIC COMMENT '操作日志记录';

CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_post` (
	`post_id` bigint NOT NULL AUTO_INCREMENT COMMENT '岗位ID',
	`post_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位编码',
	`post_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位名称',
	`post_sort` int NOT NULL COMMENT '显示顺序',
	`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '状态（0正常 1停用）',
	`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
	`create_time` datetime DEFAULT NULL COMMENT '创建时间',
	`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
	`update_time` datetime DEFAULT NULL COMMENT '更新时间',
	`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
	PRIMARY KEY USING BTREE (`post_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '岗位信息表';
INSERT INTO `sys_post` VALUES (1, 'ceo', '董事长', 1, '0', 'admin', '2023-06-05 10:41:59', '', NULL, '');
INSERT INTO `sys_post` VALUES (2, 'se', '项目经理', 2, '0', 'admin', '2023-06-05 10:41:59', '', NULL, '');
INSERT INTO `sys_post` VALUES (3, 'hr', '人力资源', 3, '0', 'admin', '2023-06-05 10:41:59', '', NULL, '');
INSERT INTO `sys_post` VALUES (4, 'user', '普通员工', 4, '0', 'admin', '2023-06-05 10:41:59', '', NULL, '');

CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_role` (
	`role_id` bigint NOT NULL AUTO_INCREMENT COMMENT '角色ID',
	`role_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名称',
	`role_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '角色权限字符串',
	`data_scope` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '1' COMMENT '数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）',
	`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '角色状态（0正常 1停用）',
	`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志（0代表存在 2代表删除）',
	`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
	`create_time` datetime DEFAULT NULL COMMENT '创建时间',
	`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
	`update_time` datetime DEFAULT NULL COMMENT '更新时间',
	`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
	`shop_id` int DEFAULT NULL COMMENT '门店id',
	PRIMARY KEY USING BTREE (`role_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 59 CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '角色信息表';

INSERT INTO `sys_role` VALUES (1, '超级管理员', 'admin', '1', '0', '0', 'admin', NULL, '', NULL, '超级管理员', NULL);
INSERT INTO `sys_role` VALUES (89, '测试', '0', '1', '0', '2', '19923261698', '2025-04-17 16:43:12', '19923261698', '2025-04-17 17:11:08', 'xxxx', NULL);
INSERT INTO `sys_role` VALUES (90, '测试角色', '0', '1', '0', '2', '19923261698', '2025-04-17 17:16:10', '', NULL, 'xxx', NULL);
INSERT INTO `sys_role` VALUES (91, '财务', '0', '1', '0', '0', '18224358736', '2025-05-06 14:39:23', '18224358736', '2025-06-11 09:48:40', NULL, NULL);

CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_role_dept` (
	`role_id` bigint NOT NULL COMMENT '角色ID',
	`dept_id` bigint NOT NULL COMMENT '部门ID',
	PRIMARY KEY USING BTREE (`role_id`, `dept_id`)
) ENGINE = InnoDB CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '角色和部门关联表';

CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_role_menu` (
	`role_id` bigint NOT NULL COMMENT '角色ID',
	`menu_id` bigint NOT NULL COMMENT '菜单ID',
	PRIMARY KEY USING BTREE (`role_id`, `menu_id`)
) ENGINE = InnoDB CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '角色和菜单关联表';
INSERT INTO `sys_role_menu` VALUES (1, 1);
INSERT INTO `sys_role_menu` VALUES (1, 231);
INSERT INTO `sys_role_menu` VALUES (1, 235);
INSERT INTO `sys_role_menu` VALUES (1, 236);
INSERT INTO `sys_role_menu` VALUES (1, 237);
INSERT INTO `sys_role_menu` VALUES (1, 238);
INSERT INTO `sys_role_menu` VALUES (1, 239);
INSERT INTO `sys_role_menu` VALUES (1, 240);
INSERT INTO `sys_role_menu` VALUES (1, 241);
INSERT INTO `sys_role_menu` VALUES (1, 242);
INSERT INTO `sys_role_menu` VALUES (1, 243);
INSERT INTO `sys_role_menu` VALUES (1, 244);
INSERT INTO `sys_role_menu` VALUES (1, 247);
INSERT INTO `sys_role_menu` VALUES (1, 250);
INSERT INTO `sys_role_menu` VALUES (1, 253);
INSERT INTO `sys_role_menu` VALUES (1, 258);
INSERT INTO `sys_role_menu` VALUES (1, 259);
INSERT INTO `sys_role_menu` VALUES (1, 260);
INSERT INTO `sys_role_menu` VALUES (1, 261);
INSERT INTO `sys_role_menu` VALUES (1, 264);
INSERT INTO `sys_role_menu` VALUES (1, 269);
INSERT INTO `sys_role_menu` VALUES (1, 270);
INSERT INTO `sys_role_menu` VALUES (1, 271);
INSERT INTO `sys_role_menu` VALUES (1, 272);
INSERT INTO `sys_role_menu` VALUES (1, 273);
INSERT INTO `sys_role_menu` VALUES (1, 274);
INSERT INTO `sys_role_menu` VALUES (1, 277);
INSERT INTO `sys_role_menu` VALUES (1, 278);
INSERT INTO `sys_role_menu` VALUES (1, 279);
INSERT INTO `sys_role_menu` VALUES (1, 280);
INSERT INTO `sys_role_menu` VALUES (1, 281);
INSERT INTO `sys_role_menu` VALUES (1, 282);
INSERT INTO `sys_role_menu` VALUES (1, 283);
INSERT INTO `sys_role_menu` VALUES (1, 313);
INSERT INTO `sys_role_menu` VALUES (91, 1);
INSERT INTO `sys_role_menu` VALUES (91, 231);
INSERT INTO `sys_role_menu` VALUES (91, 235);
INSERT INTO `sys_role_menu` VALUES (91, 236);
INSERT INTO `sys_role_menu` VALUES (91, 237);
INSERT INTO `sys_role_menu` VALUES (91, 238);
INSERT INTO `sys_role_menu` VALUES (91, 239);
INSERT INTO `sys_role_menu` VALUES (91, 240);
INSERT INTO `sys_role_menu` VALUES (91, 241);
INSERT INTO `sys_role_menu` VALUES (91, 242);
INSERT INTO `sys_role_menu` VALUES (91, 243);
INSERT INTO `sys_role_menu` VALUES (91, 244);
INSERT INTO `sys_role_menu` VALUES (91, 247);
INSERT INTO `sys_role_menu` VALUES (91, 250);
INSERT INTO `sys_role_menu` VALUES (91, 253);
INSERT INTO `sys_role_menu` VALUES (91, 258);
INSERT INTO `sys_role_menu` VALUES (91, 259);
INSERT INTO `sys_role_menu` VALUES (91, 260);
INSERT INTO `sys_role_menu` VALUES (91, 261);
INSERT INTO `sys_role_menu` VALUES (91, 264);
INSERT INTO `sys_role_menu` VALUES (91, 269);
INSERT INTO `sys_role_menu` VALUES (91, 270);
INSERT INTO `sys_role_menu` VALUES (91, 271);
INSERT INTO `sys_role_menu` VALUES (91, 272);
INSERT INTO `sys_role_menu` VALUES (91, 273);
INSERT INTO `sys_role_menu` VALUES (91, 274);
INSERT INTO `sys_role_menu` VALUES (91, 277);
INSERT INTO `sys_role_menu` VALUES (91, 278);
INSERT INTO `sys_role_menu` VALUES (91, 279);
INSERT INTO `sys_role_menu` VALUES (91, 280);
INSERT INTO `sys_role_menu` VALUES (91, 281);
INSERT INTO `sys_role_menu` VALUES (91, 282);
INSERT INTO `sys_role_menu` VALUES (91, 283);
INSERT INTO `sys_role_menu` VALUES (91, 313);
INSERT INTO `sys_role_menu` VALUES (91, 1061);
INSERT INTO `sys_role_menu` VALUES (91, 1062);
INSERT INTO `sys_role_menu` VALUES (91, 1065);
INSERT INTO `sys_role_menu` VALUES (91, 1073);
INSERT INTO `sys_role_menu` VALUES (91, 1161);
INSERT INTO `sys_role_menu` VALUES (91, 1203);
CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_user` (
	`user_id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户ID',
	`dept_id` bigint DEFAULT NULL COMMENT '部门ID',
	`user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户账号',
	`nick_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户昵称',
	`user_type` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '00' COMMENT '用户类型（00系统用户）',
	`email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '用户邮箱',
	`phonenumber` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '手机号码',
	`sex` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '用户性别（0男 1女 2未知）',
	`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '头像地址',
	`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '密码',
	`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '帐号状态（0正常 1停用）',
	`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志（0代表存在 2代表删除）',
	`login_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '最后登录IP',
	`login_date` datetime DEFAULT NULL COMMENT '最后登录时间',
	`role_type` int DEFAULT '1' COMMENT '角色类型 1=平台 2=门店',
	`passWordUpdate` datetime DEFAULT NULL COMMENT '密码修改时间',
	`objectId` int DEFAULT '1' COMMENT '对象ID',
	`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
	`create_time` datetime DEFAULT NULL COMMENT '创建时间',
	`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
	`update_time` datetime DEFAULT NULL COMMENT '更新时间',
	`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
	`forbidden_remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '禁用账户备注',
	`app_user_id` bigint DEFAULT NULL COMMENT '前端用户id',
	PRIMARY KEY USING BTREE (`user_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 49 CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '用户信息表';

INSERT INTO `sys_user` VALUES (1, 1, '19923261698', '胡立果', '00', '', '19923261698', '0', 'http://qijishenghuiyuan.obs.cn-southwest-2.myhuaweicloud.com/admin/aedfbbb41280471f8d9fa7905298b65f.png', '$2a$10$DWPje3LRma6N0haEINuZCOaaaeZ7d.nLxjDefNkoVkAWlQ3U/u23i', '0', '0', '', '2025-06-13 14:07:23', 1, NULL, 1, 'Admin', '2025-04-16 20:11:51', '19923261698', '2025-06-13 14:07:25', '超级管理员', NULL, NULL);
INSERT INTO `sys_user` VALUES (2, 117, '17760946884', '蒲', '00', '', '17760946884', '0', 'http://qijishenghuiyuan.obs.cn-southwest-2.myhuaweicloud.com/admin/aedfbbb41280471f8d9fa7905298b65f.png', '$2a$10$DWPje3LRma6N0haEINuZCOaaaeZ7d.nLxjDefNkoVkAWlQ3U/u23i', '0', '0', '', '2025-04-22 09:57:34', 1, NULL, 1, 'Admin', '2025-04-22 09:57:49', '18224358736', '2025-04-23 11:29:16', '超级管理员', NULL, NULL);
INSERT INTO `sys_user` VALUES (3, 117, '15708179461', '何', '00', '', '15708179461', '0', 'http://qijishenghuiyuan.obs.cn-southwest-2.myhuaweicloud.com/admin/aedfbbb41280471f8d9fa7905298b65f.png', '$2a$10$DWPje3LRma6N0haEINuZCOaaaeZ7d.nLxjDefNkoVkAWlQ3U/u23i', '0', '0', '', '2025-04-23 17:00:01', 1, NULL, 1, '', '2025-04-22 10:00:27', '18224358736', '2025-04-23 17:00:03', '超级管理员', NULL, NULL);
INSERT INTO `sys_user` VALUES (4, 117, '18224358736', '董', '00', '', '18224358736', '0', 'http://qijishenghuiyuan.obs.cn-southwest-2.myhuaweicloud.com/admin/aedfbbb41280471f8d9fa7905298b65f.png', '$2a$10$g56Cfv/Z.t9daRbPu79HY.rSXlTdUUcW6N4rZfXvO8rFHd0b9evFC', '0', '0', '', '2025-06-13 18:29:07', 1, NULL, 1, '', NULL, '18224358736', '2025-06-13 18:29:09', '超级管理员', NULL, NULL);
INSERT INTO `sys_user` VALUES (205, 100, '18408279100', '大段', '00', '', '18408279100', '0', '', '$2a$10$DWPje3LRma6N0haEINuZCOaaaeZ7d.nLxjDefNkoVkAWlQ3U/u23i', '0', '0', '', NULL, 1, NULL, 1, '18224358736', '2025-05-06 14:39:57', '', NULL, NULL, NULL, NULL);
INSERT INTO `sys_user` VALUES (206, 100, '17780483325', '小段', '00', '', '17780483325', '0', '', '$2a$10$7YcX7EDRTcFpLfKgH/vwO.pj3BN6klK2jOBjWH2gN7ObrRdmvmq3q', '0', '0', '', '2025-06-11 09:49:10', 1, NULL, 1, '18224358736', '2025-05-06 14:40:20', '18224358736', '2025-06-11 09:49:09', NULL, NULL, NULL);

CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_user_post` (
	`user_id` bigint NOT NULL COMMENT '用户ID',
	`post_id` bigint NOT NULL COMMENT '岗位ID',
	PRIMARY KEY USING BTREE (`user_id`, `post_id`)
) ENGINE = InnoDB CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '用户与岗位关联表';
INSERT INTO `sys_user_post` VALUES (1, 1);
CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`sys_user_role` (
	`user_id` bigint NOT NULL COMMENT '用户ID',
	`role_id` bigint NOT NULL COMMENT '角色ID',
	PRIMARY KEY USING BTREE (`user_id`, `role_id`)
) ENGINE = InnoDB CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT '用户和角色关联表';

INSERT INTO `sys_user_role` VALUES (1, 1);
INSERT INTO `sys_user_role` VALUES (2, 1);
INSERT INTO `sys_user_role` VALUES (3, 1);
INSERT INTO `sys_user_role` VALUES (4, 1);
INSERT INTO `sys_user_role` VALUES (205, 1);
INSERT INTO `sys_user_role` VALUES (206, 91);


CREATE TABLE IF NOT EXISTS `gy_jifenshangcheng_system`.`t_user_shop` (
	`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
	`user_id` int DEFAULT NULL COMMENT '用户id',
	`shop_id` int DEFAULT NULL COMMENT '门店id',
	`role_type` int DEFAULT NULL COMMENT '角色类型（1=店长，2=店员）',
	`role_id` int DEFAULT NULL COMMENT '角色id',
	`dept_id` bigint DEFAULT NULL COMMENT '部门ID',
	`nick_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户昵称',
	`create_time` datetime DEFAULT NULL COMMENT '创建时间',
	PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT '门店员工关系数据（后台）';


