create database ec_goods;
/*商品表*/
CREATE TABLE `product` (
`id` INT(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` VARCHAR(20) NOT NULL COMMENT '商品名称',
`description` VARCHAR(1024) DEFAULT NULL COMMENT '商品描述',
`price` FLOAT NOT NULL COMMENT '商品价格',
`stock` INT(10) NOT NULL COMMENT '库存数量',
`level1_id` INT(10) DEFAULT NULL COMMENT '分类1',
`level2_id` INT(10) DEFAULT NULL COMMENT '分类2',
`level3_id` INT(10) DEFAULT NULL COMMENT '分类3',
`main_img` VARCHAR(200) DEFAULT NULL COMMENT '主图名称',
`sub_imgs` TEXT DEFAULT NULL COMMENT '副图地址',
`status` INT(1) DEFAULT '1' COMMENT '状态(1:在售 2:下架 3:已删除)',
`create_time` DATETIME DEFAULT NULL COMMENT '创建时间',
`update_time` DATETIME DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*商品分类表*/
CREATE TABLE `category` (
`id` INT(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` VARCHAR(20) NOT NULL COMMENT '名称',
`parent_id` INT(10) NOT NULL COMMENT '父级目录id',
`level` INT(11) DEFAULT NULL COMMENT '级别(1:一级 2:二级 3:三级)',
`icon` VARCHAR(255) DEFAULT NULL COMMENT '图标',
`status` INT(1) DEFAULT '1' COMMENT '状态(1:正常 2:删除)',
`create_time` DATETIME DEFAULT NULL COMMENT '创建时间',
`update_time` DATETIME DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT INTO
`product`(`id`,`name`,`description`,`price`,`stock`,`level1_id`,`level2_id`,`level3_id`,`main_img`,`status`,`create_time`,`update_time`)
VALUES
(733,'香奈儿','',152,94,548,654,655,'27A1789ED5764D82A5506DF3DC3933F9.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(734,'洗面奶','',152,995,548,654,655,'D6C9BD438C5643D6B1A6C52E5426FE22.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(735,'啫喱水','',152,998,548,654,655,'1A836D2B3A3348DDAB19807E6CEA8028.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(736,'香水5852','',152,1000,548,654,655,'4D9499BAD92A42D291094E797BA2EA3F.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(737,'香水','',152,111,548,654,655,'A9924F9DB68B4DF99FDBF05902075AF0.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(738,'润肤露','',45,109,548,654,655,'3B059EDB5237407980458CE9EA9D3204.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(739,'洁面装','',156,99,548,654,655,'A62C6DF55116440CA3DE9DB37901ED4F.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(740,'电饭锅','',158,100,628,656,659,'40C3B76BA31246618E3CFC8723D33517.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(741,'婴儿喂奶装','',569,100,632,637,653,'401004B3D47C4C6FB1BC5EF19C21FC77.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(742,'坚果套餐','',158,1000,660,661,662,'E03D74145A034F6D909879829CB99D80.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(743,'超甜蜜崭','',589,1000,660,661,663,'7121E55099FC477680B1229205CE3D29.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(744,'华为2566','',589,1000,670,671,672,'F24B4140A2284B3788A38F3B5AD1809A.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(745,'荣耀3C','',589,100,670,671,672,'F3921E12552A4D0AA3F75467B146A959.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(746,'小米手环','',963,100,670,674,675,'72F75A371B0B4C26A7F72FAAEF96FC68.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(747,'华为2265','',896,1000,670,671,673,'161F355A8A8549BA8F7F4CE3B4F07E40.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(748,'越南坚果','',520,1000,660,661,662,'CBC98D3C9E544830821632F5C313D93E.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(749,'日本进口马桶','',5866,100,628,657,0,'A5AF40825E6940B2A59A040100E181A8.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(750,'联想Y系列','',569,1000,670,690,691,'956DB0BEC41B41B8A06C05C950130E23.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(751,'脑白金1号','',589,1000,676,677,680,'66E96AF9E9714A5C9EA901811173D662.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(752,'莫里斯按','',589,1000,676,678,0,'A7436BC607E74C81B392DCFE69D4AEAB.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(753,'三鹿好奶粉','',859,100,676,679,0,'3C465E7B8A324A8DA2A2EEE202E36166.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(754,'儿童牛奶','',5896,100,676,679,0,'D1AC9AE71ED348FA8D880FD4279D3422.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(755,'软沙发','',8596,99,628,696,0,'ED7921DE40FC47E18365754709A21194.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(756,'收纳盒','',5966,100,628,696,0,'DB86CA25CA4F4B4AA906F46BE542C6A6.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(757,'洗衣液','',58,1000,628,696,0,'E6CCDC343ACC471C908E9748776C6421.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(758,'红短沙发','',596,123,628,696,0,'BD5C77465DC2466BBCE7F95FB9764392.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(759,'新西兰奶粉','',5896,100,676,679,0,'9ED375098D42497B8FC33167E06D0EE8.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(760,'婴儿车','',11000,100,681,682,687,'1DBC0930641D43C29D74A9E1B40FEEBB.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(761,'夏款婴儿车','',963,100,681,682,688,'16290C4DBEAC4F00A636667019621468.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(762,'抗压旅行箱','',569,1000,681,683,685,'272CC434BE7A4469AB0E7882BD1A85FF.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(763,'透明手提箱','',8596,1000,681,683,684,'EAA8E66259BF4239B4A2237B62520EF1.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(764,'婴儿果粉','',5896,1000,660,661,662,'08BE30BF7B5F4930B0093D8CC4056057.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(765,'椰子粉','',5963,1000,660,661,662,'9C006B8BD1AD45398F474A8471ADC50B.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(766,'坚果蛋糕','',200,100,660,661,663,'2E5A16E21E0640E0BAE03E9B995DCD28.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(767,'编制手提箱','',5896,1000,681,682,688,'2E1D2A5E65A94FEEA17C72E47C530057.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(768,'纸箱','',5896,100,681,682,687,'443E5A4122064209AFE89250179A2FF0.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(769,'健胃液','',152,1000,676,679,0,'30B5547CD7384DAA8A2F4F4D8C0BBF89.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13'),
(770,'联想NTC','',8596,100,670,671,673,'48BC371A85A548B7A7589E3F542D911D.jpg',1,'2019-9-12 22:11:13','2019-9-12 22:11:13');
INSERT INTO
`category`(`id`,`name`,`parent_id`,`level`,`icon`,`status`,`create_time`,`update_time`) VALUES
(548,'化妆品',0,1,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(628,'家用商品',0,1,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(654,'面部护理',548,2,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(655,'少女派',654,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(656,'餐具',628,2,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(657,'卫具',628,2,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(658,'叉子',656,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(659,'锅',656,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(660,'进口食品,生鲜',0,1,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(661,'零食/糖果/巧克力',660,2,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(662,'坚果',661,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(663,'蜜饯',661,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(669,'孕期教育',546,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(670,'电子商品',0,1,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(671,'手机',670,2,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(672,'华为手机',671,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(673,'联想手机',671,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(674,'手环',670,2,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(675,'小米手环',674,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(676,'保健食品',0,1,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(677,'老年保健品',676,2,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(678,'中年营养品',676,2,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(679,'儿童保健品',676,2,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(680,'脑白金',677,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(681,'箱包',0,1,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(682,'旅行箱',681,2,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(683,'手提箱',681,2,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(684,'大型',683,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(685,'小型',683,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(686,'中型',683,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(687,'大型',682,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(688,'中型',682,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(689,'小型',682,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(690,'电脑',670,2,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(691,'联想电脑',690,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(692,'刀叉',656,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(693,'碗筷',656,3,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22'),
(696,'客厅专用',628,2,'',1,'2019-9-12 21:22:22','2019-9-12 21:22:22');