/*
 Navicat Premium Data Transfer

 Source Server         : 本机
 Source Server Type    : MySQL
 Source Server Version : 50744
 Source Host           : localhost:3306
 Source Schema         : high-six-exam

 Target Server Type    : MySQL
 Target Server Version : 50744
 File Encoding         : 65001

 Date: 12/08/2024 22:08:09
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for month_user
-- ----------------------------
DROP TABLE IF EXISTS `month_user`;
CREATE TABLE `month_user`  (
  `uid` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `uname` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名',
  `uphone` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户手机号',
  `umoney` double(6, 2) NULL DEFAULT 0.00 COMMENT '用户余额',
  PRIMARY KEY (`uid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of month_user
-- ----------------------------
INSERT INTO `month_user` VALUES (1, '张三', '18778945446', 2207.01);
INSERT INTO `month_user` VALUES (2, '李四', '18778945446', 1790.59);

-- ----------------------------
-- Table structure for month_type
-- ----------------------------
DROP TABLE IF EXISTS `month_type`;
CREATE TABLE `month_type`  (
  `tid` int(11) NOT NULL AUTO_INCREMENT COMMENT '券码类型ID',
  `tname` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '券码类型名称',
  `tcode` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '券码所属企业码',
  `tnumber` int(11) NULL DEFAULT NULL COMMENT '库存数量',
  PRIMARY KEY (`tid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of month_type
-- ----------------------------
INSERT INTO `month_type` VALUES (1, '星钻月卡', '爱奇艺', 0);
INSERT INTO `month_type` VALUES (2, '星钻年卡', '爱奇艺', 0);
INSERT INTO `month_type` VALUES (3, '大会员月卡', '哔哩哔哩', 0);
INSERT INTO `month_type` VALUES (4, '大会员年卡', '哔哩哔哩', 2);
INSERT INTO `month_type` VALUES (5, 'VIP月卡', '腾讯视频', 2);
INSERT INTO `month_type` VALUES (6, 'VIP年卡', '腾讯视频', 1);

-- ----------------------------
-- Table structure for month_sale
-- ----------------------------
DROP TABLE IF EXISTS `month_sale`;
CREATE TABLE `month_sale`  (
  `sid` int(11) NOT NULL AUTO_INCREMENT COMMENT '售卖卷码id',
  `tid` int(11) NULL DEFAULT NULL COMMENT '售卖卷码类别',
  `uid` int(11) NULL DEFAULT NULL COMMENT '售卖用户',
  `scode` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '售卖单号',
  `sprice` decimal(10, 2) NULL DEFAULT NULL COMMENT '售卖价格',
  `sdate` datetime NULL DEFAULT NULL COMMENT '到期时间',
  `sstate` int(11) NULL DEFAULT 1 COMMENT '售卖状态 1.寄售中 2.已销售 3.待使用 4.待打款 5.完成 6.关闭',
  PRIMARY KEY (`sid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of month_sale
-- ----------------------------
INSERT INTO `month_sale` VALUES (1, 4, 1, '991319', 781.57, '2009-11-28 05:12:33', 5);
INSERT INTO `month_sale` VALUES (2, 5, 2, '860714', 791.59, '2024-05-14 07:57:24', 5);
INSERT INTO `month_sale` VALUES (3, 4, 1, '756638', 821.98, '2015-02-12 01:09:00', 5);
INSERT INTO `month_sale` VALUES (4, 5, 1, '692773', 518.66, '2021-09-15 20:59:22', 1);
INSERT INTO `month_sale` VALUES (5, 6, 2, '342814', 833.18, '2010-12-12 01:14:07', 1);
INSERT INTO `month_sale` VALUES (12, 1, 2, '02151515', 999.00, '2024-08-12 15:40:00', 3);
INSERT INTO `month_sale` VALUES (13, 3, 1, '222311', 1.00, '2024-08-31 00:00:00', 1);
INSERT INTO `month_sale` VALUES (14, 5, 1, '372493', 1000.00, '2024-08-31 00:00:00', 1);

-- ----------------------------
-- Table structure for month_order
-- ----------------------------
DROP TABLE IF EXISTS `month_order`;
CREATE TABLE `month_order`  (
  `oid` int(11) NOT NULL AUTO_INCREMENT COMMENT '订单id',
  `tid` int(11) NULL DEFAULT NULL COMMENT '订单所属类别',
  `uid` int(11) NULL DEFAULT NULL COMMENT '订单购买用户',
  `sid` int(11) NULL DEFAULT NULL COMMENT '订单购买商品id',
  `ocode` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '订单购买单',
  `oprice` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单购买花费',
  `odate` datetime NULL DEFAULT NULL COMMENT '订单购买时间',
  `oinsurance` datetime NULL DEFAULT NULL COMMENT '订单质保到期时间',
  `ostate` int(2) NULL DEFAULT 1 COMMENT '订单购买状态 1.未支付 2.待使用 3.完成',
  PRIMARY KEY (`oid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of month_order
-- ----------------------------
INSERT INTO `month_order` VALUES (1, 1, 1, 12, '651516681', 999.00, '2024-08-01 18:14:17', '2024-09-01 18:14:20', 5);
INSERT INTO `month_order` VALUES (2, 4, 1, 1, '589854', 781.65, '2024-08-12 21:16:33', '2024-08-13 21:16:33', 3);
INSERT INTO `month_order` VALUES (3, 4, 1, 3, '614596', 822.14, '2024-08-12 21:40:04', '2024-08-14 21:40:04', 3);
INSERT INTO `month_order` VALUES (4, 5, 1, 2, '166796', 791.75, '2024-08-12 22:00:57', '2024-08-14 22:00:57', 3);

SET FOREIGN_KEY_CHECKS = 1;
