deliver.sql
5.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50726
Source Host : localhost:3306
Source Schema : deliver
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 09/06/2019 20:12:16
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for address
-- ----------------------------
DROP TABLE IF EXISTS `address`;
CREATE TABLE `address` (
`addressId` int(11) NOT NULL AUTO_INCREMENT,
`address` varchar(255) DEFAULT NULL,
PRIMARY KEY (`addressId`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for category
-- ----------------------------
DROP TABLE IF EXISTS `category`;
CREATE TABLE `category` (
`categoryId` varchar(20) NOT NULL,
`categoryName` varchar(10) DEFAULT NULL,
`price` decimal(10,0) DEFAULT NULL,
PRIMARY KEY (`categoryId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for coupon
-- ----------------------------
DROP TABLE IF EXISTS `coupon`;
CREATE TABLE `coupon` (
`couponId` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '优惠券id',
`couponName` varchar(20) DEFAULT NULL COMMENT '优惠券名',
`couponType` int(2) DEFAULT NULL COMMENT '优惠券类型',
`discounts` decimal(20,0) DEFAULT NULL COMMENT '优惠金额/折扣',
`scope` varchar(255) DEFAULT NULL COMMENT '优惠券使用范围',
`orderCondition` decimal(20,0) DEFAULT NULL COMMENT '优惠券使用条件(金额)',
`validTime` int(10) DEFAULT NULL COMMENT '优惠券有效时间',
`expiredDate` datetime DEFAULT NULL COMMENT '优惠券过期时间',
PRIMARY KEY (`couponId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for js_sys_module
-- ----------------------------
DROP TABLE IF EXISTS `js_sys_module`;
CREATE TABLE `js_sys_module` (
`module_code` varchar(64) NOT NULL,
`module_name` varchar(100) NOT NULL,
`description` varchar(500) DEFAULT NULL,
`main_class_name` varchar(500) DEFAULT NULL,
`current_version` varchar(50) DEFAULT NULL,
`upgrade_info` varchar(300) DEFAULT NULL,
`status` char(1) NOT NULL DEFAULT '0',
`create_by` varchar(64) NOT NULL,
`create_date` datetime NOT NULL,
`update_by` varchar(64) NOT NULL,
`update_date` datetime NOT NULL,
`remarks` varchar(500) DEFAULT NULL,
PRIMARY KEY (`module_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for order
-- ----------------------------
DROP TABLE IF EXISTS `order`;
CREATE TABLE `order` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`orderId` varchar(100) DEFAULT NULL COMMENT '订单Id',
`userId` varchar(100) DEFAULT NULL COMMENT '用户ID',
`addressId` varchar(5) DEFAULT NULL COMMENT '园区地址ID',
`address` varchar(255) DEFAULT NULL COMMENT '园区地址',
`mobile` varchar(50) DEFAULT NULL COMMENT '预留手机号',
`state` int(2) DEFAULT NULL COMMENT '订单状态',
`deliveryTime` datetime DEFAULT NULL COMMENT '预计配送时间',
`createTime` datetime DEFAULT NULL COMMENT '创建时间',
`categoryId` varchar(5) DEFAULT NULL COMMENT '品类Id',
`num` int(255) DEFAULT NULL COMMENT '数量',
`totalPrice` decimal(10,0) DEFAULT NULL COMMENT '总价',
`couponName` varchar(255) DEFAULT NULL COMMENT '优惠名',
`couponId` bigint(20) DEFAULT NULL COMMENT '优惠券ID',
`userCouponId` bigint(20) DEFAULT NULL COMMENT '用户优惠券ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for product
-- ----------------------------
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
`id` bigint(20) NOT NULL,
`name` varchar(20) DEFAULT NULL,
`img` varchar(255) DEFAULT NULL,
`describe` text,
`contactUs` varchar(255) DEFAULT NULL,
`deliveryTime` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for user_coupon
-- ----------------------------
DROP TABLE IF EXISTS `user_coupon`;
CREATE TABLE `user_coupon` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`userId` varchar(255) DEFAULT NULL COMMENT '用户ID',
`couponId` bigint(20) DEFAULT NULL COMMENT '优惠券ID',
`drawTime` datetime DEFAULT NULL COMMENT '领取时间',
`couponStatus` int(2) DEFAULT NULL COMMENT '优惠券状态',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for user_info
-- ----------------------------
DROP TABLE IF EXISTS `user_info`;
CREATE TABLE `user_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`userId` varchar(255) DEFAULT NULL,
`username` varchar(20) DEFAULT NULL,
`telNumber` varchar(50) DEFAULT NULL,
`openId` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`admin` tinyint(1) DEFAULT NULL,
`createTime` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
SET FOREIGN_KEY_CHECKS = 1;