You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

335 lines
16 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1
Source Server Version : 50540
Source Host : localhost:3306
Source Database : tmall
Target Server Type : MYSQL
Target Server Version : 50540
File Encoding : 65001
Date: 2020-12-23 20:52:20
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for cartitem
-- ----------------------------
DROP TABLE IF EXISTS `cartitem`;
CREATE TABLE `cartitem` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) DEFAULT NULL,
`pid` int(11) DEFAULT NULL,
`number` int(11) NOT NULL DEFAULT '0',
`sum` decimal(10,2) NOT NULL DEFAULT '0.00',
`deleteAt` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_cartitem_product` (`pid`),
KEY `fk_cartitem_user` (`uid`),
CONSTRAINT `fk_cartitem_product` FOREIGN KEY (`pid`) REFERENCES `product` (`id`),
CONSTRAINT `fk_cartitem_user` FOREIGN KEY (`uid`) REFERENCES `user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of cartitem
-- ----------------------------
INSERT INTO `cartitem` VALUES ('1', '2', '3', '1', '49.00', '2020-03-13 16:40:57');
INSERT INTO `cartitem` VALUES ('2', '2', '5', '2', '260.00', null);
INSERT INTO `cartitem` VALUES ('3', '3', '7', '2', '8.00', '2020-05-30 11:26:40');
-- ----------------------------
-- Table structure for category
-- ----------------------------
DROP TABLE IF EXISTS `category`;
CREATE TABLE `category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`recommend` int(11) NOT NULL DEFAULT '0',
`deleteAt` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of category
-- ----------------------------
INSERT INTO `category` VALUES ('1', '水果', '0', '2020-03-12 15:41:20');
INSERT INTO `category` VALUES ('2', '手机', '1', '2020-03-12 15:41:17');
INSERT INTO `category` VALUES ('3', '新鲜蔬菜', '1', null);
INSERT INTO `category` VALUES ('4', '新鲜水果', '2', null);
INSERT INTO `category` VALUES ('5', '特色专区', '3', null);
INSERT INTO `category` VALUES ('6', '清早推荐', '99', '2020-03-15 15:46:29');
INSERT INTO `category` VALUES ('7', '晚间推荐', '97', '2020-03-15 15:47:05');
INSERT INTO `category` VALUES ('8', '中午推荐', '98', '2020-03-15 15:46:38');
INSERT INTO `category` VALUES ('9', '清早推荐', '99', null);
INSERT INTO `category` VALUES ('10', '午间推荐', '98', null);
INSERT INTO `category` VALUES ('11', '晚间推荐', '97', null);
INSERT INTO `category` VALUES ('12', '限时抢购专栏每天15—14点进行抢购', '100', '2020-03-15 16:12:30');
-- ----------------------------
-- Table structure for comment
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) DEFAULT NULL,
`uid` int(11) DEFAULT NULL,
`content` text,
`createDate` datetime DEFAULT NULL,
`deleteAt` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_comment_product` (`pid`),
KEY `fk_comment_user` (`uid`),
CONSTRAINT `fk_comment_product` FOREIGN KEY (`pid`) REFERENCES `product` (`id`),
CONSTRAINT `fk_comment_user` FOREIGN KEY (`uid`) REFERENCES `user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of comment
-- ----------------------------
INSERT INTO `comment` VALUES ('1', '3', '2', '我觉得很棒,口感很好,推荐购买', '2020-03-15 15:23:12', null);
INSERT INTO `comment` VALUES ('2', '7', '3', '1', '2020-05-30 09:39:59', null);
INSERT INTO `comment` VALUES ('3', '5', '3', '111222', '2020-05-30 09:45:21', null);
-- ----------------------------
-- Table structure for config
-- ----------------------------
DROP TABLE IF EXISTS `config`;
CREATE TABLE `config` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`cname` varchar(255) DEFAULT NULL,
`value` varchar(255) DEFAULT NULL,
`rate` int(11) NOT NULL DEFAULT '0',
`deleteAt` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of config
-- ----------------------------
INSERT INTO `config` VALUES ('1', 'website_name', '网站名称', '绿色蔬菜销售系统', '100', null);
INSERT INTO `config` VALUES ('2', 'index_description', '首页描述', '绿色蔬菜销售系统为您提供服务', '50', null);
INSERT INTO `config` VALUES ('3', 'index_keyword', '首页关键词', '绿色蔬菜销售系统,商超系统', '25', null);
INSERT INTO `config` VALUES ('4', 'index_title', '首页标题', '绿色蔬菜销售系统——基于Java的商城项目实践', '12', null);
INSERT INTO `config` VALUES ('5', 'path_product_img', '产品图片存放目录', 'pictures/product/', '6', null);
INSERT INTO `config` VALUES ('6', 'path_category_img', '分类图片存放目录', 'pictures/category/', '5', null);
-- ----------------------------
-- Table structure for orderitem
-- ----------------------------
DROP TABLE IF EXISTS `orderitem`;
CREATE TABLE `orderitem` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`oid` int(11) DEFAULT NULL,
`pid` int(11) DEFAULT NULL,
`cmid` int(11) DEFAULT NULL,
`number` int(11) unsigned NOT NULL DEFAULT '0',
`sum` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
`deleteAt` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_orderitem_product` (`pid`),
KEY `fk_orderitem_order` (`oid`),
KEY `fk_orderitem_comment` (`cmid`),
CONSTRAINT `fk_orderitem_comment` FOREIGN KEY (`cmid`) REFERENCES `comment` (`id`),
CONSTRAINT `fk_orderitem_order` FOREIGN KEY (`oid`) REFERENCES `order_` (`id`),
CONSTRAINT `fk_orderitem_product` FOREIGN KEY (`pid`) REFERENCES `product` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of orderitem
-- ----------------------------
INSERT INTO `orderitem` VALUES ('1', '1', '3', '1', '1', '49.00', null);
INSERT INTO `orderitem` VALUES ('2', '2', '5', null, '2', '260.00', null);
INSERT INTO `orderitem` VALUES ('3', '3', '7', '2', '1', '4.00', null);
INSERT INTO `orderitem` VALUES ('4', '4', '7', null, '1', '4.00', null);
INSERT INTO `orderitem` VALUES ('5', '5', '5', '3', '1', '130.00', null);
-- ----------------------------
-- Table structure for order_
-- ----------------------------
DROP TABLE IF EXISTS `order_`;
CREATE TABLE `order_` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) DEFAULT NULL,
`orderCode` varchar(255) NOT NULL DEFAULT '',
`sum` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
`totalNumber` int(11) unsigned NOT NULL DEFAULT '0',
`address` varchar(255) DEFAULT '',
`post` varchar(255) DEFAULT '',
`receiver` varchar(255) DEFAULT '',
`mobile` varchar(255) DEFAULT '',
`userMessage` varchar(255) DEFAULT '',
`createDate` datetime DEFAULT NULL,
`payDate` datetime DEFAULT NULL,
`deliverDate` datetime DEFAULT NULL,
`confirmDate` datetime DEFAULT NULL,
`status` varchar(255) DEFAULT NULL,
`deleteAt` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_order_user` (`uid`),
CONSTRAINT `fk_order_user` FOREIGN KEY (`uid`) REFERENCES `user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of order_
-- ----------------------------
INSERT INTO `order_` VALUES ('1', '2', '202003140040572441246429300', '49.00', '1', '家里', '', '123', '12345678907', '', '2020-03-13 16:40:57', '2020-03-13 16:41:00', '2020-03-13 16:41:10', '2020-03-15 15:21:58', 'finish', null);
INSERT INTO `order_` VALUES ('2', '2', '202003152310318511997640727', '260.00', '1', '测试详细地址', '000000', '测试人员', '13000000000', '测试留言', '2020-03-15 15:10:32', '2020-03-15 15:10:54', '2020-05-30 09:39:28', null, 'waitConfirm', null);
INSERT INTO `order_` VALUES ('3', '3', '20200530173027627475842770', '4.00', '1', '1', '1', '1', '13111111111', '1', '2020-05-30 09:30:27', '2020-05-30 09:38:58', '2020-05-30 09:39:29', '2020-05-30 09:39:53', 'finish', null);
INSERT INTO `order_` VALUES ('4', '3', '202005301738456671244721567', '4.00', '1', '1', '1', '1', '13111111111', '1', '2020-05-30 09:38:45', '2020-05-30 09:38:47', '2020-05-30 09:39:30', null, 'waitConfirm', null);
INSERT INTO `order_` VALUES ('5', '3', '20200530174405335292976632', '130.00', '1', '1', '1', '1', '13111111111', '111', '2020-05-30 09:44:05', '2020-05-30 09:44:09', '2020-05-30 09:44:42', '2020-05-30 09:45:08', 'finish', null);
-- ----------------------------
-- Table structure for product
-- ----------------------------
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cid` int(11) DEFAULT NULL,
`name` varchar(255) NOT NULL DEFAULT '',
`subTitle` varchar(255) NOT NULL DEFAULT '',
`originalPrice` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
`nowPrice` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
`stock` int(11) unsigned NOT NULL DEFAULT '0',
`imgid` int(11) DEFAULT NULL,
`createDate` datetime DEFAULT NULL,
`commentCount` int(11) unsigned NOT NULL DEFAULT '0',
`saleCount` int(11) unsigned NOT NULL DEFAULT '0',
`deleteAt` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_product_category` (`cid`),
KEY `fk_product_product_image` (`imgid`),
CONSTRAINT `fk_product_category` FOREIGN KEY (`cid`) REFERENCES `category` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of product
-- ----------------------------
INSERT INTO `product` VALUES ('1', '2', '测试', '测试', '13.00', '10.00', '500', '4', '2020-03-11 10:20:50', '0', '0', null);
INSERT INTO `product` VALUES ('2', '3', '原产自匈牙利的白菜,健康又美味', '1', '16.00', '8.00', '500', '5', '2020-03-12 16:17:28', '0', '0', null);
INSERT INTO `product` VALUES ('3', '4', '广西红心芭乐番石榴新鲜水果10斤当季巴乐潘石榴芭乐果整箱包邮 收藏下单送酸梅粉 清脆爽口', '芭乐番石榴', '50.00', '49.00', '122', '8', '2020-03-12 16:22:04', '1', '1', null);
INSERT INTO `product` VALUES ('4', '4', '广西柠檬新鲜水果10斤当季巴乐潘石榴芭乐果整箱包邮 收藏下单送酸梅粉 清脆爽口', '可爱柠檬', '5.00', '3.00', '1000', null, '2020-03-12 16:42:34', '0', '0', '2020-03-12 16:57:05');
INSERT INTO `product` VALUES ('5', '5', '大连美早大樱桃3斤装新鲜水果国产车厘子应当季孕妇整箱5顺丰包邮 收藏下单 首件立减10元 现摘现发 爆甜多汁~', '1', '190.00', '130.00', '999', '11', '2020-03-12 17:03:00', '1', '2', null);
INSERT INTO `product` VALUES ('6', '12', '限时抢购!!广西草莓新鲜水果10斤当季草莓整箱包邮 收藏下单送酸梅粉 清脆爽口', '限时抢购!!广西草莓', '49.00', '15.00', '100', '14', '2020-03-15 15:51:33', '0', '0', null);
INSERT INTO `product` VALUES ('7', '9', '香甜可口大草莓', '香甜可口大草莓', '12.00', '4.00', '1000', '20', '2020-03-15 16:30:21', '1', '2', null);
-- ----------------------------
-- Table structure for product_image
-- ----------------------------
DROP TABLE IF EXISTS `product_image`;
CREATE TABLE `product_image` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) DEFAULT NULL,
`type` varchar(255) DEFAULT NULL,
`deleteAt` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_product_image` (`pid`),
CONSTRAINT `fk_product_image` FOREIGN KEY (`pid`) REFERENCES `product` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of product_image
-- ----------------------------
INSERT INTO `product_image` VALUES ('1', '1', 'cover', null);
INSERT INTO `product_image` VALUES ('2', '1', 'top', null);
INSERT INTO `product_image` VALUES ('3', '1', 'detail', null);
INSERT INTO `product_image` VALUES ('4', '1', 'cover', null);
INSERT INTO `product_image` VALUES ('5', '2', 'cover', null);
INSERT INTO `product_image` VALUES ('6', '2', 'top', null);
INSERT INTO `product_image` VALUES ('7', '2', 'detail', null);
INSERT INTO `product_image` VALUES ('8', '3', 'cover', null);
INSERT INTO `product_image` VALUES ('9', '3', 'top', null);
INSERT INTO `product_image` VALUES ('10', '3', 'detail', null);
INSERT INTO `product_image` VALUES ('11', '5', 'cover', null);
INSERT INTO `product_image` VALUES ('12', '5', 'top', null);
INSERT INTO `product_image` VALUES ('13', '5', 'detail', null);
INSERT INTO `product_image` VALUES ('14', '6', 'cover', null);
INSERT INTO `product_image` VALUES ('15', '6', 'top', '2020-03-15 15:53:28');
INSERT INTO `product_image` VALUES ('16', '6', 'detail', '2020-03-15 15:53:38');
INSERT INTO `product_image` VALUES ('17', '6', 'top', null);
INSERT INTO `product_image` VALUES ('18', '6', 'detail', null);
INSERT INTO `product_image` VALUES ('19', '6', 'detail', null);
INSERT INTO `product_image` VALUES ('20', '7', 'cover', null);
INSERT INTO `product_image` VALUES ('21', '7', 'top', null);
INSERT INTO `product_image` VALUES ('22', '7', 'detail', null);
INSERT INTO `product_image` VALUES ('23', '7', 'detail', '2020-03-15 16:30:50');
INSERT INTO `product_image` VALUES ('24', '7', 'detail', null);
-- ----------------------------
-- Table structure for property
-- ----------------------------
DROP TABLE IF EXISTS `property`;
CREATE TABLE `property` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cid` int(11) DEFAULT NULL,
`name` varchar(255) NOT NULL DEFAULT '',
`deleteAt` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_property_category` (`cid`),
CONSTRAINT `fk_property_category` FOREIGN KEY (`cid`) REFERENCES `category` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of property
-- ----------------------------
INSERT INTO `property` VALUES ('2', '2', '212', null);
INSERT INTO `property` VALUES ('3', '1', '水果是否甜', null);
INSERT INTO `property` VALUES ('4', '2', '是否发热', null);
INSERT INTO `property` VALUES ('5', '4', '厂名', null);
INSERT INTO `property` VALUES ('6', '4', '品牌', null);
INSERT INTO `property` VALUES ('7', '4', '保质期', null);
INSERT INTO `property` VALUES ('8', '4', '规格', null);
INSERT INTO `property` VALUES ('9', '4', '产地', null);
INSERT INTO `property` VALUES ('10', '4', '无用1', '2020-03-12 16:56:52');
-- ----------------------------
-- Table structure for property_value
-- ----------------------------
DROP TABLE IF EXISTS `property_value`;
CREATE TABLE `property_value` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) DEFAULT NULL,
`ptid` int(11) DEFAULT NULL,
`value` varchar(255) NOT NULL DEFAULT '',
`deleteAt` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_property_value_property` (`ptid`),
KEY `fk_property_value_product` (`pid`),
CONSTRAINT `fk_property_value_product` FOREIGN KEY (`pid`) REFERENCES `product` (`id`),
CONSTRAINT `fk_property_value_property` FOREIGN KEY (`ptid`) REFERENCES `property` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of property_value
-- ----------------------------
INSERT INTO `property_value` VALUES ('1', '1', '4', '', null);
INSERT INTO `property_value` VALUES ('2', '1', '2', '11', null);
INSERT INTO `property_value` VALUES ('3', '3', '9', '广西', null);
INSERT INTO `property_value` VALUES ('4', '3', '8', '1斤', null);
INSERT INTO `property_value` VALUES ('5', '3', '7', '1个月', null);
INSERT INTO `property_value` VALUES ('6', '3', '6', '暗度陈仓品牌', null);
INSERT INTO `property_value` VALUES ('7', '3', '5', '无中生有厂家', null);
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT '',
`password` varchar(255) DEFAULT '',
`group_` varchar(255) NOT NULL DEFAULT 'user',
`deleteAt` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('1', 'admin', 'd97ccfe64a25155f369f9b5ca0db9c49', 'superAdmin', null);
INSERT INTO `user` VALUES ('2', '123', 'd23692cad75564da5d89e83e94bc98e', 'user', null);
INSERT INTO `user` VALUES ('3', '1', 'fa49500462b0fdae03399e540ea04990', 'user', null);