/*
 Navicat Premium Data Transfer

 Source Server         : aliyun_rds
 Source Server Type    : MySQL
 Source Server Version : 50728
 Source Host           : mysql.xk857.com:33306
 Source Schema         : jxd_article

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

 Date: 20/07/2021 10:06:35
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_backstock
-- ----------------------------
DROP TABLE IF EXISTS `t_backstock`;
CREATE TABLE `t_backstock`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `order_id` int(10) UNSIGNED NOT NULL COMMENT '订单ID',
  `sku` json NOT NULL COMMENT '退货商品',
  `reason` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '退货原因',
  `qa_id` int(10) UNSIGNED NOT NULL COMMENT '质检员ID',
  `payment` decimal(10, 2) UNSIGNED NOT NULL COMMENT '退款金额',
  `payment_type` tinyint(3) UNSIGNED NOT NULL COMMENT '退款方式：1借记卡，2信用卡，3微信，4支付宝，5现金',
  `status` tinyint(3) UNSIGNED NOT NULL COMMENT '状态：1退货成功,2无法退货',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_order_id`(`order_id`) USING BTREE,
  INDEX `idx_qa_id`(`qa_id`) USING BTREE,
  INDEX `idx_status`(`status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '退货表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_backstock
-- ----------------------------

-- ----------------------------
-- Table structure for t_brand
-- ----------------------------
DROP TABLE IF EXISTS `t_brand`;
CREATE TABLE `t_brand`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '品牌名称',
  `image` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商标图片',
  `letter` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '品牌首字母',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `unq_name`(`name`) USING BTREE,
  INDEX `idx_letter`(`letter`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_brand
-- ----------------------------
INSERT INTO `t_brand` VALUES (1, '联想', 'https://p1.lefile.cn/product/adminweb/2018/12/13/2d4534f6-29f3-4a05-8e68-97d9904c7bd2.png', 'L');
INSERT INTO `t_brand` VALUES (2, '小米', 'https://s02.mifile.cn/assets/static/image/logo-mi2.png', 'X');
INSERT INTO `t_brand` VALUES (3, '苹果', 'https://dss2.baidu.com/6ONYsjip0QIZ8tyhnq/it/u=3652116195,1176156622&fm=84&app=100&f=JPEG?w=255&h=255', 'P');
INSERT INTO `t_brand` VALUES (4, '华为', 'https://www.huawei.com//cnwww-file.huawei.com/-/media/corporate/images/home/logo/huawei_logo.png', 'H');
INSERT INTO `t_brand` VALUES (5, '酷派', 'https://www.coolpad.com/static/img/logo-white.91219c3.png', 'K');
INSERT INTO `t_brand` VALUES (6, '魅族', 'https://pics3.baidu.com/feed/4d086e061d950a7be8f6e190f25cc7dff3d3c93c.png?token=7a361d9272d74ef86d7a84dbf413c205', 'M');

-- ----------------------------
-- Table structure for t_category
-- ----------------------------
DROP TABLE IF EXISTS `t_category`;
CREATE TABLE `t_category`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类名称',
  `parent_id` int(11) NOT NULL DEFAULT 0 COMMENT '父节点ID',
  `sort` int(11) NULL DEFAULT NULL COMMENT '排名指数',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_parent_id`(`parent_id`) USING BTREE,
  INDEX `idx_sort`(`sort`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 36 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商品分类表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_category
-- ----------------------------
INSERT INTO `t_category` VALUES (1, '手机/数码/配件', 0, 1);
INSERT INTO `t_category` VALUES (2, '电脑/办公/外设', 0, 2);
INSERT INTO `t_category` VALUES (3, '厨卫电器 生活电器', 0, 3);
INSERT INTO `t_category` VALUES (4, '手机通讯', 1, 1);
INSERT INTO `t_category` VALUES (5, '手机配件', 1, 2);
INSERT INTO `t_category` VALUES (6, '运营商', 1, 3);
INSERT INTO `t_category` VALUES (7, '摄影摄像', 1, 4);
INSERT INTO `t_category` VALUES (8, '数码配件', 1, 5);
INSERT INTO `t_category` VALUES (9, '智能设备', 1, 6);
INSERT INTO `t_category` VALUES (10, '手机', 4, 1);
INSERT INTO `t_category` VALUES (11, '移动电源', 5, 1);
INSERT INTO `t_category` VALUES (12, '手机耳机', 5, 2);
INSERT INTO `t_category` VALUES (13, '蓝牙耳机', 5, 3);
INSERT INTO `t_category` VALUES (14, '保护壳/套', 5, 4);
INSERT INTO `t_category` VALUES (15, '手机存储卡', 5, 5);
INSERT INTO `t_category` VALUES (16, '手机贴膜', 5, 6);
INSERT INTO `t_category` VALUES (17, '手机电池', 5, 7);
INSERT INTO `t_category` VALUES (18, '合约购机', 6, 1);
INSERT INTO `t_category` VALUES (19, '办手机卡', 6, 2);
INSERT INTO `t_category` VALUES (20, '装宽带', 6, 3);
INSERT INTO `t_category` VALUES (21, '单反相机', 7, 1);
INSERT INTO `t_category` VALUES (22, '数码相机', 7, 2);
INSERT INTO `t_category` VALUES (23, '摄像机', 7, 3);
INSERT INTO `t_category` VALUES (24, '拍立得', 7, 4);
INSERT INTO `t_category` VALUES (25, '镜头', 7, 5);
INSERT INTO `t_category` VALUES (26, '航拍摄像', 7, 6);
INSERT INTO `t_category` VALUES (27, '运动相机', 7, 7);
INSERT INTO `t_category` VALUES (28, '数码相框', 7, 8);
INSERT INTO `t_category` VALUES (29, '电脑整机', 2, 1);
INSERT INTO `t_category` VALUES (30, 'DIY硬件', 2, 2);
INSERT INTO `t_category` VALUES (31, '存储设备', 2, 3);
INSERT INTO `t_category` VALUES (32, '电脑外设', 2, 4);
INSERT INTO `t_category` VALUES (33, '办公打印', 2, 5);
INSERT INTO `t_category` VALUES (34, '笔记本', 29, 1);
INSERT INTO `t_category` VALUES (35, '平板电脑', 29, 2);

-- ----------------------------
-- Table structure for t_category_brand
-- ----------------------------
DROP TABLE IF EXISTS `t_category_brand`;
CREATE TABLE `t_category_brand`  (
  `category_id` int(11) NOT NULL COMMENT '分类id',
  `brand_id` int(11) NOT NULL COMMENT '品牌id',
  PRIMARY KEY (`category_id`, `brand_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '分类品牌关系表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_category_brand
-- ----------------------------
INSERT INTO `t_category_brand` VALUES (10, 0);
INSERT INTO `t_category_brand` VALUES (10, 1);
INSERT INTO `t_category_brand` VALUES (10, 2);
INSERT INTO `t_category_brand` VALUES (10, 3);
INSERT INTO `t_category_brand` VALUES (10, 4);
INSERT INTO `t_category_brand` VALUES (10, 6);
INSERT INTO `t_category_brand` VALUES (10, 7);
INSERT INTO `t_category_brand` VALUES (10, 8);
INSERT INTO `t_category_brand` VALUES (10, 9);
INSERT INTO `t_category_brand` VALUES (10, 10);

-- ----------------------------
-- Table structure for t_city
-- ----------------------------
DROP TABLE IF EXISTS `t_city`;
CREATE TABLE `t_city`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `city` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '城市',
  `province_id` int(10) UNSIGNED NOT NULL COMMENT '省份ID',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `uni_city`(`city`(191)) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 343 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '城市表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_city
-- ----------------------------
INSERT INTO `t_city` VALUES (1, '北京市', 1, 0);
INSERT INTO `t_city` VALUES (2, '上海市', 2, 0);
INSERT INTO `t_city` VALUES (3, '天津市', 3, 0);
INSERT INTO `t_city` VALUES (4, '重庆市', 4, 0);
INSERT INTO `t_city` VALUES (5, '沈阳市', 5, 0);
INSERT INTO `t_city` VALUES (6, '大连市', 5, 0);
INSERT INTO `t_city` VALUES (7, '鞍山市', 5, 0);
INSERT INTO `t_city` VALUES (8, '抚顺市', 5, 0);
INSERT INTO `t_city` VALUES (9, '本溪市', 5, 0);
INSERT INTO `t_city` VALUES (10, '丹东市', 5, 0);
INSERT INTO `t_city` VALUES (11, '锦州市', 5, 0);
INSERT INTO `t_city` VALUES (12, '营口市', 5, 0);
INSERT INTO `t_city` VALUES (13, '阜新市', 5, 0);
INSERT INTO `t_city` VALUES (14, '辽阳市', 5, 0);
INSERT INTO `t_city` VALUES (15, '盘锦市', 5, 0);
INSERT INTO `t_city` VALUES (16, '铁岭市', 5, 0);
INSERT INTO `t_city` VALUES (17, '朝阳市', 5, 0);
INSERT INTO `t_city` VALUES (18, '葫芦岛市', 5, 0);
INSERT INTO `t_city` VALUES (19, '长春市', 6, 0);
INSERT INTO `t_city` VALUES (20, '吉林市', 6, 0);
INSERT INTO `t_city` VALUES (21, '四平市', 6, 0);
INSERT INTO `t_city` VALUES (22, '辽源市', 6, 0);
INSERT INTO `t_city` VALUES (23, '通化市', 6, 0);
INSERT INTO `t_city` VALUES (24, '白山市', 6, 0);
INSERT INTO `t_city` VALUES (25, '松原市', 6, 0);
INSERT INTO `t_city` VALUES (26, '白城市', 6, 0);
INSERT INTO `t_city` VALUES (27, '延边朝鲜族自治州', 6, 0);
INSERT INTO `t_city` VALUES (28, '哈尔滨市', 7, 0);
INSERT INTO `t_city` VALUES (29, '齐齐哈尔市', 7, 0);
INSERT INTO `t_city` VALUES (30, '鹤 岗 市', 7, 0);
INSERT INTO `t_city` VALUES (31, '双鸭山市', 7, 0);
INSERT INTO `t_city` VALUES (32, '鸡 西 市', 7, 0);
INSERT INTO `t_city` VALUES (33, '大 庆 市', 7, 0);
INSERT INTO `t_city` VALUES (34, '伊 春 市', 7, 0);
INSERT INTO `t_city` VALUES (35, '牡丹江市', 7, 0);
INSERT INTO `t_city` VALUES (36, '佳木斯市', 7, 0);
INSERT INTO `t_city` VALUES (37, '七台河市', 7, 0);
INSERT INTO `t_city` VALUES (38, '黑 河 市', 7, 0);
INSERT INTO `t_city` VALUES (39, '绥 化 市', 7, 0);
INSERT INTO `t_city` VALUES (40, '大兴安岭地区', 7, 0);
INSERT INTO `t_city` VALUES (41, '济南市', 8, 0);
INSERT INTO `t_city` VALUES (42, '青岛市', 8, 0);
INSERT INTO `t_city` VALUES (43, '淄博市', 8, 0);
INSERT INTO `t_city` VALUES (44, '枣庄市', 8, 0);
INSERT INTO `t_city` VALUES (45, '东营市', 8, 0);
INSERT INTO `t_city` VALUES (46, '烟台市', 8, 0);
INSERT INTO `t_city` VALUES (47, '潍坊市', 8, 0);
INSERT INTO `t_city` VALUES (48, '济宁市', 8, 0);
INSERT INTO `t_city` VALUES (49, '泰安市', 8, 0);
INSERT INTO `t_city` VALUES (50, '威海市', 8, 0);
INSERT INTO `t_city` VALUES (51, '日照市', 8, 0);
INSERT INTO `t_city` VALUES (52, '莱芜市', 8, 0);
INSERT INTO `t_city` VALUES (53, '临沂市', 8, 0);
INSERT INTO `t_city` VALUES (54, '德州市', 8, 0);
INSERT INTO `t_city` VALUES (55, '聊城市', 8, 0);
INSERT INTO `t_city` VALUES (56, '滨州市', 8, 0);
INSERT INTO `t_city` VALUES (57, '菏泽市', 8, 0);
INSERT INTO `t_city` VALUES (58, '台北市', 34, 0);
INSERT INTO `t_city` VALUES (59, '高雄市', 34, 0);
INSERT INTO `t_city` VALUES (60, '基隆市', 34, 0);
INSERT INTO `t_city` VALUES (61, '台中市', 34, 0);
INSERT INTO `t_city` VALUES (62, '台南市', 34, 0);
INSERT INTO `t_city` VALUES (63, '新竹市', 34, 0);
INSERT INTO `t_city` VALUES (64, '嘉义市', 34, 0);
INSERT INTO `t_city` VALUES (65, '台北县', 34, 0);
INSERT INTO `t_city` VALUES (66, '宜兰县', 34, 0);
INSERT INTO `t_city` VALUES (67, '桃园县', 34, 0);
INSERT INTO `t_city` VALUES (68, '新竹县', 34, 0);
INSERT INTO `t_city` VALUES (69, '苗栗县', 34, 0);
INSERT INTO `t_city` VALUES (70, '台中县', 34, 0);
INSERT INTO `t_city` VALUES (71, '彰化县', 34, 0);
INSERT INTO `t_city` VALUES (72, '南投县', 34, 0);
INSERT INTO `t_city` VALUES (73, '云林县', 34, 0);
INSERT INTO `t_city` VALUES (74, '嘉义县', 34, 0);
INSERT INTO `t_city` VALUES (75, '台南县', 34, 0);
INSERT INTO `t_city` VALUES (76, '高雄县', 34, 0);
INSERT INTO `t_city` VALUES (77, '屏东县', 34, 0);
INSERT INTO `t_city` VALUES (78, '澎湖县', 34, 0);
INSERT INTO `t_city` VALUES (79, '台东县', 34, 0);
INSERT INTO `t_city` VALUES (80, '花莲县', 34, 0);
INSERT INTO `t_city` VALUES (81, '香港特别行政区', 32, 0);
INSERT INTO `t_city` VALUES (82, '澳门特别行政区', 33, 0);
INSERT INTO `t_city` VALUES (83, '西安市', 25, 0);
INSERT INTO `t_city` VALUES (84, '铜川市', 25, 0);
INSERT INTO `t_city` VALUES (85, '宝鸡市', 25, 0);
INSERT INTO `t_city` VALUES (86, '咸阳市', 25, 0);
INSERT INTO `t_city` VALUES (87, '渭南市', 25, 0);
INSERT INTO `t_city` VALUES (88, '延安市', 25, 0);
INSERT INTO `t_city` VALUES (89, '汉中市', 25, 0);
INSERT INTO `t_city` VALUES (90, '榆林市', 25, 0);
INSERT INTO `t_city` VALUES (91, '安康市', 25, 0);
INSERT INTO `t_city` VALUES (92, '商洛市', 25, 0);
INSERT INTO `t_city` VALUES (93, '兰州市', 26, 0);
INSERT INTO `t_city` VALUES (94, '金昌市', 26, 0);
INSERT INTO `t_city` VALUES (95, '白银市', 26, 0);
INSERT INTO `t_city` VALUES (96, '天水市', 26, 0);
INSERT INTO `t_city` VALUES (97, '嘉峪关市', 26, 0);
INSERT INTO `t_city` VALUES (98, '武威市', 26, 0);
INSERT INTO `t_city` VALUES (99, '张掖市', 26, 0);
INSERT INTO `t_city` VALUES (100, '平凉市', 26, 0);
INSERT INTO `t_city` VALUES (101, '酒泉市', 26, 0);
INSERT INTO `t_city` VALUES (102, '庆阳市', 26, 0);
INSERT INTO `t_city` VALUES (103, '定西市', 26, 0);
INSERT INTO `t_city` VALUES (104, '陇南市', 26, 0);
INSERT INTO `t_city` VALUES (105, '临夏回族自治州', 26, 0);
INSERT INTO `t_city` VALUES (106, '甘南藏族自治州', 26, 0);
INSERT INTO `t_city` VALUES (107, '乌鲁木齐市', 27, 0);
INSERT INTO `t_city` VALUES (108, '克拉玛依市', 27, 0);
INSERT INTO `t_city` VALUES (109, '石河子市　', 27, 0);
INSERT INTO `t_city` VALUES (110, '阿拉尔市', 27, 0);
INSERT INTO `t_city` VALUES (111, '图木舒克市', 27, 0);
INSERT INTO `t_city` VALUES (112, '五家渠市', 27, 0);
INSERT INTO `t_city` VALUES (113, '吐鲁番市', 27, 0);
INSERT INTO `t_city` VALUES (114, '阿克苏市', 27, 0);
INSERT INTO `t_city` VALUES (115, '喀什市', 27, 0);
INSERT INTO `t_city` VALUES (116, '哈密市', 27, 0);
INSERT INTO `t_city` VALUES (117, '和田市', 27, 0);
INSERT INTO `t_city` VALUES (118, '阿图什市', 27, 0);
INSERT INTO `t_city` VALUES (119, '库尔勒市', 27, 0);
INSERT INTO `t_city` VALUES (120, '昌吉市　', 27, 0);
INSERT INTO `t_city` VALUES (121, '阜康市', 27, 0);
INSERT INTO `t_city` VALUES (122, '米泉市', 27, 0);
INSERT INTO `t_city` VALUES (123, '博乐市', 27, 0);
INSERT INTO `t_city` VALUES (124, '伊宁市', 27, 0);
INSERT INTO `t_city` VALUES (125, '奎屯市', 27, 0);
INSERT INTO `t_city` VALUES (126, '塔城市', 27, 0);
INSERT INTO `t_city` VALUES (127, '乌苏市', 27, 0);
INSERT INTO `t_city` VALUES (128, '阿勒泰市', 27, 0);
INSERT INTO `t_city` VALUES (129, '成都市', 28, 0);
INSERT INTO `t_city` VALUES (130, '自贡市', 28, 0);
INSERT INTO `t_city` VALUES (131, '攀枝花市', 28, 0);
INSERT INTO `t_city` VALUES (132, '石家庄市', 20, 0);
INSERT INTO `t_city` VALUES (133, '唐山市', 20, 0);
INSERT INTO `t_city` VALUES (134, '秦皇岛市', 20, 0);
INSERT INTO `t_city` VALUES (135, '邯郸市', 20, 0);
INSERT INTO `t_city` VALUES (136, '邢台市', 20, 0);
INSERT INTO `t_city` VALUES (137, '保定市', 20, 0);
INSERT INTO `t_city` VALUES (138, '张家口市', 20, 0);
INSERT INTO `t_city` VALUES (139, '承德市', 20, 0);
INSERT INTO `t_city` VALUES (140, '沧州市', 20, 0);
INSERT INTO `t_city` VALUES (141, '廊坊市', 20, 0);
INSERT INTO `t_city` VALUES (142, '衡水市', 20, 0);
INSERT INTO `t_city` VALUES (143, '太原市', 21, 0);
INSERT INTO `t_city` VALUES (144, '大同市', 21, 0);
INSERT INTO `t_city` VALUES (145, '阳泉市', 21, 0);
INSERT INTO `t_city` VALUES (146, '长治市', 21, 0);
INSERT INTO `t_city` VALUES (147, '晋城市', 21, 0);
INSERT INTO `t_city` VALUES (148, '朔州市', 21, 0);
INSERT INTO `t_city` VALUES (149, '晋中市', 21, 0);
INSERT INTO `t_city` VALUES (150, '运城市', 21, 0);
INSERT INTO `t_city` VALUES (151, '忻州市', 21, 0);
INSERT INTO `t_city` VALUES (152, '临汾市', 21, 0);
INSERT INTO `t_city` VALUES (153, '吕梁市', 21, 0);
INSERT INTO `t_city` VALUES (154, '呼和浩特市', 22, 0);
INSERT INTO `t_city` VALUES (155, '包头市', 22, 0);
INSERT INTO `t_city` VALUES (156, '乌海市', 22, 0);
INSERT INTO `t_city` VALUES (157, '赤峰市', 22, 0);
INSERT INTO `t_city` VALUES (158, '通辽市', 22, 0);
INSERT INTO `t_city` VALUES (159, '鄂尔多斯市', 22, 0);
INSERT INTO `t_city` VALUES (160, '呼伦贝尔市', 22, 0);
INSERT INTO `t_city` VALUES (161, '巴彦淖尔市', 22, 0);
INSERT INTO `t_city` VALUES (162, '乌兰察布市', 22, 0);
INSERT INTO `t_city` VALUES (163, '锡林郭勒盟', 22, 0);
INSERT INTO `t_city` VALUES (164, '兴安盟', 22, 0);
INSERT INTO `t_city` VALUES (165, '阿拉善盟', 22, 0);
INSERT INTO `t_city` VALUES (166, '银川市', 23, 0);
INSERT INTO `t_city` VALUES (167, '石嘴山市', 23, 0);
INSERT INTO `t_city` VALUES (168, '吴忠市', 23, 0);
INSERT INTO `t_city` VALUES (169, '固原市', 23, 0);
INSERT INTO `t_city` VALUES (170, '中卫市', 23, 0);
INSERT INTO `t_city` VALUES (171, '西宁市', 24, 0);
INSERT INTO `t_city` VALUES (172, '海东地区', 24, 0);
INSERT INTO `t_city` VALUES (173, '海北藏族自治州', 24, 0);
INSERT INTO `t_city` VALUES (174, '黄南藏族自治州', 24, 0);
INSERT INTO `t_city` VALUES (175, '海南藏族自治州', 24, 0);
INSERT INTO `t_city` VALUES (176, '果洛藏族自治州', 24, 0);
INSERT INTO `t_city` VALUES (177, '玉树藏族自治州', 24, 0);
INSERT INTO `t_city` VALUES (178, '海西蒙古族藏族自治州', 24, 0);
INSERT INTO `t_city` VALUES (179, '武汉市', 19, 0);
INSERT INTO `t_city` VALUES (180, '黄石市', 19, 0);
INSERT INTO `t_city` VALUES (181, '十堰市', 19, 0);
INSERT INTO `t_city` VALUES (182, '荆州市', 19, 0);
INSERT INTO `t_city` VALUES (183, '宜昌市', 19, 0);
INSERT INTO `t_city` VALUES (184, '襄樊市', 19, 0);
INSERT INTO `t_city` VALUES (185, '鄂州市', 19, 0);
INSERT INTO `t_city` VALUES (186, '荆门市', 19, 0);
INSERT INTO `t_city` VALUES (187, '孝感市', 19, 0);
INSERT INTO `t_city` VALUES (188, '黄冈市', 19, 0);
INSERT INTO `t_city` VALUES (189, '咸宁市', 19, 0);
INSERT INTO `t_city` VALUES (190, '随州市', 19, 0);
INSERT INTO `t_city` VALUES (191, '仙桃市', 19, 0);
INSERT INTO `t_city` VALUES (192, '天门市', 19, 0);
INSERT INTO `t_city` VALUES (193, '潜江市', 19, 0);
INSERT INTO `t_city` VALUES (194, '神农架林区', 19, 0);
INSERT INTO `t_city` VALUES (195, '恩施土家族苗族自治州', 19, 0);
INSERT INTO `t_city` VALUES (196, '长沙市', 18, 0);
INSERT INTO `t_city` VALUES (197, '株洲市', 18, 0);
INSERT INTO `t_city` VALUES (198, '湘潭市', 18, 0);
INSERT INTO `t_city` VALUES (199, '衡阳市', 18, 0);
INSERT INTO `t_city` VALUES (200, '邵阳市', 18, 0);
INSERT INTO `t_city` VALUES (201, '岳阳市', 18, 0);
INSERT INTO `t_city` VALUES (202, '常德市', 18, 0);
INSERT INTO `t_city` VALUES (203, '张家界市', 18, 0);
INSERT INTO `t_city` VALUES (204, '益阳市', 18, 0);
INSERT INTO `t_city` VALUES (205, '郴州市', 18, 0);
INSERT INTO `t_city` VALUES (206, '永州市', 18, 0);
INSERT INTO `t_city` VALUES (207, '怀化市', 18, 0);
INSERT INTO `t_city` VALUES (208, '娄底市', 18, 0);
INSERT INTO `t_city` VALUES (209, '湘西土家族苗族自治州', 18, 0);
INSERT INTO `t_city` VALUES (210, '郑州市', 17, 0);
INSERT INTO `t_city` VALUES (211, '开封市', 17, 0);
INSERT INTO `t_city` VALUES (212, '洛阳市', 17, 0);
INSERT INTO `t_city` VALUES (213, '平顶山市', 17, 0);
INSERT INTO `t_city` VALUES (214, ' ', 17, 0);
INSERT INTO `t_city` VALUES (215, '鹤壁市', 17, 0);
INSERT INTO `t_city` VALUES (216, '新乡市', 17, 0);
INSERT INTO `t_city` VALUES (217, '焦作市', 17, 0);
INSERT INTO `t_city` VALUES (218, '濮阳市', 17, 0);
INSERT INTO `t_city` VALUES (219, '许昌市', 17, 0);
INSERT INTO `t_city` VALUES (220, '漯河市', 17, 0);
INSERT INTO `t_city` VALUES (221, '三门峡市', 17, 0);
INSERT INTO `t_city` VALUES (222, '南阳市', 17, 0);
INSERT INTO `t_city` VALUES (223, '商丘市', 17, 0);
INSERT INTO `t_city` VALUES (224, '信阳市', 17, 0);
INSERT INTO `t_city` VALUES (225, '周口市', 17, 0);
INSERT INTO `t_city` VALUES (226, '驻马店市', 17, 0);
INSERT INTO `t_city` VALUES (227, '济源市', 17, 0);
INSERT INTO `t_city` VALUES (228, '海口市', 16, 0);
INSERT INTO `t_city` VALUES (229, '三亚市', 16, 0);
INSERT INTO `t_city` VALUES (230, '五指山市', 16, 0);
INSERT INTO `t_city` VALUES (231, '琼海市', 16, 0);
INSERT INTO `t_city` VALUES (232, '儋州市', 16, 0);
INSERT INTO `t_city` VALUES (233, '文昌市', 16, 0);
INSERT INTO `t_city` VALUES (234, '万宁市', 16, 0);
INSERT INTO `t_city` VALUES (235, '东方市', 16, 0);
INSERT INTO `t_city` VALUES (236, '澄迈县', 16, 0);
INSERT INTO `t_city` VALUES (237, '定安县', 16, 0);
INSERT INTO `t_city` VALUES (238, '屯昌县', 16, 0);
INSERT INTO `t_city` VALUES (239, '临高县', 16, 0);
INSERT INTO `t_city` VALUES (240, '白沙黎族自治县', 16, 0);
INSERT INTO `t_city` VALUES (241, '昌江黎族自治县', 16, 0);
INSERT INTO `t_city` VALUES (242, '乐东黎族自治县', 16, 0);
INSERT INTO `t_city` VALUES (243, '陵水黎族自治县', 16, 0);
INSERT INTO `t_city` VALUES (244, '保亭黎族苗族自治县', 16, 0);
INSERT INTO `t_city` VALUES (245, '琼中黎族苗族自治县', 16, 0);
INSERT INTO `t_city` VALUES (246, '合肥市', 11, 0);
INSERT INTO `t_city` VALUES (247, '芜湖市', 11, 0);
INSERT INTO `t_city` VALUES (248, '蚌埠市', 11, 0);
INSERT INTO `t_city` VALUES (249, '淮南市', 11, 0);
INSERT INTO `t_city` VALUES (250, '马鞍山市', 11, 0);
INSERT INTO `t_city` VALUES (251, '淮北市', 11, 0);
INSERT INTO `t_city` VALUES (252, '铜陵市', 11, 0);
INSERT INTO `t_city` VALUES (253, '安庆市', 11, 0);
INSERT INTO `t_city` VALUES (254, '黄山市', 11, 0);
INSERT INTO `t_city` VALUES (255, '滁州市', 11, 0);
INSERT INTO `t_city` VALUES (256, '阜阳市', 11, 0);
INSERT INTO `t_city` VALUES (257, '宿州市', 11, 0);
INSERT INTO `t_city` VALUES (258, '巢湖市', 11, 0);
INSERT INTO `t_city` VALUES (259, '六安市', 11, 0);
INSERT INTO `t_city` VALUES (260, '亳州市', 11, 0);
INSERT INTO `t_city` VALUES (261, '池州市', 11, 0);
INSERT INTO `t_city` VALUES (262, '宣城市', 11, 0);
INSERT INTO `t_city` VALUES (263, '福州市', 12, 0);
INSERT INTO `t_city` VALUES (264, '厦门市', 12, 0);
INSERT INTO `t_city` VALUES (265, '莆田市', 12, 0);
INSERT INTO `t_city` VALUES (266, '三明市', 12, 0);
INSERT INTO `t_city` VALUES (267, '泉州市', 12, 0);
INSERT INTO `t_city` VALUES (268, '漳州市', 12, 0);
INSERT INTO `t_city` VALUES (269, '南平市', 12, 0);
INSERT INTO `t_city` VALUES (270, '龙岩市', 12, 0);
INSERT INTO `t_city` VALUES (271, '宁德市', 12, 0);
INSERT INTO `t_city` VALUES (272, '南昌市', 13, 0);
INSERT INTO `t_city` VALUES (273, '景德镇市', 13, 0);
INSERT INTO `t_city` VALUES (274, '萍乡市', 13, 0);
INSERT INTO `t_city` VALUES (275, '九江市', 13, 0);
INSERT INTO `t_city` VALUES (276, '新余市', 13, 0);
INSERT INTO `t_city` VALUES (277, '鹰潭市', 13, 0);
INSERT INTO `t_city` VALUES (278, '赣州市', 13, 0);
INSERT INTO `t_city` VALUES (279, '吉安市', 13, 0);
INSERT INTO `t_city` VALUES (280, '宜春市', 13, 0);
INSERT INTO `t_city` VALUES (281, '抚州市', 13, 0);
INSERT INTO `t_city` VALUES (282, '上饶市', 13, 0);
INSERT INTO `t_city` VALUES (283, '广州市', 14, 0);
INSERT INTO `t_city` VALUES (284, '深圳市', 14, 0);
INSERT INTO `t_city` VALUES (285, '珠海市', 14, 0);
INSERT INTO `t_city` VALUES (286, '汕头市', 14, 0);
INSERT INTO `t_city` VALUES (287, '韶关市', 14, 0);
INSERT INTO `t_city` VALUES (288, '佛山市', 14, 0);
INSERT INTO `t_city` VALUES (289, '江门市', 14, 0);
INSERT INTO `t_city` VALUES (290, '湛江市', 14, 0);
INSERT INTO `t_city` VALUES (291, '茂名市', 14, 0);
INSERT INTO `t_city` VALUES (292, '肇庆市', 14, 0);
INSERT INTO `t_city` VALUES (293, '惠州市', 14, 0);
INSERT INTO `t_city` VALUES (294, '梅州市', 14, 0);
INSERT INTO `t_city` VALUES (295, '汕尾市', 14, 0);
INSERT INTO `t_city` VALUES (296, '河源市', 14, 0);
INSERT INTO `t_city` VALUES (297, '阳江市', 14, 0);
INSERT INTO `t_city` VALUES (298, '清远市', 14, 0);
INSERT INTO `t_city` VALUES (299, '东莞市', 14, 0);
INSERT INTO `t_city` VALUES (300, '中山市', 14, 0);
INSERT INTO `t_city` VALUES (301, '潮州市', 14, 0);
INSERT INTO `t_city` VALUES (302, '揭阳市', 14, 0);
INSERT INTO `t_city` VALUES (303, '云浮市', 14, 0);
INSERT INTO `t_city` VALUES (304, '南宁市', 15, 0);
INSERT INTO `t_city` VALUES (305, '柳州市', 15, 0);
INSERT INTO `t_city` VALUES (306, '桂林市', 15, 0);
INSERT INTO `t_city` VALUES (307, '梧州市', 15, 0);
INSERT INTO `t_city` VALUES (308, '北海市', 15, 0);
INSERT INTO `t_city` VALUES (309, '防城港市', 15, 0);
INSERT INTO `t_city` VALUES (310, '钦州市', 15, 0);
INSERT INTO `t_city` VALUES (311, '贵港市', 15, 0);
INSERT INTO `t_city` VALUES (312, '玉林市', 15, 0);
INSERT INTO `t_city` VALUES (313, '百色市', 15, 0);
INSERT INTO `t_city` VALUES (314, '贺州市', 15, 0);
INSERT INTO `t_city` VALUES (315, '河池市', 15, 0);
INSERT INTO `t_city` VALUES (316, '来宾市', 15, 0);
INSERT INTO `t_city` VALUES (317, '崇左市', 15, 0);
INSERT INTO `t_city` VALUES (318, '南京市', 11, 0);
INSERT INTO `t_city` VALUES (319, '无锡市', 11, 0);
INSERT INTO `t_city` VALUES (320, '徐州市', 11, 0);
INSERT INTO `t_city` VALUES (321, '常州市', 11, 0);
INSERT INTO `t_city` VALUES (322, '苏州市', 11, 0);
INSERT INTO `t_city` VALUES (323, '南通市', 11, 0);
INSERT INTO `t_city` VALUES (324, '连云港市', 11, 0);
INSERT INTO `t_city` VALUES (325, '淮安市', 11, 0);
INSERT INTO `t_city` VALUES (326, '盐城市', 11, 0);
INSERT INTO `t_city` VALUES (327, '扬州市', 11, 0);
INSERT INTO `t_city` VALUES (328, '镇江市', 11, 0);
INSERT INTO `t_city` VALUES (329, '泰州市', 11, 0);
INSERT INTO `t_city` VALUES (330, '宿迁市', 11, 0);
INSERT INTO `t_city` VALUES (331, '杭州市', 12, 0);
INSERT INTO `t_city` VALUES (332, '宁波市', 12, 0);
INSERT INTO `t_city` VALUES (333, '温州市', 12, 0);
INSERT INTO `t_city` VALUES (334, '嘉兴市', 12, 0);
INSERT INTO `t_city` VALUES (335, '湖州市', 12, 0);
INSERT INTO `t_city` VALUES (336, '绍兴市', 12, 0);
INSERT INTO `t_city` VALUES (337, '金华市', 12, 0);
INSERT INTO `t_city` VALUES (338, '衢州市', 12, 0);
INSERT INTO `t_city` VALUES (339, '舟山市', 12, 0);
INSERT INTO `t_city` VALUES (340, '台州市', 12, 0);
INSERT INTO `t_city` VALUES (341, '丽水市', 12, 0);
INSERT INTO `t_city` VALUES (342, '丽水市', 12, 0);

-- ----------------------------
-- Table structure for t_customer_address
-- ----------------------------
DROP TABLE IF EXISTS `t_customer_address`;
CREATE TABLE `t_customer_address`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `customer_id` int(10) UNSIGNED NOT NULL COMMENT '客户ID',
  `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '姓名',
  `tel` char(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '电话',
  `address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '地址',
  `prime` tinyint(1) NOT NULL COMMENT '默认地址',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_customer_id`(`customer_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客户收货地址表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_customer_address
-- ----------------------------

-- ----------------------------
-- Table structure for t_dept
-- ----------------------------
DROP TABLE IF EXISTS `t_dept`;
CREATE TABLE `t_dept`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `dname` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '部门名称',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `unq_dname`(`dname`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '部门表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_dept
-- ----------------------------

-- ----------------------------
-- Table structure for t_job
-- ----------------------------
DROP TABLE IF EXISTS `t_job`;
CREATE TABLE `t_job`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `job` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '职位名称',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `unq_job`(`job`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '职位表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_job
-- ----------------------------

-- ----------------------------
-- Table structure for t_level
-- ----------------------------
DROP TABLE IF EXISTS `t_level`;
CREATE TABLE `t_level`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `level` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '等级名称',
  `discount` decimal(10, 2) UNSIGNED NOT 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 t_level
-- ----------------------------

-- ----------------------------
-- Table structure for t_order
-- ----------------------------
DROP TABLE IF EXISTS `t_order`;
CREATE TABLE `t_order`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `code` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流水号',
  `type` tinyint(3) UNSIGNED NOT NULL COMMENT '订单类型：1实体销售,2网络销售',
  `shop_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '零售店ID',
  `customer_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '会员ID',
  `amount` decimal(10, 2) UNSIGNED NOT NULL COMMENT '总金额',
  `payment_type` tinyint(3) UNSIGNED NOT NULL COMMENT '支付方式：1借记卡,2信用卡,3微信,4支付宝,5现金',
  `status` tinyint(3) UNSIGNED NOT NULL COMMENT '状态：1未付款,2已付款,3已发货,4已签收',
  `postage` decimal(10, 2) UNSIGNED NULL DEFAULT NULL COMMENT '邮费',
  `weight` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '重量（克）',
  `voucher_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '购物券ID',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `unq_code`(`code`) USING BTREE,
  INDEX `idx_code`(`code`) USING BTREE,
  INDEX `idx_customer_id`(`customer_id`) USING BTREE,
  INDEX `idx_status`(`status`) USING BTREE,
  INDEX `idx_create_time`(`create_time`) USING BTREE,
  INDEX `idx_type`(`type`) USING BTREE,
  INDEX `idx_shop_id`(`shop_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_order
-- ----------------------------

-- ----------------------------
-- Table structure for t_order_detail
-- ----------------------------
DROP TABLE IF EXISTS `t_order_detail`;
CREATE TABLE `t_order_detail`  (
  `order_id` int(10) UNSIGNED NOT NULL COMMENT '订单ID',
  `sku_id` int(10) UNSIGNED NOT NULL COMMENT '商品ID',
  `price` decimal(10, 2) UNSIGNED NOT NULL COMMENT '原价格',
  `actual_price` decimal(10, 2) UNSIGNED NOT NULL COMMENT '实际购买价',
  `num` int(10) UNSIGNED NOT NULL COMMENT '购买数量',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`order_id`, `sku_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单详情表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_order_detail
-- ----------------------------

-- ----------------------------
-- Table structure for t_productin
-- ----------------------------
DROP TABLE IF EXISTS `t_productin`;
CREATE TABLE `t_productin`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `storekeeper_id` int(10) UNSIGNED NOT NULL COMMENT '保管员ID',
  `amount` decimal(15, 2) UNSIGNED NOT NULL COMMENT '总金额',
  `supplier_id` int(10) UNSIGNED NOT NULL COMMENT '供应商ID',
  `payment` decimal(15, 2) UNSIGNED NOT NULL COMMENT '实付金额',
  `payment_type` tinyint(3) UNSIGNED NOT NULL COMMENT '支付方式',
  `invoice` tinyint(1) NOT NULL COMMENT '是否开票',
  `remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_storekeeper_id`(`storekeeper_id`) USING BTREE,
  INDEX `idx_supplier_id`(`supplier_id`) USING BTREE,
  INDEX `idx_payment_type`(`payment_type`) USING BTREE,
  INDEX `idx_create_time`(`create_time`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '入库信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_productin
-- ----------------------------

-- ----------------------------
-- Table structure for t_province
-- ----------------------------
DROP TABLE IF EXISTS `t_province`;
CREATE TABLE `t_province`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `province` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '省份',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `unq_province`(`province`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 35 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '省份表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_province
-- ----------------------------
INSERT INTO `t_province` VALUES (1, '北京', 0);
INSERT INTO `t_province` VALUES (2, '上海', 0);
INSERT INTO `t_province` VALUES (3, '天津', 0);
INSERT INTO `t_province` VALUES (4, '重庆', 0);
INSERT INTO `t_province` VALUES (5, '辽宁', 0);
INSERT INTO `t_province` VALUES (6, '吉林', 0);
INSERT INTO `t_province` VALUES (7, '黑龙江', 0);
INSERT INTO `t_province` VALUES (8, '山东', 0);
INSERT INTO `t_province` VALUES (9, '江苏', 0);
INSERT INTO `t_province` VALUES (10, '浙江', 0);
INSERT INTO `t_province` VALUES (11, '安徽', 0);
INSERT INTO `t_province` VALUES (12, '福建', 0);
INSERT INTO `t_province` VALUES (13, '江西', 0);
INSERT INTO `t_province` VALUES (14, '广东', 0);
INSERT INTO `t_province` VALUES (15, '广西', 0);
INSERT INTO `t_province` VALUES (16, '海南', 0);
INSERT INTO `t_province` VALUES (17, '河南', 0);
INSERT INTO `t_province` VALUES (18, '湖南', 0);
INSERT INTO `t_province` VALUES (19, '湖北', 0);
INSERT INTO `t_province` VALUES (20, '河北', 0);
INSERT INTO `t_province` VALUES (21, '山西', 0);
INSERT INTO `t_province` VALUES (22, '内蒙古', 0);
INSERT INTO `t_province` VALUES (23, '宁夏', 0);
INSERT INTO `t_province` VALUES (24, '青海', 0);
INSERT INTO `t_province` VALUES (25, '陕西', 0);
INSERT INTO `t_province` VALUES (26, '甘肃', 0);
INSERT INTO `t_province` VALUES (27, '新疆', 0);
INSERT INTO `t_province` VALUES (28, '四川', 0);
INSERT INTO `t_province` VALUES (29, '贵州', 0);
INSERT INTO `t_province` VALUES (30, '云南', 0);
INSERT INTO `t_province` VALUES (31, '西藏', 0);
INSERT INTO `t_province` VALUES (32, '香港', 0);
INSERT INTO `t_province` VALUES (33, '澳门', 0);
INSERT INTO `t_province` VALUES (34, '台湾', 0);

-- ----------------------------
-- Table structure for t_purchase
-- ----------------------------
DROP TABLE IF EXISTS `t_purchase`;
CREATE TABLE `t_purchase`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `sku_id` int(10) UNSIGNED NOT NULL COMMENT '商品ID',
  `num` int(10) UNSIGNED NOT NULL COMMENT '数量',
  `warehouse_id` int(10) UNSIGNED NOT NULL COMMENT '仓库ID',
  `in_price` decimal(10, 2) UNSIGNED NOT NULL COMMENT '采购价格',
  `out_price` decimal(10, 2) UNSIGNED NULL DEFAULT NULL COMMENT '建议零售价',
  `buyer_id` int(10) UNSIGNED NOT NULL COMMENT '采购员ID',
  `status` tinyint(3) UNSIGNED NOT NULL COMMENT '状态：1未完成,2已完成',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_sku_id`(`sku_id`) USING BTREE,
  INDEX `idx_warehouse_id`(`warehouse_id`) USING BTREE,
  INDEX `idx_buyer_id`(`buyer_id`) USING BTREE,
  INDEX `idx_status`(`status`) USING BTREE,
  INDEX `idx_create_time`(`create_time`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '采购表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_purchase
-- ----------------------------

-- ----------------------------
-- Table structure for t_rating
-- ----------------------------
DROP TABLE IF EXISTS `t_rating`;
CREATE TABLE `t_rating`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '评价ID',
  `order_id` int(10) UNSIGNED NOT NULL COMMENT '订单ID',
  `sku_id` int(10) UNSIGNED NOT NULL COMMENT '商品ID',
  `img` json NULL COMMENT '买家晒图',
  `rating` tinyint(3) UNSIGNED NOT NULL COMMENT '评分',
  `comment` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '评论',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_order_id`(`order_id`) USING BTREE,
  INDEX `idx_sku_id`(`sku_id`) USING BTREE,
  INDEX `idx_create_time`(`create_time`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '评价表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_rating
-- ----------------------------

-- ----------------------------
-- Table structure for t_role
-- ----------------------------
DROP TABLE IF EXISTS `t_role`;
CREATE TABLE `t_role`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `role` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名称',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `unq_role`(`role`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_role
-- ----------------------------

-- ----------------------------
-- Table structure for t_shop
-- ----------------------------
DROP TABLE IF EXISTS `t_shop`;
CREATE TABLE `t_shop`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `city_id` int(10) UNSIGNED NOT NULL COMMENT '城市ID',
  `address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '地址',
  `tel` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '电话',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_city_id`(`city_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '零售店表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_shop
-- ----------------------------

-- ----------------------------
-- Table structure for t_shop_sku
-- ----------------------------
DROP TABLE IF EXISTS `t_shop_sku`;
CREATE TABLE `t_shop_sku`  (
  `shop_id` int(10) UNSIGNED NOT NULL COMMENT '零售店ID',
  `sku_id` int(10) UNSIGNED NOT NULL COMMENT '商品ID',
  `num` int(10) UNSIGNED NOT NULL COMMENT '库存数量',
  `unit` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '库存单位',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`shop_id`, `sku_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '零售店商品库存表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_shop_sku
-- ----------------------------

-- ----------------------------
-- Table structure for t_sku
-- ----------------------------
DROP TABLE IF EXISTS `t_sku`;
CREATE TABLE `t_sku`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `spu_id` int(10) UNSIGNED NOT NULL COMMENT '产品ID',
  `title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '商品标题',
  `images` json NULL COMMENT '商品图片',
  `price` decimal(10, 2) UNSIGNED NOT NULL COMMENT '价格',
  `param` json NOT NULL COMMENT '参数',
  `saleable` tinyint(1) NOT NULL COMMENT '是否上架',
  `valid` tinyint(1) NOT NULL COMMENT '是否有效',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  `last_update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '最后修改时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_spu_id`(`spu_id`) USING BTREE,
  INDEX `idx_saleable`(`saleable`) USING BTREE,
  INDEX `idx_valid`(`valid`) USING BTREE,
  FULLTEXT INDEX `title`(`title`)
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商品表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_sku
-- ----------------------------
INSERT INTO `t_sku` VALUES (1, 1, 'iPhone 12 8+128G 白色 移动联通电信5G全网通手机', '{\"desc\": [\"http://127.0.0.1/3.jpg\", \"http://127.0.0.1/4.jpg\"], \"facade\": [\"http://127.0.0.1/1.jpg\", \"http://127.0.0.1/2.jpg\"]}', 6799.00, '{\"CPU\": \"A14\", \"内存\": 128, \"电池\": 3008, \"运存\": 8, \"屏幕尺寸\": 6.1}', 1, 1, '2021-07-19 19:48:37', '2021-07-19 19:48:37');
INSERT INTO `t_sku` VALUES (3, 1, 'iPhone 12 8+128G 黑色 移动联通电信5G全网通手机', '{\"desc\": [\"http://127.0.0.1/3.jpg\", \"http://127.0.0.1/4.jpg\"], \"facade\": [\"http://127.0.0.1/1.jpg\", \"http://127.0.0.1/2.jpg\"]}', 6799.00, '{\"CPU\": \"A14\", \"内存\": 128, \"电池\": 3008, \"运存\": 8, \"屏幕尺寸\": 6.1}', 1, 1, '2021-07-19 19:48:37', '2021-07-19 19:48:37');
INSERT INTO `t_sku` VALUES (4, 1, 'iPhone 12 8+128G 蓝色 移动联通电信5G全网通手机', '{\"desc\": [\"http://127.0.0.1/3.jpg\", \"http://127.0.0.1/4.jpg\"], \"facade\": [\"http://127.0.0.1/1.jpg\", \"http://127.0.0.1/2.jpg\"]}', 6799.00, '{\"CPU\": \"A14\", \"内存\": 128, \"电池\": 3008, \"运存\": 8, \"屏幕尺寸\": 6.1}', 1, 1, '2021-07-19 19:48:37', '2021-07-19 19:48:37');
INSERT INTO `t_sku` VALUES (5, 1, 'iPhone 12 8+128G 紫色 移动联通电信5G全网通手机', '{\"desc\": [\"http://127.0.0.1/3.jpg\", \"http://127.0.0.1/4.jpg\"], \"facade\": [\"http://127.0.0.1/1.jpg\", \"http://127.0.0.1/2.jpg\"]}', 6799.00, '{\"CPU\": \"A14\", \"内存\": 128, \"电池\": 3008, \"运存\": 8, \"屏幕尺寸\": 6.1}', 1, 1, '2021-07-19 19:48:37', '2021-07-19 19:48:37');
INSERT INTO `t_sku` VALUES (6, 1, 'iPhone 12 8+256G 绿色 移动联通电信5G全网通手机', '{\"desc\": [\"http://127.0.0.1/3.jpg\", \"http://127.0.0.1/4.jpg\"], \"facade\": [\"http://127.0.0.1/1.jpg\", \"http://127.0.0.1/2.jpg\"]}', 6799.00, '{\"CPU\": \"A14\", \"内存\": 256, \"电池\": 3008, \"运存\": 8, \"屏幕尺寸\": 6.1}', 1, 1, '2021-07-19 19:48:37', '2021-07-19 19:48:37');

-- ----------------------------
-- Table structure for t_spec_group
-- ----------------------------
DROP TABLE IF EXISTS `t_spec_group`;
CREATE TABLE `t_spec_group`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `spg_id` int(11) NOT NULL COMMENT '品类编号',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '品类名称',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `unq_id`(`id`) USING BTREE COMMENT '主键唯一索引',
  UNIQUE INDEX `unq_spg_id`(`spg_id`) USING BTREE COMMENT '品类编号唯一索引',
  INDEX `idex_speg_id`(`spg_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '品类表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_spec_group
-- ----------------------------
INSERT INTO `t_spec_group` VALUES (1, 10001, '手机');
INSERT INTO `t_spec_group` VALUES (2, 10002, '数据线');
INSERT INTO `t_spec_group` VALUES (3, 10003, '充电器');
INSERT INTO `t_spec_group` VALUES (4, 20001, '毛衣');
INSERT INTO `t_spec_group` VALUES (5, 20002, 'T恤');

-- ----------------------------
-- Table structure for t_spec_param
-- ----------------------------
DROP TABLE IF EXISTS `t_spec_param`;
CREATE TABLE `t_spec_param`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `spp_id` int(11) NOT NULL COMMENT '参数编号',
  `spg_id` int(11) NOT NULL COMMENT '品类编号',
  `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '参数名称',
  `numeric` tinyint(1) NOT NULL COMMENT '是否为数字参数',
  `unit` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位名称',
  `generic` tinyint(1) NOT NULL COMMENT '是否为通用参数',
  `searching` tinyint(1) NULL DEFAULT NULL COMMENT '可搜索？',
  `segments` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数值',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `ids_spg_id`(`spg_id`) USING BTREE,
  INDEX `ids_spp_id`(`spp_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '参数表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_spec_param
-- ----------------------------
INSERT INTO `t_spec_param` VALUES (1, 10001, 1, 'CPU', 0, NULL, 1, 0, NULL);
INSERT INTO `t_spec_param` VALUES (2, 10001, 2, '运存', 1, 'GB', 1, 1, NULL);
INSERT INTO `t_spec_param` VALUES (3, 10001, 3, '屏幕尺寸', 1, '英寸', 1, 1, NULL);
INSERT INTO `t_spec_param` VALUES (4, 10001, 4, '内存', 1, 'GB', 1, 1, NULL);
INSERT INTO `t_spec_param` VALUES (5, 10002, 5, '长度', 1, '米', 1, 1, NULL);
INSERT INTO `t_spec_param` VALUES (6, 10003, 6, '功率', 1, '瓦', 1, 1, NULL);
INSERT INTO `t_spec_param` VALUES (7, 10001, 7, '材质', 0, NULL, 1, 1, '纯毛/混纺/化纤');

-- ----------------------------
-- Table structure for t_spu
-- ----------------------------
DROP TABLE IF EXISTS `t_spu`;
CREATE TABLE `t_spu`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题',
  `sub_title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '副标题',
  `category_id` int(10) UNSIGNED NOT NULL COMMENT '分类ID',
  `brand_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '品牌ID',
  `spg_id` int(10) UNSIGNED NOT NULL COMMENT '品类ID',
  `saleable` tinyint(1) NOT NULL COMMENT '是否上架',
  `valid` tinyint(1) NOT NULL COMMENT '是否删除',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  `last_update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '最后更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_brand_id`(`brand_id`) USING BTREE,
  INDEX `idx_category_id`(`category_id`) USING BTREE,
  INDEX `idx_spg_id`(`spg_id`) USING BTREE,
  INDEX `idx_saleable`(`saleable`) USING BTREE,
  INDEX `idx_valid`(`valid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '产品表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_spu
-- ----------------------------
INSERT INTO `t_spu` VALUES (1, 'iPhone 12', '【享3期免息 用建行分期再减200】A14仿生芯片 5G速度 瓷晶面板防跌落 航空级铝金属边框超漂亮', 10, 3, 1, 1, 1, '2021-07-19 19:38:52', '2021-07-19 19:38:52');

-- ----------------------------
-- Table structure for t_supplier
-- ----------------------------
DROP TABLE IF EXISTS `t_supplier`;
CREATE TABLE `t_supplier`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `code` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '供货商编号',
  `name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '供货商名称',
  `type` tinyint(3) UNSIGNED NOT NULL COMMENT '类型：1厂家,2代理商,3个人',
  `link_man` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '联系人',
  `tel` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '联系电话',
  `address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '联系地址',
  `bank_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '开户银行名称',
  `bank_account` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '银行账号',
  `status` tinyint(3) UNSIGNED NOT NULL COMMENT '状态:1可用,2不可用',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `unq_code`(`code`) USING BTREE,
  INDEX `idx_code`(`code`) USING BTREE,
  INDEX `idx_type`(`type`) USING BTREE,
  INDEX `idx_status`(`status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '供货商表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_supplier
-- ----------------------------

-- ----------------------------
-- Table structure for t_supplier_sku
-- ----------------------------
DROP TABLE IF EXISTS `t_supplier_sku`;
CREATE TABLE `t_supplier_sku`  (
  `supplier_id` int(10) UNSIGNED NOT NULL COMMENT '供货商ID',
  `sku_id` int(10) UNSIGNED NOT NULL COMMENT '商品ID',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`supplier_id`, `sku_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '供货商关联商品表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_supplier_sku
-- ----------------------------

-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `username` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名',
  `password` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码（AES加密）',
  `emp_id` int(10) UNSIGNED NOT NULL COMMENT '员工ID',
  `role_id` int(10) UNSIGNED NOT NULL COMMENT '角色ID',
  `status` tinyint(3) UNSIGNED NOT NULL COMMENT '状态：1可用,2禁用',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  `last_update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '最后修改时间',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `unq_username`(`username`) USING BTREE,
  INDEX `idx_username`(`username`) USING BTREE,
  INDEX `idx_emp_id`(`emp_id`) USING BTREE,
  INDEX `idx_role_id`(`role_id`) USING BTREE,
  INDEX `idx_status`(`status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_user
-- ----------------------------

-- ----------------------------
-- Table structure for t_voucher
-- ----------------------------
DROP TABLE IF EXISTS `t_voucher`;
CREATE TABLE `t_voucher`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `deno` decimal(10, 2) UNSIGNED NOT NULL COMMENT '面值',
  `condition` decimal(10, 2) UNSIGNED NOT NULL COMMENT '订单满多少钱可以使用',
  `start_date` date NULL DEFAULT NULL COMMENT '起始日期',
  `end_date` date NULL DEFAULT NULL COMMENT '截止日期',
  `max_num` int(11) NULL DEFAULT NULL COMMENT '代金券发放最大数量',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '购物券表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_voucher
-- ----------------------------

-- ----------------------------
-- Table structure for t_voucher_customer
-- ----------------------------
DROP TABLE IF EXISTS `t_voucher_customer`;
CREATE TABLE `t_voucher_customer`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `voucher_id` int(10) UNSIGNED NOT NULL COMMENT '购物券ID',
  `customer_id` int(10) UNSIGNED NOT NULL COMMENT '客户ID',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客户关联购物券数据表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_voucher_customer
-- ----------------------------

-- ----------------------------
-- Table structure for t_warehouse
-- ----------------------------
DROP TABLE IF EXISTS `t_warehouse`;
CREATE TABLE `t_warehouse`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `city_id` int(10) UNSIGNED NOT NULL COMMENT '城市ID',
  `address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '地址',
  `tel` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '电话',
  `lng` decimal(15, 10) NULL DEFAULT NULL COMMENT '纬度',
  `lat` decimal(15, 10) NULL DEFAULT NULL COMMENT '经度',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_city_id`(`city_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '仓库表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_warehouse
-- ----------------------------
INSERT INTO `t_warehouse` VALUES (1, 1, '辽宁省沈阳市沈河区青年大街100号', '024-12345678', 123.4206290000, 41.8611360000, 0);
INSERT INTO `t_warehouse` VALUES (2, 1, '辽宁省沈阳市皇姑区崇山路41号', '024-22331234', 123.4224610000, 41.7844780000, 0);
INSERT INTO `t_warehouse` VALUES (3, 2, '辽宁省大连市西岗区五四路38号', '0411-12345678', 121.6322640000, 38.9169320000, 0);
INSERT INTO `t_warehouse` VALUES (4, 2, '辽宁省大连市沙河口区星云街1号', '0411-98213210', 121.5496200000, 38.8790240000, 0);

-- ----------------------------
-- Table structure for t_warehouse_sku
-- ----------------------------
DROP TABLE IF EXISTS `t_warehouse_sku`;
CREATE TABLE `t_warehouse_sku`  (
  `warehouse_id` int(10) UNSIGNED NOT NULL COMMENT '仓库ID',
  `sku_id` int(10) UNSIGNED NOT NULL COMMENT '商品ID',
  `num` int(10) UNSIGNED NOT NULL COMMENT '库存数量',
  `unit` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '库存单位',
  `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
  PRIMARY KEY (`warehouse_id`, `sku_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '仓库商品库存表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_warehouse_sku
-- ----------------------------

SET FOREIGN_KEY_CHECKS = 1;
