/*
 Navicat Premium Data Transfer

 Source Server         : root@192.168.2.248-docker
 Source Server Type    : MySQL
 Source Server Version : 50744 (5.7.44)
 Source Host           : 192.168.2.248:3306
 Source Schema         : wfc_user_db

 Target Server Type    : MySQL
 Target Server Version : 50744 (5.7.44)
 File Encoding         : 65001

 Date: 24/12/2024 20:36:50
*/

CREATE DATABASE IF NOT EXISTS `wfc_user_db` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

USE wfc_user_db;

-- ----------------------------
-- Table structure for u_account
-- ----------------------------
DROP TABLE IF EXISTS `u_account`;
CREATE TABLE `u_account`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户ID',
  `balance` decimal(18, 4) NULL DEFAULT NULL COMMENT '余额',
  `balance_used` decimal(18, 4) NULL DEFAULT NULL COMMENT '余额已使用',
  `package_id` bigint(20) NULL DEFAULT NULL COMMENT '套餐ID',
  `start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',
  `end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',
  `traffic` bigint(20) NULL DEFAULT NULL COMMENT '流量',
  `traffic_used` bigint(20) NULL DEFAULT NULL COMMENT '流量已使用',
  `duration` bigint(20) NULL DEFAULT NULL COMMENT '时长',
  `duration_used` bigint(20) NULL DEFAULT NULL COMMENT '时长已使用',
  `client_num` int(11) NULL DEFAULT NULL COMMENT '在线设备数',
  `client_num_used` int(11) NULL DEFAULT NULL COMMENT '在线设备数已使用',
  `expired_time` datetime NULL DEFAULT NULL COMMENT '失效时间',
  `package_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '套餐名称',
  `period_num` int(11) NULL DEFAULT NULL COMMENT '有效期数',
  `period_type` tinyint(4) NULL DEFAULT NULL COMMENT '有效期类型',
  `price` decimal(18, 4) NULL DEFAULT NULL COMMENT '价格',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  `rate_limit_enable` tinyint(1) NULL DEFAULT 0 COMMENT '带宽是否限制',
  `traffic_enable` tinyint(1) NULL DEFAULT 0 COMMENT '流量是否限制',
  `duration_enable` tinyint(1) NULL DEFAULT 0 COMMENT '时长是否限制',
  `client_num_enable` tinyint(1) NULL DEFAULT 0 COMMENT '在线设备数是否限制',
  `rate_limit_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '限速名称',
  `down_limit` bigint(20) NULL DEFAULT NULL COMMENT '下行限速',
  `down_limit_enable` tinyint(1) NULL DEFAULT 0 COMMENT '下行限速启用',
  `up_limit` bigint(20) NULL DEFAULT NULL COMMENT '上行限速',
  `up_limit_enable` tinyint(1) NULL DEFAULT 0 COMMENT '上行限速启用',
  `del_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标志（0存在 1删除）',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台-账户表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of u_account
-- ----------------------------

-- ----------------------------
-- Table structure for u_account_package
-- ----------------------------
DROP TABLE IF EXISTS `u_account_package`;
CREATE TABLE `u_account_package`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `account_id` bigint(20) NULL DEFAULT NULL COMMENT '账户ID',
  `package_id` bigint(20) NULL DEFAULT NULL COMMENT '套餐ID',
  `traffic` bigint(20) NULL DEFAULT NULL COMMENT '流量',
  `duration` bigint(20) NULL DEFAULT NULL COMMENT '时长',
  `client_num` int(11) NULL DEFAULT NULL COMMENT '在线设备数',
  `expired_time` datetime NULL DEFAULT NULL COMMENT '失效时间',
  `package_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '套餐名称',
  `period_num` int(11) NULL DEFAULT NULL COMMENT '有效期数',
  `period_type` tinyint(4) NULL DEFAULT NULL COMMENT '有效期类型',
  `price` decimal(18, 4) NULL DEFAULT NULL COMMENT '价格',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  `rate_limit_enable` tinyint(1) NULL DEFAULT 0 COMMENT '带宽是否限制',
  `traffic_enable` tinyint(1) NULL DEFAULT 0 COMMENT '流量是否限制',
  `duration_enable` tinyint(1) NULL DEFAULT 0 COMMENT '时长是否限制',
  `client_num_enable` tinyint(1) NULL DEFAULT 0 COMMENT '在线设备数是否限制',
  `rate_limit_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '限速名称',
  `down_limit` bigint(20) NULL DEFAULT NULL COMMENT '下行限速',
  `down_limit_enable` tinyint(1) NULL DEFAULT 0 COMMENT '下行限速启用',
  `up_limit` bigint(20) NULL DEFAULT NULL COMMENT '上行限速',
  `up_limit_enable` tinyint(1) NULL DEFAULT 0 COMMENT '上行限速启用',
  `del_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标志（0存在 1删除）',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台-账户套餐表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of u_account_package
-- ----------------------------

-- ----------------------------
-- Table structure for u_balance
-- ----------------------------
DROP TABLE IF EXISTS `u_balance`;
CREATE TABLE `u_balance`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Service ID',
  `user_id` bigint(20) NULL DEFAULT NULL COMMENT 'User ID link to u_user',
  `balance` double NULL DEFAULT NULL COMMENT 'User charging money balance',
  `traffic_balance` bigint(20) NULL DEFAULT NULL COMMENT 'User traffic package balance',
  `status` enum('Normal','Shutdown','Arrears') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT 'Normal',
  `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT 'create name ',
  `create_time` datetime NULL DEFAULT NULL COMMENT 'create time',
  `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT 'update by name ',
  `update_time` datetime NULL DEFAULT NULL COMMENT 'update at time',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_user_id`(`user_id`) USING BTREE,
  CONSTRAINT `u_balance_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `u_user` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户平台_用户信息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of u_balance
-- ----------------------------

-- ----------------------------
-- Table structure for u_bill
-- ----------------------------
DROP TABLE IF EXISTS `u_bill`;
CREATE TABLE `u_bill`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户ID',
  `cdr_history_id` bigint(20) NULL DEFAULT NULL COMMENT '话单记录ID',
  `type` tinyint(4) NULL DEFAULT NULL COMMENT '类型',
  `amount` decimal(18, 4) NULL DEFAULT NULL COMMENT '金额',
  `status` tinyint(4) NULL DEFAULT NULL COMMENT '状态',
  `del_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标志（0存在 1删除）',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1876451063420497923 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户平台-账单表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for u_bill_rule
-- ----------------------------
DROP TABLE IF EXISTS `u_bill_rule`;
CREATE TABLE `u_bill_rule`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `price` decimal(18, 4) NULL DEFAULT NULL COMMENT '价格',
  `traffic` bigint(20) NULL DEFAULT NULL COMMENT '流量',
  `unit` tinyint(4) NULL DEFAULT NULL COMMENT '单位',
  `enable` tinyint(1) NULL DEFAULT NULL COMMENT '是否启用',
  `del_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标志（0存在 1删除）',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户平台-计费规则表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of u_bill_rule
-- ----------------------------
INSERT INTO `u_bill_rule` VALUES (1, 1.0000, 1, 2, 1, 0, NULL, NULL, 2, '2025-01-07 17:11:30');

-- ----------------------------
-- Table structure for u_cdr
-- ----------------------------
DROP TABLE IF EXISTS `u_cdr`;
CREATE TABLE `u_cdr`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'CDR ID',
  `user_id` bigint(20) NULL DEFAULT NULL COMMENT 'User ID link to u_user',
  `client_id` bigint(20) NULL DEFAULT NULL COMMENT 'Client ID',
  `device_id` bigint(20) NULL DEFAULT NULL COMMENT 'Device ID',
  `ssid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'Wireless SSID name ',
  `rx_rate` bigint(20) NULL DEFAULT NULL COMMENT 'tx rate ',
  `tx_rate` bigint(20) NULL DEFAULT NULL COMMENT 'tx rate',
  `down_packet` bigint(20) NULL DEFAULT NULL COMMENT 'Number of downstream packets.\n',
  `up_packet` bigint(20) NULL DEFAULT NULL COMMENT 'Number of upstream packets.	',
  `traffic_down` bigint(20) NULL DEFAULT NULL COMMENT 'Downstream traffic (Byte)',
  `traffic_up` bigint(20) NULL DEFAULT NULL COMMENT 'Upstream traffic (Byte)',
  `rate_limit_profile_id` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'Rate limit profile ID. ',
  `up_time` bigint(20) NULL DEFAULT NULL COMMENT 'Up time (unit: s).',
  `last_seen_time` bigint(20) NULL DEFAULT NULL COMMENT 'Last found time, timestamp (ms).	',
  `activity` bigint(20) NULL DEFAULT NULL COMMENT 'Activity download speed (Bytes/s)',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '0' COMMENT 'delete flag',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT 'creater',
  `create_time` datetime NULL DEFAULT NULL COMMENT 'create time',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT 'updater',
  `update_time` datetime NULL DEFAULT NULL COMMENT 'update time',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_user_id`(`user_id`) USING BTREE,
  INDEX `fk_client_id`(`client_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户平台_用户话单表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for u_cdr_detail
-- ----------------------------
DROP TABLE IF EXISTS `u_cdr_detail`;
CREATE TABLE `u_cdr_detail`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'CDR Detail ID',
  `cdr_id` bigint(20) NULL DEFAULT NULL COMMENT 'CDR ID',
  `traffic_down` bigint(20) NULL DEFAULT NULL COMMENT 'Downstream traffic (Byte)',
  `traffic_up` bigint(20) NULL DEFAULT NULL COMMENT 'Upstream traffic (Byte)',
  `start_time` datetime NULL DEFAULT NULL COMMENT 'Start time',
  `end_time` datetime NULL DEFAULT NULL COMMENT 'End time',
  `duration` bigint(20) NULL DEFAULT NULL COMMENT 'Duration(s)',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '0' COMMENT 'delete flag',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT 'creater',
  `create_time` datetime NULL DEFAULT NULL COMMENT 'create time',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT 'updater',
  `update_time` datetime NULL DEFAULT NULL COMMENT 'update time',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 50 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户平台_话单明细表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for u_cdr_history
-- ----------------------------
DROP TABLE IF EXISTS `u_cdr_history`;
CREATE TABLE `u_cdr_history`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'CDR Detail ID',
  `cdr_id` bigint(20) NULL DEFAULT NULL COMMENT 'CDR ID',
  `traffic_down` bigint(20) NULL DEFAULT NULL COMMENT 'Downstream traffic (Byte)',
  `traffic_up` bigint(20) NULL DEFAULT NULL COMMENT 'Upstream traffic (Byte)',
  `start_time` bigint(20) NULL DEFAULT NULL COMMENT 'Start time',
  `end_time` bigint(20) NULL DEFAULT NULL COMMENT 'End time',
  `duration` bigint(20) NULL DEFAULT NULL COMMENT 'Duration(s)',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '0' COMMENT 'delete flag',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT 'creater',
  `create_time` datetime NULL DEFAULT NULL COMMENT 'create time',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT 'updater',
  `update_time` datetime NULL DEFAULT NULL COMMENT 'update time',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户平台_话单历史表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of u_cdr_history
-- ----------------------------

-- ----------------------------
-- Table structure for u_client
-- ----------------------------
DROP TABLE IF EXISTS `u_client`;
CREATE TABLE `u_client`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Client ID',
  `user_id` bigint(20) NULL DEFAULT NULL COMMENT 'User ID link to u_user',
  `site_id` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Site ID',
  `client_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'Client Name',
  `client_device_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'Client device type',
  `client_mac` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'Client mac address',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '0' COMMENT 'delete flag',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT 'creater',
  `create_time` datetime NULL DEFAULT NULL COMMENT 'create time',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT 'updater',
  `update_time` datetime NULL DEFAULT NULL COMMENT 'update time',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_user_id`(`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 33 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户平台_用户设备表' ROW_FORMAT = DYNAMIC;

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

-- ----------------------------
-- Records of u_config
-- ----------------------------
INSERT INTO `u_config` VALUES (1, '用户管理-账号初始密码', 'user.initPassword', '123456', 'Y', 'admin', '2024-05-08 21:50:55', '', NULL, '初始化密码 123456');
INSERT INTO `u_config` VALUES (2, '账号自助-是否开启用户注册功能', 'user.register', 'true', 'Y', 'admin', '2024-05-08 21:50:55', '', NULL, '是否开启注册用户功能（true开启，false关闭）');
INSERT INTO `u_config` VALUES (3, '用户登录-黑名单列表', 'sys.login.blackIPList', '', 'Y', 'admin', '2024-05-08 21:50:55', '', NULL, '设置登录IP黑名单限制，多个匹配项以;分隔，支持匹配（*通配、网段）');

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

-- ----------------------------
-- Records of u_dept
-- ----------------------------
INSERT INTO `u_dept` VALUES (100, 0, '0', 'ROOT', 0, 'system', '123456', '123456@wfc.com', '0', '0', 'system', '2024-11-27 21:50:54', '', NULL, NULL);
INSERT INTO `u_dept` VALUES (101, 100, '0,100', 'No.1', 1, 'system', '123456', '123456@wfc.com', '0', '0', 'system', '2024-11-27 21:50:54', '', NULL, NULL);

-- ----------------------------
-- Table structure for u_device
-- ----------------------------
DROP TABLE IF EXISTS `u_device`;
CREATE TABLE `u_device`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Device ID',
  `user_id` bigint(20) NULL DEFAULT NULL COMMENT 'User ID link to u_user',
  `device_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'Device Name',
  `device_ip` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'Device ip',
  `device_mac` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'Device mac',
  `device_model` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'Device model',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '0' COMMENT 'delete flag',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT 'creater',
  `create_time` datetime NULL DEFAULT NULL COMMENT 'create time',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT 'updater',
  `update_time` datetime NULL DEFAULT NULL COMMENT 'update time',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_user_id`(`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户平台_AP设备表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of u_device
-- ----------------------------
INSERT INTO `u_device` VALUES (14, NULL, 'B0-19-21-7E-27-40', '192.168.2.207', 'B0-19-21-7E-27-40', 'EAP660 HD(US) v2.0', '0', NULL, '2024-12-10 10:05:19', NULL, '2024-12-10 10:05:19');
INSERT INTO `u_device` VALUES (15, NULL, 'B0-19-21-7E-25-B6', '192.168.2.192', 'B0-19-21-7E-25-B6', 'EAP660 HD(US) v2.0', '0', NULL, '2024-12-10 10:05:19', NULL, '2024-12-10 10:05:19');

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

-- ----------------------------
-- Records of u_dict_data
-- ----------------------------
INSERT INTO `u_dict_data` VALUES (1, 1, '男', '0', 'u_user_sex', '', '', 'Y', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '性别男');
INSERT INTO `u_dict_data` VALUES (2, 2, '女', '1', 'u_user_sex', '', '', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '性别女');
INSERT INTO `u_dict_data` VALUES (3, 3, '未知', '2', 'u_user_sex', '', '', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '性别未知');
INSERT INTO `u_dict_data` VALUES (4, 1, '显示', '0', 'u_show_hide', '', 'primary', 'Y', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '显示菜单');
INSERT INTO `u_dict_data` VALUES (5, 2, '隐藏', '1', 'u_show_hide', '', 'danger', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '隐藏菜单');
INSERT INTO `u_dict_data` VALUES (6, 1, '正常', '0', 'u_normal_disable', '', 'primary', 'Y', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '正常状态');
INSERT INTO `u_dict_data` VALUES (7, 2, '停用', '1', 'u_normal_disable', '', 'danger', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '停用状态');
INSERT INTO `u_dict_data` VALUES (8, 1, '是', 'Y', 'u_yes_no', '', 'primary', 'Y', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '系统默认是');
INSERT INTO `u_dict_data` VALUES (9, 2, '否', 'N', 'u_yes_no', '', 'danger', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '系统默认否');
INSERT INTO `u_dict_data` VALUES (10, 99, '其他', '0', 'u_oper_type', '', 'info', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '其他操作');
INSERT INTO `u_dict_data` VALUES (11, 1, '新增', '1', 'u_oper_type', '', 'info', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '新增操作');
INSERT INTO `u_dict_data` VALUES (12, 2, '修改', '2', 'u_oper_type', '', 'info', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '修改操作');
INSERT INTO `u_dict_data` VALUES (13, 3, '删除', '3', 'u_oper_type', '', 'danger', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '删除操作');
INSERT INTO `u_dict_data` VALUES (14, 4, '授权', '4', 'u_oper_type', '', 'primary', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '授权操作');
INSERT INTO `u_dict_data` VALUES (15, 5, '导出', '5', 'u_oper_type', '', 'warning', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '导出操作');
INSERT INTO `u_dict_data` VALUES (16, 6, '导入', '6', 'u_oper_type', '', 'warning', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '导入操作');
INSERT INTO `u_dict_data` VALUES (17, 7, '强退', '7', 'u_oper_type', '', 'danger', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '强退操作');
INSERT INTO `u_dict_data` VALUES (18, 8, '生成代码', '8', 'u_oper_type', '', 'warning', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '生成操作');
INSERT INTO `u_dict_data` VALUES (19, 9, '清空数据', '9', 'u_oper_type', '', 'danger', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '清空操作');
INSERT INTO `u_dict_data` VALUES (20, 1, '成功', '0', 'u_common_status', '', 'primary', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '正常状态');
INSERT INTO `u_dict_data` VALUES (21, 2, '失败', '1', 'u_common_status', '', 'danger', 'N', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '停用状态');

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

-- ----------------------------
-- Records of u_dict_type
-- ----------------------------
INSERT INTO `u_dict_type` VALUES (1, '用户性别', 'u_user_sex', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '用户性别列表');
INSERT INTO `u_dict_type` VALUES (2, '菜单状态', 'u_show_hide', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '菜单状态列表');
INSERT INTO `u_dict_type` VALUES (3, '系统开关', 'u_normal_disable', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '系统开关列表');
INSERT INTO `u_dict_type` VALUES (4, '系统是否', 'u_yes_no', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '系统是否列表');
INSERT INTO `u_dict_type` VALUES (5, '操作类型', 'u_oper_type', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '操作类型列表');
INSERT INTO `u_dict_type` VALUES (6, '系统状态', 'u_common_status', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '登录状态列表');

-- ----------------------------
-- Table structure for u_logininfor
-- ----------------------------
DROP TABLE IF EXISTS `u_logininfor`;
CREATE TABLE `u_logininfor`  (
  `info_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '访问ID',
  `user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户账号',
  `ipaddr` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '登录IP地址',
  `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '登录状态（0成功 1失败）',
  `msg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '提示信息',
  `access_time` datetime NULL DEFAULT NULL COMMENT '访问时间',
  PRIMARY KEY (`info_id`) USING BTREE,
  INDEX `idx_u_logininfor_s`(`status`) USING BTREE,
  INDEX `idx_u_logininfor_lt`(`access_time`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 76 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台_系统访问记录' ROW_FORMAT = DYNAMIC;

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

-- ----------------------------
-- Records of u_menu
-- ----------------------------
INSERT INTO `u_menu` VALUES (1, '系统管理', 0, 1000, '/manage', 'layout.base', '', 1, 0, 'M', '0', '0', '', 'carbon:cloud-service-management', 'admin', '2024-05-08 21:50:55', 'admin', '2024-12-02 16:45:58', '系统管理目录', 'manage');
INSERT INTO `u_menu` VALUES (100, '用户管理', 1, 1, '/manage/user', 'view.manage_user', '', 1, 0, 'C', '0', '0', '', 'ic:round-manage-accounts', 'admin', '2024-05-08 21:50:55', 'admin', '2024-05-12 23:50:31', '用户管理菜单', 'manage_user');
INSERT INTO `u_menu` VALUES (101, '角色管理', 1, 2, '/manage/role', 'view.manage_role', '', 1, 0, 'C', '0', '0', '', 'carbon:user-role', 'admin', '2024-05-08 21:50:55', '', NULL, '角色管理菜单', 'manage_role');
INSERT INTO `u_menu` VALUES (102, '菜单管理', 1, 3, '/manage/menu', 'view.manage_menu', '', 1, 0, 'C', '0', '0', '', 'material-symbols:route', 'admin', '2024-05-08 21:50:55', 'admin', '2024-05-12 23:46:12', '菜单管理菜单', 'manage_menu');
INSERT INTO `u_menu` VALUES (103, '部门管理', 1, 4, '/manage/dept', 'view.manage_dept', '', 1, 0, 'C', '0', '0', '', 'carbon:box', 'admin', '2024-05-08 21:50:55', 'ryadmin', '2024-05-30 23:17:41', '部门管理菜单', 'manage_dept');
INSERT INTO `u_menu` VALUES (104, '岗位管理', 1, 5, '/manage/post', 'view.manage_post', NULL, 1, 0, 'C', '0', '0', '', 'carbon:group', 'admin', '2024-06-02 22:18:48', '', NULL, '', 'manage_post');
INSERT INTO `u_menu` VALUES (105, '字典管理', 1, 6, '/manage/dict', 'view.manage_dict', NULL, 1, 0, 'C', '0', '0', '', 'carbon:volume-block-storage', 'admin', '2024-06-02 23:13:40', '', NULL, '', 'manage_dict');
INSERT INTO `u_menu` VALUES (1000, '用户查询', 100, 1, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1001, '用户新增', 100, 2, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1002, '用户修改', 100, 3, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1003, '用户删除', 100, 4, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1004, '用户导出', 100, 5, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1005, '用户导入', 100, 6, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1006, '重置密码', 100, 7, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1007, '角色查询', 101, 1, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1008, '角色新增', 101, 2, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1009, '角色修改', 101, 3, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1010, '角色删除', 101, 4, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1011, '角色导出', 101, 5, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1012, '菜单查询', 102, 1, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1013, '菜单新增', 102, 2, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1014, '菜单修改', 102, 3, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1015, '菜单删除', 102, 4, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1016, '部门查询', 103, 1, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1017, '部门新增', 103, 2, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1018, '部门修改', 103, 3, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1019, '部门删除', 103, 4, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1020, '岗位查询', 104, 1, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1021, '岗位新增', 104, 2, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1022, '岗位修改', 104, 3, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1023, '岗位删除', 104, 4, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1024, '岗位导出', 104, 5, '', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1025, '字典查询', 105, 1, '#', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1026, '字典新增', 105, 2, '#', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1027, '字典修改', 105, 3, '#', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1028, '字典删除', 105, 4, '#', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (1029, '字典导出', 105, 5, '#', '', '', 1, 0, 'F', '0', '0', '', '#', 'admin', '2024-05-08 21:50:55', '', NULL, '', NULL);
INSERT INTO `u_menu` VALUES (2000, '目录1', 0, 10, '/dir1', 'layout.base', '', 1, 0, 'M', '0', '1', '', 'carbon:cloud-service-management', 'admin', '2024-05-08 21:50:55', 'admin', '2024-05-12 23:46:57', '', '');
INSERT INTO `u_menu` VALUES (2001, '历史', 2000, 1, '/dir1/histories', 'view.set-meal_histories', '', 1, 0, 'C', '0', '1', '', 'ic:round-manage-accounts', 'admin', '2024-05-08 21:50:55', 'admin', '2024-11-29 17:23:36', '', '');
INSERT INTO `u_menu` VALUES (2010, '目录2', 0, 15, '/dir2', 'layout.base', NULL, 1, 1, 'M', '0', '1', '', 'carbon:account', 'admin', '2024-12-02 16:43:46', '', '2024-12-02 16:45:25', '', '');
INSERT INTO `u_menu` VALUES (2011, '当前', 2010, 1, '/dir2/access', 'view.dir2_access', '', 1, 0, 'C', '0', '1', '', 'ic:round-manage-accounts', 'admin', '2024-05-08 21:50:55', 'admin', '2024-11-29 17:23:36', '', '');
INSERT INTO `u_menu` VALUES (2012, '历史', 2010, 1, '/dir2/records', 'view.dir2_records', '', 1, 0, 'C', '0', '1', '', 'ic:round-manage-accounts', 'admin', '2024-05-08 21:50:55', 'admin', '2024-11-29 17:23:36', '', '');

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

-- ----------------------------
-- Records of u_oper_log
-- ----------------------------

-- ----------------------------
-- Table structure for u_order
-- ----------------------------
DROP TABLE IF EXISTS `u_order`;
CREATE TABLE `u_order`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户ID',
  `package_id` bigint(20) NULL DEFAULT NULL COMMENT '套餐ID',
  `payment_id` bigint(20) NULL DEFAULT NULL COMMENT '支付ID',
  `order_no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '订单编号',
  `type` tinyint(4) NULL DEFAULT NULL COMMENT '订单类型（0套餐 1充值）',
  `order_amount` decimal(18, 4) NULL DEFAULT NULL COMMENT '订单金额',
  `status` tinyint(4) NULL DEFAULT NULL COMMENT '订单状态(0待支付 1已支付 2已取消)',
  `del_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标志（0存在 1删除）',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台-订单表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of u_order
-- ----------------------------

-- ----------------------------
-- Table structure for u_package
-- ----------------------------
DROP TABLE IF EXISTS `u_package`;
CREATE TABLE `u_package`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `rate_limit_id` bigint(20) NULL DEFAULT NULL COMMENT '带宽限速ID',
  `package_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '套餐名称',
  `period_num` int(11) NULL DEFAULT NULL COMMENT '有效期数',
  `period_type` tinyint(4) NULL DEFAULT NULL COMMENT '有效期类型',
  `price` decimal(18, 4) NULL DEFAULT NULL COMMENT '价格',
  `traffic` bigint(20) NULL DEFAULT NULL COMMENT '流量',
  `duration` bigint(20) NULL DEFAULT NULL COMMENT '时长',
  `client_num` int(11) NULL DEFAULT NULL COMMENT '在线设备数',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  `rate_limit_enable` tinyint(1) NULL DEFAULT 0 COMMENT '带宽是否限制',
  `traffic_enable` tinyint(1) NULL DEFAULT 0 COMMENT '流量是否限制',
  `duration_enable` tinyint(1) NULL DEFAULT 0 COMMENT '时长是否限制',
  `client_num_enable` tinyint(1) NULL DEFAULT 0 COMMENT '在线设备数是否限制',
  `package_enable` tinyint(1) NULL DEFAULT 0 COMMENT '套餐是否启用',
  `del_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标志（0存在 1删除）',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台-套餐表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of u_package
-- ----------------------------

-- ----------------------------
-- Table structure for u_payment
-- ----------------------------
DROP TABLE IF EXISTS `u_payment`;
CREATE TABLE `u_payment`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '支付名称',
  `type` tinyint(4) NULL DEFAULT NULL COMMENT '类型（0支付宝 1微信 2信用卡）',
  `appId` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '应用编号',
  `server_url` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '支付网关',
  `domain` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '外网访问项目的域名',
  `private_key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '应用私钥',
  `public_key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '应用公钥',
  `app_cert_path` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '应用公钥证书',
  `cert_path` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '公钥证书',
  `root_cert_path` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '根证书',
  `enable` tinyint(1) NULL DEFAULT NULL COMMENT '是否启用',
  `del_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标志（0存在 1删除）',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户平台-支付表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for u_post
-- ----------------------------
DROP TABLE IF EXISTS `u_post`;
CREATE TABLE `u_post`  (
  `post_id` bigint(20) 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(11) 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 NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`post_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台_岗位信息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of u_post
-- ----------------------------

-- ----------------------------
-- Table structure for u_rate_limit
-- ----------------------------
DROP TABLE IF EXISTS `u_rate_limit`;
CREATE TABLE `u_rate_limit`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `rate_limit_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '限速名称',
  `down_limit` bigint(20) NULL DEFAULT NULL COMMENT '下行限速',
  `down_limit_enable` tinyint(1) NULL DEFAULT 0 COMMENT '下行限速启用',
  `up_limit` bigint(20) NULL DEFAULT NULL COMMENT '上行限速',
  `up_limit_enable` tinyint(1) NULL DEFAULT 0 COMMENT '上行限速启用',
  `del_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标志（0存在 1删除）',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台-带宽限速表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of u_rate_limit
-- ----------------------------

-- ----------------------------
-- Table structure for u_recharge
-- ----------------------------
DROP TABLE IF EXISTS `u_recharge`;
CREATE TABLE `u_recharge`  (
  `recharge_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Recharge ID',
  `user_id` bigint(20) NULL DEFAULT NULL COMMENT 'User ID link to u_user',
  `fee` double NULL DEFAULT NULL,
  `status` enum('unpaid','paid') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT 'unpaid',
  `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT 'create name ',
  `create_time` datetime NULL DEFAULT NULL COMMENT 'create time',
  PRIMARY KEY (`recharge_id`) USING BTREE,
  INDEX `fk_user_id`(`user_id`) USING BTREE,
  CONSTRAINT `u_recharge_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `u_user` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户平台_用户信息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of u_recharge
-- ----------------------------

-- ----------------------------
-- Table structure for u_role
-- ----------------------------
DROP TABLE IF EXISTS `u_role`;
CREATE TABLE `u_role`  (
  `role_id` bigint(20) 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 NOT NULL COMMENT '角色权限字符串',
  `role_sort` int(11) NULL COMMENT '显示顺序',
  `data_scope` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）',
  `menu_check_strictly` tinyint(1) NULL DEFAULT 1 COMMENT '菜单树选择项是否关联显示',
  `dept_check_strictly` tinyint(1) NULL DEFAULT 1 COMMENT '部门树选择项是否关联显示',
  `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色状态（0正常 1停用）',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志（0代表存在 2代表删除）',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`role_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台_角色信息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of u_role
-- ----------------------------
INSERT INTO `u_role` VALUES (1, '超级用户', 'super', 1, '1', 1, 1, '0', '0', 'super', '2024-11-27 16:06:18', '', NULL, '超级用户后台指定，不可配置');
INSERT INTO `u_role` VALUES (2, '会员', 'vip', 2, '2', 1, 1, '0', '0', 'super', '2024-11-27 16:06:18', '', '2024-12-02 15:22:02', '会员，对普通用户授予角色');

-- ----------------------------
-- Table structure for u_role_dept
-- ----------------------------
DROP TABLE IF EXISTS `u_role_dept`;
CREATE TABLE `u_role_dept`  (
  `role_id` bigint(20) NOT NULL COMMENT '角色ID',
  `dept_id` bigint(20) NOT NULL COMMENT '部门ID',
  PRIMARY KEY (`role_id`, `dept_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台_角色和部门关联表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of u_role_dept
-- ----------------------------

-- ----------------------------
-- Table structure for u_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `u_role_menu`;
CREATE TABLE `u_role_menu`  (
  `role_id` bigint(20) NOT NULL COMMENT '角色ID',
  `menu_id` bigint(20) NOT NULL COMMENT '菜单ID',
  PRIMARY KEY (`role_id`, `menu_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台_角色和菜单关联表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of u_role_menu
-- ----------------------------
INSERT INTO `u_role_menu` VALUES (2, 2000);
INSERT INTO `u_role_menu` VALUES (2, 2001);
INSERT INTO `u_role_menu` VALUES (2, 2010);
INSERT INTO `u_role_menu` VALUES (2, 2011);
INSERT INTO `u_role_menu` VALUES (2, 2012);

-- ----------------------------
-- Table structure for u_user
-- ----------------------------
DROP TABLE IF EXISTS `u_user`;
CREATE TABLE `u_user`  (
  `user_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `dept_id` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
  `user_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户账号',
  `nick_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户昵称',
  `full_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户姓名',
  `user_type` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '00' COMMENT '用户类型（00系统用户）',
  `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户邮箱',
  `phonenumber` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '手机号码',
  `sex` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '用户性别（0男 1女 2未知）',
  `avatar` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '头像地址',
  `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '密码',
  `age` int(11) NULL DEFAULT NULL COMMENT '年龄',
  `birth_date` date DEFAULT NULL COMMENT '出生日期',
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
  `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '帐号状态（0正常 1停用）',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志（0代表存在 2代表删除）',
  `login_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '最后登录IP',
  `login_date` datetime NULL DEFAULT NULL COMMENT '最后登录时间',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台_用户信息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of u_user
-- ----------------------------
INSERT INTO `u_user` VALUES (1, NULL, 'super', 'super', 'super', '00', 'super@mail.com', '123456', '1', '', '$2a$10$XF99QEWn2MjEE3pbFVvHuOyMi/YVIrQbdenEleJN5dYxAfgXFaaqG', 1, '', '0', '0', '192.168.88.14', '2024-12-06 10:36:35', 'system', '2024-05-08 21:50:54', '', '2024-12-06 10:36:35', 'super');
INSERT INTO `u_user` VALUES (2, NULL, 'demo', 'demo', 'demo', '00', 'demo@mail.com', '12345678', '1', '', '$2a$10$XF99QEWn2MjEE3pbFVvHuOyMi/YVIrQbdenEleJN5dYxAfgXFaaqG', 1, '', '0', '0', '192.168.88.14', '2024-12-06 10:36:35', 'system', '2024-12-06 10:30:54', '', '2024-12-06 10:36:35', 'demo');
INSERT INTO `u_user` VALUES (3, NULL, '123456', '123456', '123456', '00', '12345678@mail.com', '1234567', '1', '', '$2a$10$XF99QEWn2MjEE3pbFVvHuOyMi/YVIrQbdenEleJN5dYxAfgXFaaqG', 1, '', '0', '0', '192.168.2.94', '2024-12-16 17:36:08', 'system', '2024-05-08 21:50:54', '123456', '2024-12-16 17:36:08', '');

-- ----------------------------
-- Table structure for u_user_post
-- ----------------------------
DROP TABLE IF EXISTS `u_user_post`;
CREATE TABLE `u_user_post`  (
  `user_id` bigint(20) NOT NULL COMMENT '用户ID',
  `post_id` bigint(20) NOT NULL COMMENT '岗位ID',
  PRIMARY KEY (`user_id`, `post_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台_用户与岗位关联表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of u_user_post
-- ----------------------------

-- ----------------------------
-- Table structure for u_user_role
-- ----------------------------
DROP TABLE IF EXISTS `u_user_role`;
CREATE TABLE `u_user_role`  (
  `user_id` bigint(20) NOT NULL COMMENT '用户ID',
  `role_id` bigint(20) NOT NULL COMMENT '角色ID',
  PRIMARY KEY (`user_id`, `role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台_用户和角色关联表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of u_user_role
-- ----------------------------
INSERT INTO `u_user_role` VALUES (1, 1);

-- ----------------------------
-- Table structure for u_alipay_order
-- ----------------------------
DROP TABLE IF EXISTS `u_alipay_order`;
CREATE TABLE `u_alipay_order`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id primary key',
  `user_id` bigint(20) NULL DEFAULT NULL COMMENT 'user id',
  `out_trade_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'order out trade no',
  `trade_status` enum('TRADE_SUCCESS','TRADE_FAIL') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'trade status',
  `total_amount` decimal(18, 4) NULL DEFAULT NULL COMMENT 'total order amount',
  `subject` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商品名称',
  `body` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商品描述',
  `del_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标志（0存在 1删除）',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx-user-trade-no`(`user_id`, `out_trade_no`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台-订单表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for u_wxpay_order
-- ----------------------------
DROP TABLE IF EXISTS `u_wxpay_order`;
CREATE TABLE `u_wxpay_order`  (
  `id` bigint(20) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT COMMENT 'id primary key',
  `user_id` bigint(20) NULL DEFAULT NULL COMMENT 'user id',
  `out_trade_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商户订单号',
  `transaction_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '微信支付订单号',
  `trade_status` enum('TRADE_SUCCESS','TRADE_FAIL') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'SUCCESS--支付成功\r\nREFUND--转入退款\r\nNOTPAY--未支付\r\nCLOSED--已关闭\r\nREVOKED--已撤销(刷卡支付)\r\nUSERPAYING--用户支付中\r\nPAYERROR--支付失败(其他原因，如银行返回失败)\r\nACCEPT--已接收，等待扣款\r\n支付状态机请见下单API页面',
  `total_amount` bigint(20) NULL DEFAULT NULL COMMENT 'total order amount',
  `fee_type` enum('USD','EUR','CNY') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '币种',
  `trade_type` enum('JSAPI','NATIVE','APP','MICROPAY') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '交易类型',
  `subject` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商品名称',
  `body` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商品描述',
  `del_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标志（0存在 1删除）',
  `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx-user-trade-no`(`user_id`, `out_trade_no`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台-订单表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for u_credit_card_order
-- ----------------------------
DROP TABLE IF EXISTS `u_credit_card_order`;
CREATE TABLE `u_credit_card_order`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `transaction_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `order_id` bigint(20) NOT NULL,
  `amount` decimal(10, 2) NOT NULL,
  `currency` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `payment_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `card_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `card_holder_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `billing_address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
  `card_last_four` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `gateway_response` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for u_credit_card_token
-- ----------------------------
DROP TABLE IF EXISTS `u_credit_card_token`;
CREATE TABLE `u_credit_card_token`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL,
  `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `card_last_four` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `card_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for u_kyc
-- ----------------------------
DROP TABLE IF EXISTS `u_kyc`;
CREATE TABLE `u_kyc`  (
  `kyc_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `user_id` bigint(20) NULL DEFAULT NULL COMMENT 'link to user_id of u_user',
  `real_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `birth_date` date NULL DEFAULT NULL,
  `id_type` enum('DRIVERS_LICENSE','PASSPORT','RESIDENCE_PERMIT','STUDENT_ID','MEDICARE_CARD','BIRTH_CERTIFICATE') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'identify type',
  `id_file` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'ID file',
  `identify_picture` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'identify picture',
  `status` enum('VERIFIED','UNVERIFIED','PENDING','REJECTED') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'PENDING' COMMENT 'KYC Status: 1-VERIFIED/2-UNVERIFIED/3-PENDING/4-REJECTED',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志（0代表存在 2代表删除）',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`kyc_id`) USING BTREE,
  INDEX `user_id`(`user_id`) USING BTREE,
  CONSTRAINT `u_kyc_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `u_user` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户平台_用户信息表' ROW_FORMAT = DYNAMIC;

SET FOREIGN_KEY_CHECKS = 1;
