/*
 Navicat Premium Data Transfer

 Source Server         : 海控测试库
 Source Server Type    : MySQL
 Source Server Version : 50651
 Source Host           : 14.29.226.8:3306
 Source Schema         : kmall-haikong

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

 Date: 14/12/2021 17:19:00
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for ali_cb_pay_doc
-- ----------------------------
DROP TABLE IF EXISTS `ali_cb_pay_doc`;
CREATE TABLE `ali_cb_pay_doc`  (
  `ali_pay_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '内部编号',
  `merch_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '00' COMMENT '商户编号,e码头分配',
  `merch_name` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户名称',
  `merch_erp_order_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '接入平台内部编号',
  `plat_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '平台编号,e码头分配',
  `plat_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '平台中文名',
  `third_party_merch_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '第三方商户代码',
  `third_party_merch_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '第三方商户名称',
  `merch_order_sn` char(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户生成的购物订单编号',
  `doc_status` char(2) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '单证状态，00:待申报，01:申报中，03:申报失败，10:等待处理，11:业务处理中，12:业务成功，13:业务失败',
  `partner` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '\r\n            合作者身份ID',
  `out_request_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户生成的用于唯一标识一次报关操作的业务编号。不可空。',
  `trade_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '该交易在支付宝系统中的交易流水号。不可空。',
  `merchant_customs_code` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户海关备案编号。不可空。',
  `merchant_customs_name` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户海关备案名称。不可空。',
  `amount` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '报关金额。不可空。人民币“元”，小数点后2位。交易累计的报关金额不得大于交易总金额',
  `customs_place` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '支付宝制定的海关编号。不可空。参见“海关编号”，大小写均支持。',
  `is_split` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '是否拆单。可空。商户控制本单是否拆单报关。\r\n\r\n            仅当该参数传值为T或者t时，才会触发拆单（报关海关必须支持拆单）。',
  `sub_out_biz_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '子订单号。可空。商户子订单号。拆单时由商户传入，且拆单时必须传入，否则会报INVALID_PARAMETER错误码。',
  `buyer_name` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订购人姓名。即订购人留在商户处的姓名信息。可空。',
  `buyer_id_no` varchar(18) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订购人身份证号。即订购人留在商户处的身份证信息。可空。',
  `remark` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '备注',
  `result_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '结果响应码。SUCCESS：成功，FAIL：失败',
  `alipay_declare_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '支付宝报关流水号。可空。',
  `identity_check` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '返回订付人一致校验，T:一致，F:不一致。可空。',
  `ver_dept` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '核验机构标志，1-银联，2-网联，3-其他。银行卡支付返回清算组织标志，花呗、余额等支付时，统一返回3。',
  `pay_code` varchar(18) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '支付企业的海关注册登记编号',
  `pay_transaction_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '交易唯一编号。当ver_dept为3时，pay_transaction_id等于trade_no；\r\n\r\n            当ver_dept非3时，返回支付时实际清算流水号。',
  `total_amount` varchar(17) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '实际交易总金额(单位:分)',
  `detail_error_code` varchar(48) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '返回响应码进行原因说明。当result_code响应码为SUCCESS时，不返回该参数。可空',
  `detail_error_des` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '详细错误。当result_code响应码为SUCCESS时，不返回该参数。可空。',
  `beg_declare_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '申报开始时间',
  `end_declare_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '申报结束时间',
  `Column_29` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  `ex_field` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段1',
  `ex_field2` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段2',
  `ex_field3` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段3',
  `ex_field4` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段4',
  `ex_field5` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段5',
  PRIMARY KEY (`ali_pay_sn`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '支付宝跨境支付单证' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for ali_pay_error
-- ----------------------------
DROP TABLE IF EXISTS `ali_pay_error`;
CREATE TABLE `ali_pay_error`  (
  `ali_error_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '异常单编号',
  `ali_pay_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '推支付宝内部编号',
  `merch_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '00' COMMENT '商户编号,e码头分配',
  `merch_name` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户名称',
  `plat_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '平台编号,e码头分配',
  `plat_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '平台中文名',
  `third_party_merch_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '第三方商户代码',
  `third_party_merch_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '第三方商户名称',
  `merch_order_sn` char(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户生成的购物订单编号',
  `out_request_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户生成的用于唯一标识一次报关操作的业务编号。不可空。',
  `partner` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '合作者身份ID',
  `trade_no2` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '该交易在支付宝系统中的交易流水号。不可空。',
  `sub_out_biz_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '子订单号。可空。商户子订单号。拆单时由商户传入，且拆单时必须传入，否则会报INVALID_PARAMETER错误码。',
  `customs_place` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '支付宝制定的海关编号。不可空。参见“海关编号”，大小写均支持。',
  `err_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '异常代码',
  `err_msg` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '异常消息',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`ali_error_sn`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '支付宝支付单异常记录' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for cus_pay_data_open
-- ----------------------------
DROP TABLE IF EXISTS `cus_pay_data_open`;
CREATE TABLE `cus_pay_data_open`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `merch_order_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户订单编号',
  `order_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订单编号',
  `inital_request` varchar(8000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '跨境电商平台企业向支付企业发送的原始信息',
  `inital_response` varchar(8000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '支付企业向跨境电商平台企业反馈的原始信息',
  `pay_transaction_id` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '交易流水号',
  `total_amount` decimal(19, 5) DEFAULT NULL COMMENT '实际交易金额',
  `currency` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '实际交易币种（海关编码）',
  `ver_dept` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '验核机构：1-银联 2-网联 3-其他',
  `pay_type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '支付类型：1-APP 2-PC 3-扫码 4-其他',
  `trading_time` varchar(14) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '交易成功时间',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '发给海关的数据' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for cus_req_record
-- ----------------------------
DROP TABLE IF EXISTS `cus_req_record`;
CREATE TABLE `cus_req_record`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `order_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '申报订单的订单编号',
  `session_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关发起请求时，平台接收的会话ID',
  `service_time` varchar(24) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '调用时的系统时间',
  `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '企业返回海关所需获取的支付相关实时数据状态：0，接收；10000，发送成功；20000，发送失败；3，加签失败',
  `message` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关返回异常信息',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '海关请求数据记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for face_liveness_recognition_return_data
-- ----------------------------
DROP TABLE IF EXISTS `face_liveness_recognition_return_data`;
CREATE TABLE `face_liveness_recognition_return_data`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `merch_order_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户订单编号',
  `order_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单编号',
  `is_temp_noti` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '模板是否通知 0：否 1:是；',
  `is_face_check` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '人脸核身是否核验成功0：否，1：是',
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `recognition_return_msg` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '人脸识别返回信息',
  `temp_noti_msg` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '模板通知失败原因',
  `fail_count` int(11) DEFAULT NULL COMMENT '人脸识别失败次数',
  `check_operator_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '核验操作类型 1：人脸活体识别，2：按钮审核身份',
  `check_operator_sn` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '人脸失败，审核会员身份操作人',
  `check_operator_time` datetime(0) DEFAULT NULL COMMENT '审核操作时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '验证活体人脸核身接口返回的数据记录' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for haikong_member_order_sync_resend
-- ----------------------------
DROP TABLE IF EXISTS `haikong_member_order_sync_resend`;
CREATE TABLE `haikong_member_order_sync_resend`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `open_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '海控会员系统会员唯一标识open_id',
  `phone` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '会员手机号，与open_id必传其一',
  `consume_date` datetime(0) DEFAULT NULL COMMENT '消费时间',
  `order_amount` decimal(10, 3) DEFAULT NULL COMMENT '订单金额',
  `order_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订单编号',
  `order_score` int(8) DEFAULT NULL COMMENT '订单抵扣积分数量',
  `member_sys_order_id` int(11) DEFAULT NULL COMMENT '会员系统订单id，请求成功返回',
  `resend_status` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '重发状态，0:等待重发 1:重发成功 2:重发失败 3:无需重发',
  `last_resend_time` datetime(0) DEFAULT NULL COMMENT '最后一次重发时间',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 76 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '会员同步消费订单记录' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for haikong_member_score_change_detail_record
-- ----------------------------
DROP TABLE IF EXISTS `haikong_member_score_change_detail_record`;
CREATE TABLE `haikong_member_score_change_detail_record`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `order_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订单编号',
  `product_barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '条码',
  `sku` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'sku',
  `retail_price` decimal(10, 2) DEFAULT NULL COMMENT '零售价',
  `actual_price` decimal(10, 2) DEFAULT NULL COMMENT '实际支付价，该sku实际支付价格',
  `sell_volume` int(11) DEFAULT NULL COMMENT '销售数',
  `deduction_score` int(11) DEFAULT NULL COMMENT '分摊抵扣积分',
  `gift_score` int(11) DEFAULT NULL COMMENT '赠送积分',
  `generate_rules` int(1) DEFAULT NULL COMMENT '生成规则：0:门店 1:分类 2:商品 3:无规则',
  `generate_ratio` decimal(10, 2) DEFAULT NULL COMMENT '生成规则比例',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `modify_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 265 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '会员积分变动记录详情表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for haikong_member_score_change_record
-- ----------------------------
DROP TABLE IF EXISTS `haikong_member_score_change_record`;
CREATE TABLE `haikong_member_score_change_record`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `open_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'openid',
  `score` int(8) DEFAULT NULL COMMENT '会员积分 变动值，对应change_event在会员事件定义为非固定积分值事件时需要传该参数',
  `out_biz_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订单号',
  `change_reason` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '积分变动描述',
  `change_event` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '积分变动事件，event_add/event_subtract(增/减)',
  `change_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '自定义积分变动唯一标识',
  `statement_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '积分变动流水id，请求成功后返回',
  `create_time` datetime(0) DEFAULT NULL,
  `modify_time` datetime(0) DEFAULT NULL,
  `resend_status` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '重发状态，0:等待重发 1:重发成功 2:重发失败 3:无需重发',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 194 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '会员积分变动记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for haikong_resend_msg
-- ----------------------------
DROP TABLE IF EXISTS `haikong_resend_msg`;
CREATE TABLE `haikong_resend_msg`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `open_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '会员唯一标识',
  `order_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订单编号',
  `interface_type` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '接口类型',
  `request_msg` varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '请求信息',
  `response_msg` varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '响应信息',
  `resend_num` varchar(8) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '重发次数',
  `resend_time` datetime(0) DEFAULT NULL COMMENT '重发时间',
  `last_resend_time` datetime(0) DEFAULT NULL COMMENT '最后重发时间',
  `is_valid` int(2) DEFAULT NULL COMMENT '是否重发：1重发；2不重发',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `index_open_id`(`open_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '会员系统重发信息' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for haikong_send_order_info_detail_record
-- ----------------------------
DROP TABLE IF EXISTS `haikong_send_order_info_detail_record`;
CREATE TABLE `haikong_send_order_info_detail_record`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `order_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订单id',
  `image_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '图片地址',
  `bn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '明细商品货号，填sku',
  `barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '条码',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品名',
  `cost` decimal(10, 3) DEFAULT NULL COMMENT '明细商品的成本，填零售价',
  `price` decimal(10, 3) DEFAULT NULL COMMENT '销售价',
  `itemcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品编码',
  `amount` decimal(10, 3) DEFAULT NULL COMMENT '明细商品总额，销售价*数量',
  `nums` int(8) DEFAULT NULL COMMENT '明细商品购买数量',
  `is_tax` varchar(8) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '是否含税 固定传true',
  `tax_price` decimal(10, 3) DEFAULT NULL COMMENT '税金',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_order_sn`(`order_id`) USING BTREE COMMENT '订单编号索引'
) ENGINE = InnoDB AUTO_INCREMENT = 148 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '推送订单明细记录' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for haikong_send_order_info_record
-- ----------------------------
DROP TABLE IF EXISTS `haikong_send_order_info_record`;
CREATE TABLE `haikong_send_order_info_record`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `outer_order_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订单编号',
  `pay_app` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '支付方式[wxpay|wxpayinapp|wxpayinwxapp|alipay|alipayguarantee|alipayqr|chinapay|chinapayclient|code|offine]',
  `dlytype_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '配送方式，默认SF',
  `consignee_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '收货人',
  `consignee_area_province` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '收货地址省份',
  `consignee_area_city` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '收货地址城市',
  `consignee_area_county` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '收货地址地区',
  `consignee_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '收货地址详细地址',
  `consignee_zip` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '收货人的邮编',
  `consignee_tel` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '收货人的联系电话',
  `consignee_email` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '收货人的邮箱',
  `consignee_mobile` varchar(11) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '收货人的手机号',
  `weight` decimal(10, 3) DEFAULT NULL COMMENT '订单商品总重量（克）',
  `quantity` int(8) DEFAULT NULL COMMENT '订单包含商品数量',
  `order_total` decimal(10, 3) DEFAULT NULL COMMENT '订单应付总金额',
  `platform` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '下单的平台，[\'pc\',\'mobile\',\'wx\',\'ios\',\'android\',\'store\',\'other\']',
  `money` decimal(10, 3) DEFAULT NULL COMMENT '支付货币金额',
  `pay_mode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '付款方式 online=在线支付 offline=线下支付 deposit=预付款支付',
  `request` longtext CHARACTER SET utf8 COLLATE utf8_bin COMMENT '发送给支付企业的原始请求',
  `response` longtext CHARACTER SET utf8 COLLATE utf8_bin COMMENT '支付成功后回调的原始请求',
  `out_trade_no` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '支付平台流水号',
  `seaport_code` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '口岸代码  4600',
  `seaport_platform` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '跨境商品平台来源 1:广州跨境通保税 2:自营保税    填1',
  `identity_card` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订购人身份证号码',
  `identity_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订购人姓名',
  `identity_mobile` varchar(11) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订购人手机号',
  `order_product_info` longtext CHARACTER SET utf8 COLLATE utf8_bin COMMENT '订单产品信息，json字符串',
  `resend_status` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '重发状态，0:等待重发 1:重发成功 2:重发失败 3:无需重发',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `idx_order_sn`(`outer_order_no`) USING BTREE COMMENT '订单编号索引'
) ENGINE = InnoDB AUTO_INCREMENT = 74 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '推送订单信息记录' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for import_pay_order_record
-- ----------------------------
DROP TABLE IF EXISTS `import_pay_order_record`;
CREATE TABLE `import_pay_order_record`  (
  `ipor_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `importer` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '导入人',
  `import_time` datetime(0) DEFAULT NULL COMMENT '导入时间',
  `import_file_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '导入文件名',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  PRIMARY KEY (`ipor_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 265 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '导入支付单记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for import_tax_order_record
-- ----------------------------
DROP TABLE IF EXISTS `import_tax_order_record`;
CREATE TABLE `import_tax_order_record`  (
  `itor_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `importer` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '导入人',
  `import_time` datetime(0) DEFAULT NULL COMMENT '导入时间',
  `import_file_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '导入文件名',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  PRIMARY KEY (`itor_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '导入税单记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for kmall_to_eccs
-- ----------------------------
DROP TABLE IF EXISTS `kmall_to_eccs`;
CREATE TABLE `kmall_to_eccs`  (
  `kte_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `request_data` varchar(2048) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '请求数据',
  `request_time` datetime(0) DEFAULT NULL COMMENT '请求时间',
  `request_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '请求类型（01 进货 02 上架 03 销售 04 退款',
  `send_status` varchar(2) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '是否请求过  00 未请求  01已请求 02请求失败',
  `fail_reason` varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '失败原因',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  PRIMARY KEY (`kte_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 90559 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_ad
-- ----------------------------
DROP TABLE IF EXISTS `mall_ad`;
CREATE TABLE `mall_ad`  (
  `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号\r\n',
  `ad_position_id` smallint(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT '广告位id',
  `media_type` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '广告类型 0 普通 1活动广告 2新用户注册',
  `name` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '广告名称',
  `sort_order` int(11) DEFAULT 5 COMMENT '排序',
  `link` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '广告链接',
  `image_url` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '广告图片url',
  `content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '广告内容',
  `end_time` datetime(0) DEFAULT NULL COMMENT '结束时间',
  `enabled` tinyint(3) UNSIGNED DEFAULT 1 COMMENT '是否有效',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店编号',
  `tick_disc_id` int(11) DEFAULT NULL COMMENT '优惠券id',
  `store_topic_id` int(11) DEFAULT NULL COMMENT '门店活动id',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `position_id`(`ad_position_id`) USING BTREE,
  INDEX `enabled`(`enabled`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_ad_position
-- ----------------------------
DROP TABLE IF EXISTS `mall_ad_position`;
CREATE TABLE `mall_ad_position`  (
  `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `name` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '\'' COMMENT '广告位名称',
  `width` smallint(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT '宽度',
  `height` smallint(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT '高度',
  `desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '描述',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_address
-- ----------------------------
DROP TABLE IF EXISTS `mall_address`;
CREATE TABLE `mall_address`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `user_id` mediumint(8) DEFAULT NULL COMMENT '用户id',
  `user_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '用户名称',
  `tel_number` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '手机号',
  `postal_Code` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '邮政编码',
  `national_Code` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '国家代码',
  `province_Name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '省',
  `city_Name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '市',
  `county_Name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '县',
  `detail_Info` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '详细地址',
  `is_default` int(2) DEFAULT 0 COMMENT '是否默认 1默认 0否',
  `latitude` decimal(10, 6) DEFAULT NULL COMMENT '纬度',
  `longitude` decimal(10, 6) DEFAULT NULL COMMENT '经度',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `address_type` int(2) DEFAULT NULL COMMENT '发货收货人地址类型',
  `address_store` int(10) DEFAULT NULL COMMENT '地址所属门店',
  `address_status` int(2) DEFAULT NULL COMMENT '可用状态：1可用，2不可用',
  `sender_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '发货人',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_id`(`user_name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户详细地址表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_attribute
-- ----------------------------
DROP TABLE IF EXISTS `mall_attribute`;
CREATE TABLE `mall_attribute`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `attribute_category_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品类型',
  `name` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '属性名称',
  `input_type` tinyint(1) UNSIGNED DEFAULT 1 COMMENT '当添加商品时,该属性的添加类别; 0为手功输入;1为选择输入;2为多行文本输入',
  `value` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '即选择输入,则attr_name对应的值的取值就是该这字段值 ',
  `sort_order` tinyint(3) UNSIGNED DEFAULT 0,
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店编号',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `cat_id`(`attribute_category_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 117 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_attribute_category
-- ----------------------------
DROP TABLE IF EXISTS `mall_attribute_category`;
CREATE TABLE `mall_attribute_category`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
  `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '1开启; 0关闭;',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_brand
-- ----------------------------
DROP TABLE IF EXISTS `mall_brand`;
CREATE TABLE `mall_brand`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '品牌名称',
  `list_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '图片',
  `simple_desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '描述',
  `pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '图片',
  `sort_order` tinyint(3) UNSIGNED DEFAULT 0 COMMENT '排序',
  `is_show` tinyint(1) UNSIGNED DEFAULT 1 COMMENT '显示',
  `floor_price` decimal(10, 2) DEFAULT 0.00,
  `app_list_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT 'app显示图片',
  `is_new` tinyint(1) UNSIGNED DEFAULT 0 COMMENT '新品牌',
  `new_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '图片',
  `new_sort_order` tinyint(2) UNSIGNED DEFAULT 0 COMMENT '排序',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店编号',
  `category_id` int(11) DEFAULT NULL COMMENT '分类id',
  `category_level` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '分类等级',
  `unique_identifier` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '品牌唯一标识符',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `is_show`(`is_show`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1050324 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_brand_copy1
-- ----------------------------
DROP TABLE IF EXISTS `mall_brand_copy1`;
CREATE TABLE `mall_brand_copy1`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '品牌名称',
  `list_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '图片',
  `simple_desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '描述',
  `pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '图片',
  `sort_order` tinyint(3) UNSIGNED DEFAULT 0 COMMENT '排序',
  `is_show` tinyint(1) UNSIGNED DEFAULT 1 COMMENT '显示',
  `floor_price` decimal(10, 2) DEFAULT 0.00,
  `app_list_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT 'app显示图片',
  `is_new` tinyint(1) UNSIGNED DEFAULT 0 COMMENT '新品牌',
  `new_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '图片',
  `new_sort_order` tinyint(2) UNSIGNED DEFAULT 0 COMMENT '排序',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店编号',
  `category_id` int(11) DEFAULT NULL COMMENT '分类id',
  `category_level` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '分类等级',
  `unique_identifier` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '品牌唯一标识符',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `is_show`(`is_show`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1048929 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_cart
-- ----------------------------
DROP TABLE IF EXISTS `mall_cart`;
CREATE TABLE `mall_cart`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0 COMMENT '会员Id',
  `goods_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品Id',
  `sku` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'sku',
  `goods_sn` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品序列号',
  `product_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0 COMMENT '产品Id',
  `goods_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '产品名称',
  `market_price` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '市场价',
  `retail_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '零售价格',
  `number` smallint(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT '数量',
  `stock_num` int(6) DEFAULT NULL COMMENT '商品库存数量',
  `goods_specification_name_value` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '规格属性组成的字符串，用来显示用',
  `goods_specification_ids` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT 'product表对应的goods_specifition_ids',
  `checked` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  `list_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品图片',
  `store_id` mediumint(11) DEFAULT NULL COMMENT '门店Id',
  `goods_biz_type` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订单业务类型：00:保税备货， 02:保税展示补货，10:保税展示跨境，11:普通商品',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '购物车表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_category
-- ----------------------------
DROP TABLE IF EXISTS `mall_category`;
CREATE TABLE `mall_category`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(90) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
  `keywords` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
  `front_desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
  `parent_id` int(11) UNSIGNED DEFAULT 0,
  `sort_order` tinyint(1) UNSIGNED DEFAULT 50,
  `show_index` tinyint(1) DEFAULT 0,
  `is_show` tinyint(1) UNSIGNED DEFAULT 1,
  `banner_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
  `icon_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `img_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `wap_banner_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `level` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `type` int(11) DEFAULT 0,
  `front_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店编号',
  `share` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否共享',
  `points_rules_id` int(12) DEFAULT NULL COMMENT '积分生成规则类型ID',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `parent_id`(`parent_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1037437 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_channel
-- ----------------------------
DROP TABLE IF EXISTS `mall_channel`;
CREATE TABLE `mall_channel`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `name` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '名称',
  `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '请求地址',
  `icon_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'icon地址',
  `sort_order` int(4) UNSIGNED NOT NULL DEFAULT 10 COMMENT '排序',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_collect
-- ----------------------------
DROP TABLE IF EXISTS `mall_collect`;
CREATE TABLE `mall_collect`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户Id',
  `value_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0 COMMENT '产品Id',
  `add_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间',
  `is_attention` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否提醒',
  `type_id` int(2) UNSIGNED NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_id`(`user_id`) USING BTREE,
  INDEX `goods_id`(`value_id`) USING BTREE,
  INDEX `is_attention`(`is_attention`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_comment
-- ----------------------------
DROP TABLE IF EXISTS `mall_comment`;
CREATE TABLE `mall_comment`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `type_id` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户评论的类型;0评论的是商品,1评论的是文章',
  `value_id` int(11) DEFAULT 0 COMMENT 'type_id=0为goods_id',
  `user_id` int(11) DEFAULT 0 COMMENT '会员Id',
  `order_id` int(11) DEFAULT NULL COMMENT '订单id',
  `product_id` int(11) DEFAULT NULL COMMENT '产品Id',
  `goods_specification_name_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商品规格详情',
  `status` tinyint(3) UNSIGNED DEFAULT 0 COMMENT '状态 是否被管理员批准显示;1是;0未批准显示',
  `content` varchar(6550) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '评论内容 储存为base64编码',
  `add_time` bigint(12) UNSIGNED DEFAULT 0 COMMENT '记录时间',
  `eval_level` tinyint(4) DEFAULT NULL COMMENT '评价级别 1-5级 默认 5 ',
  `delivery_level` tinyint(4) DEFAULT NULL COMMENT '配送质量',
  `goods_level` tinyint(4) DEFAULT NULL COMMENT '商品服务',
  `value_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商品名称',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `id_value`(`value_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户评论表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_comment_picture
-- ----------------------------
DROP TABLE IF EXISTS `mall_comment_picture`;
CREATE TABLE `mall_comment_picture`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `comment_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '评价Id',
  `pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '评价图片',
  `sort_order` tinyint(1) UNSIGNED NOT NULL DEFAULT 5 COMMENT '排序',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '评论图片表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_coupon
-- ----------------------------
DROP TABLE IF EXISTS `mall_coupon`;
CREATE TABLE `mall_coupon`  (
  `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '活动id',
  `name` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '活动名称',
  `type_money` decimal(10, 2) DEFAULT 0.00 COMMENT '金额',
  `send_type` tinyint(3) UNSIGNED DEFAULT 0 COMMENT '发放方式 0：按订单发放 1：按用户发放(通用优惠券，用户点击领取) 2: 商品转发送券 3：按商品发放 4:新用户注册 5：线下发放 6评价好评红包（固定或随机红包） 7包邮（不入会员优惠券表）',
  `min_amount` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '最小金额(send_type=2、6使用，随机)',
  `max_amount` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '最大金额(send_type=2、6使用，随机)',
  `send_start_date` datetime(0) DEFAULT NULL COMMENT '发放时间（暂时不用）',
  `send_end_date` datetime(0) DEFAULT NULL COMMENT '发放时间（暂时不用）',
  `use_start_date` datetime(0) DEFAULT NULL COMMENT '使用开始时间',
  `use_end_date` datetime(0) DEFAULT NULL COMMENT '使用结束时间',
  `min_goods_amount` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '最小订单金额',
  `min_transmit_num` int(4) DEFAULT NULL COMMENT '转发次数 send_type=2使用',
  `pic_url` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '活动大图',
  `invalid_days` tinyint(4) DEFAULT NULL COMMENT '有效时间天数',
  `is_all` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '活动是否适用与全场 0：否（针对门店）；1：是（适用全场）',
  `coupon_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '活动链接',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商城活动表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_export_exception_data
-- ----------------------------
DROP TABLE IF EXISTS `mall_export_exception_data`;
CREATE TABLE `mall_export_exception_data`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `export_exception_data` varchar(3000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '导入商品异常数据',
  `export_data_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '导入数据类型：1：商品导入；2：普通商品导入',
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `merch_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店id',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据导入异常数据记录' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_feedback
-- ----------------------------
DROP TABLE IF EXISTS `mall_feedback`;
CREATE TABLE `mall_feedback`  (
  `msg_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0 COMMENT '会员Id',
  `user_name` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '会员名称',
  `mobile` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '手机',
  `feed_Type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '反馈类型',
  `content` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '详细内容',
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态',
  `add_time` datetime(0) DEFAULT NULL COMMENT '反馈时间',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店编号',
  PRIMARY KEY (`msg_id`) USING BTREE,
  INDEX `user_id`(`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_footprint
-- ----------------------------
DROP TABLE IF EXISTS `mall_footprint`;
CREATE TABLE `mall_footprint`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员Id',
  `goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品id',
  `add_time` int(11) NOT NULL DEFAULT 0 COMMENT '记录时间',
  `referrer` int(11) DEFAULT NULL COMMENT '转发人',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `goods_id_index`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_form_ids
-- ----------------------------
DROP TABLE IF EXISTS `mall_form_ids`;
CREATE TABLE `mall_form_ids`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `user_id` int(11) DEFAULT NULL COMMENT '用户编号',
  `merch_order_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户订单编号',
  `form_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '微信生成的预支付会话标识，用于后续接口调用中使用，该值有效期为2小时',
  `valid_num` tinyint(3) UNSIGNED DEFAULT 0 COMMENT '有效次数',
  `expire_time` datetime(0) DEFAULT NULL COMMENT '失效时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '小程序form_id收集' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_freight
-- ----------------------------
DROP TABLE IF EXISTS `mall_freight`;
CREATE TABLE `mall_freight`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '模版名称',
  `template_type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '模版类型：0，买家承担运费；1，卖家包邮',
  `pricing_manner` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '计价方式：0，按件数；1，按重量；2，按体积',
  `default_freight` decimal(10, 2) DEFAULT NULL COMMENT '默认运费',
  `is_default` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '默认模版：0，否；1，是',
  `merch_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 124 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_freight_item
-- ----------------------------
DROP TABLE IF EXISTS `mall_freight_item`;
CREATE TABLE `mall_freight_item`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `fre_id` int(11) DEFAULT NULL COMMENT '运费模版id',
  `delivery_area` longtext CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '配送范围',
  `first_piece` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '首件（个，kg，m³）',
  `freight` decimal(10, 2) DEFAULT NULL COMMENT '运费',
  `continue_piece` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '续件（个，kg，m³）',
  `renew` decimal(10, 2) DEFAULT NULL COMMENT '续费',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 111 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods`;
CREATE TABLE `mall_goods`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `third_party_merch_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户代码',
  `supplier_id` int(11) DEFAULT NULL COMMENT '供货商id',
  `goods_sn` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '商品编码',
  `prod_barcode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '产品条码',
  `sku` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'sku',
  `plu` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'plu',
  `goods_biz_type` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '货品业务类型， 00:保税备货， 02:保税展示补货，10:保税展示跨境，11:普通商品',
  `english_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品英文名称',
  `name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '商品名称',
  `unit_code` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '计量单位代码，参见海关编码',
  `brand` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '品牌',
  `goods_number` mediumint(8) UNSIGNED DEFAULT 0 COMMENT '商品总库存',
  `keywords` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '关键词',
  `goods_brief` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
  `goods_desc` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '商品描述',
  `cus_goods_code` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关商品编码',
  `ciq_prod_model` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '国检规格型号',
  `ori_cnt_code` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '原产国代码，海关编码',
  `cus_decl_ele` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关申报要素，报统一版',
  `cus_rec_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关备案编号，企业自编，用于报园区',
  `is_on_sale` tinyint(1) UNSIGNED DEFAULT 1 COMMENT '是否上架',
  `add_time` datetime(0) DEFAULT NULL COMMENT '商品创建时间',
  `sort_order` smallint(4) UNSIGNED DEFAULT 100 COMMENT '排序',
  `is_delete` tinyint(1) UNSIGNED DEFAULT 0 COMMENT '是否删除，0:未删除 1:已删除',
  `counter_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '专柜价格',
  `extra_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '附加价格',
  `is_new` tinyint(1) UNSIGNED DEFAULT 0 COMMENT '是否新品',
  `goods_unit` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品单位',
  `primary_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品主图',
  `list_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品列表图',
  `goods_rate` decimal(10, 4) DEFAULT NULL COMMENT '商品税率',
  `retail_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '零售价格',
  `sell_volume` int(11) UNSIGNED DEFAULT 0 COMMENT '销售量',
  `primary_product_id` int(11) UNSIGNED DEFAULT 0 COMMENT '主sku　product_id',
  `unit_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '单位价格，单价',
  `promotion_desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `promotion_tag` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `app_exclusive_price` decimal(10, 2) UNSIGNED DEFAULT NULL COMMENT 'APP专享价',
  `is_app_exclusive` tinyint(1) UNSIGNED DEFAULT NULL COMMENT '是否是APP专属',
  `is_limited` tinyint(1) UNSIGNED DEFAULT NULL,
  `is_hot` tinyint(1) UNSIGNED DEFAULT 0 COMMENT '是否热销',
  `market_price` decimal(10, 2) DEFAULT 0.00 COMMENT '市场价',
  `category_id` int(11) UNSIGNED DEFAULT 0 COMMENT '分类id',
  `brand_id` int(11) UNSIGNED DEFAULT 0 COMMENT '品牌id',
  `freight_id` int(11) DEFAULT NULL COMMENT '运费id',
  `attribute_category` int(11) UNSIGNED DEFAULT 0 COMMENT '商品属性分类id',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `gross_weight` decimal(16, 5) DEFAULT NULL COMMENT '毛重,kg',
  `net_weight` decimal(16, 5) DEFAULT NULL COMMENT '净重,kg(商品重量)',
  `is_goods_share_stock` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品库存数量变化后是否已共享，0：否，1：是（下单、退款、取消订单时触发）（定时任务：修改为0的门店商品库存）',
  `cost_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '成本价格',
  `daily_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '日常价',
  `last_sale_time` datetime(0) DEFAULT NULL COMMENT '最后销售时间',
  `mychem_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'MychemID',
  `hs_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关备案编码',
  `hs_code_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关备案名称',
  `is_sync_hs_code` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '是否同步海关备案编码 0：不是 1：是',
  `is_sync_goods_rate` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '是否同步oms税率 0：不是 1：是',
  `imp_consum_tax_rate` decimal(10, 2) DEFAULT NULL COMMENT '进口从价消费税率，百分数(部分商品存在)',
  `value_added_tax_rate` decimal(10, 2) DEFAULT NULL COMMENT '增值税率，百分数',
  `legal_unit1_qty` decimal(10, 5) DEFAULT NULL COMMENT '第一法定单位数量',
  `legal_unit2_qty` decimal(10, 5) DEFAULT NULL COMMENT '第二法定单位数量',
  `cosm_threshold_value` decimal(10, 2) DEFAULT NULL COMMENT '化妆品阀值',
  `to_be_restored` int(11) DEFAULT NULL COMMENT '待退款数量',
  `prod_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '产品中文名称',
  `prod_record_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '产品中文备案名称',
  `warehouse_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '仓库编码',
  `consignor_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '货主编码',
  `warehous_sys_good_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '仓储系统商品ID',
  `inventory_type` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '库存类型:SY=所有,\nZP=正品, \nCC=残次,\nJS=机损,\nXS= 箱损,\nZT=在途库存',
  `defective_products_grade` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '残品等级（非残次品则不填）AG=一级残，\nBG=二级残，\nCG=三级残 ,退货仓使用',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `goods_id_index`(`id`) USING BTREE,
  INDEX `goods_sn`(`goods_sn`) USING BTREE,
  INDEX `cat_id`(`category_id`) USING BTREE,
  INDEX `brand_id`(`brand_id`) USING BTREE,
  INDEX `goods_number`(`goods_number`) USING BTREE,
  INDEX `sort_order`(`sort_order`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1702912521 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品信息表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_attribute
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_attribute`;
CREATE TABLE `mall_goods_attribute`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `goods_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品Id',
  `attribute_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '属性Id',
  `value` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '属性值',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店编号',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `goods_id`(`goods_id`) USING BTREE,
  INDEX `attr_id`(`attribute_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品属性表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_batch
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_batch`;
CREATE TABLE `mall_goods_batch`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `batch_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `sku` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `batch_expire_date` datetime(0) DEFAULT NULL,
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `create_time` datetime(0) DEFAULT NULL,
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `mod_time` datetime(0) DEFAULT NULL,
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '批次（多）— SKU（多）' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_copy1
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_copy1`;
CREATE TABLE `mall_goods_copy1`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `third_party_merch_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户代码',
  `supplier_id` int(11) DEFAULT NULL COMMENT '供货商id',
  `goods_sn` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '商品编码',
  `prod_barcode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '产品条码',
  `sku` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'sku',
  `plu` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'plu',
  `goods_biz_type` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '货品业务类型， 00:保税备货， 02:保税展示补货，10:保税展示跨境，11:普通商品',
  `english_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品英文名称',
  `name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '商品名称',
  `unit_code` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '计量单位代码，参见海关编码',
  `brand` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '品牌',
  `goods_number` mediumint(8) UNSIGNED DEFAULT 0 COMMENT '商品总库存',
  `keywords` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '关键词',
  `goods_brief` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
  `goods_desc` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '商品描述',
  `cus_goods_code` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关商品编码',
  `ciq_prod_model` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '国检规格型号',
  `ori_cnt_code` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '原产国代码，海关编码',
  `cus_decl_ele` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关申报要素，报统一版',
  `cus_rec_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关备案编号，企业自编，用于报园区',
  `is_on_sale` tinyint(1) UNSIGNED DEFAULT 1 COMMENT '是否上架',
  `add_time` datetime(0) DEFAULT NULL COMMENT '商品创建时间',
  `sort_order` smallint(4) UNSIGNED DEFAULT 100 COMMENT '排序',
  `is_delete` tinyint(1) UNSIGNED DEFAULT 0 COMMENT '是否删除',
  `counter_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '专柜价格',
  `extra_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '附加价格',
  `is_new` tinyint(1) UNSIGNED DEFAULT 0 COMMENT '是否新品',
  `goods_unit` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品单位',
  `primary_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品主图',
  `list_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品列表图',
  `goods_rate` decimal(10, 4) DEFAULT NULL COMMENT '商品税率',
  `retail_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '零售价格',
  `sell_volume` int(11) UNSIGNED DEFAULT 0 COMMENT '销售量',
  `primary_product_id` int(11) UNSIGNED DEFAULT 0 COMMENT '主sku　product_id',
  `unit_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '单位价格，单价',
  `promotion_desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `promotion_tag` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `app_exclusive_price` decimal(10, 2) UNSIGNED DEFAULT NULL COMMENT 'APP专享价',
  `is_app_exclusive` tinyint(1) UNSIGNED DEFAULT NULL COMMENT '是否是APP专属',
  `is_limited` tinyint(1) UNSIGNED DEFAULT NULL,
  `is_hot` tinyint(1) UNSIGNED DEFAULT 0 COMMENT '是否热销',
  `market_price` decimal(10, 2) DEFAULT 0.00 COMMENT '市场价',
  `category_id` int(11) UNSIGNED DEFAULT 0 COMMENT '分类id',
  `brand_id` int(11) UNSIGNED DEFAULT 0 COMMENT '品牌id',
  `freight_id` int(11) DEFAULT NULL COMMENT '运费id',
  `attribute_category` int(11) UNSIGNED DEFAULT 0 COMMENT '商品属性分类id',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `gross_weight` decimal(16, 5) DEFAULT NULL COMMENT '毛重,kg',
  `net_weight` decimal(16, 5) DEFAULT NULL COMMENT '净重,kg',
  `is_goods_share_stock` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品库存数量变化后是否已共享，0：否，1：是（下单、退款、取消订单时触发）（定时任务：修改为0的门店商品库存）',
  `cost_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '成本价格',
  `daily_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '日常价',
  `last_sale_time` datetime(0) DEFAULT NULL COMMENT '最后销售时间',
  `mychem_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'MychemID',
  `hs_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关备案编码',
  `hs_code_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关备案名称',
  `is_sync_hs_code` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '是否同步海关备案编码 0：不是 1：是',
  `is_sync_goods_rate` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '是否同步oms税率 0：不是 1：是',
  `imp_consum_tax_rate` decimal(10, 2) DEFAULT NULL COMMENT '进口从价消费税率，百分数',
  `value_added_tax_rate` decimal(10, 2) DEFAULT NULL COMMENT '增值税率，百分数',
  `legal_unit1_qty` decimal(10, 5) DEFAULT NULL COMMENT '第一法定单位数量',
  `legal_unit2_qty` decimal(10, 5) DEFAULT NULL COMMENT '第二法定单位数量',
  `cosm_threshold_value` decimal(10, 2) DEFAULT NULL COMMENT '化妆品阀值',
  `to_be_restored` int(11) DEFAULT NULL COMMENT '待退款数量',
  `prod_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '产品中文名称',
  `prod_record_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '产品中文备案名称',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `goods_id_index`(`id`) USING BTREE,
  INDEX `goods_sn`(`goods_sn`) USING BTREE,
  INDEX `cat_id`(`category_id`) USING BTREE,
  INDEX `brand_id`(`brand_id`) USING BTREE,
  INDEX `goods_number`(`goods_number`) USING BTREE,
  INDEX `sort_order`(`sort_order`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1190422 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品信息表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_crash
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_crash`;
CREATE TABLE `mall_goods_crash`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `goods_id` int(11) NOT NULL COMMENT '商品Id',
  `goods_crash_id` int(11) NOT NULL COMMENT '搭配商品Id',
  `product_crash_id` int(11) NOT NULL COMMENT '搭配产品Id',
  `retail_crash_price` decimal(10, 2) NOT NULL COMMENT '搭配商品价格，需要小于原始价格',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = gbk COLLATE = gbk_chinese_ci COMMENT = '商品搭配减' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_gallery
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_gallery`;
CREATE TABLE `mall_goods_gallery`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `goods_id` int(11) DEFAULT 0 COMMENT '商品id',
  `file_type` char(2) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '文件类型 0：图片；1：视频',
  `img_desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT '' COMMENT '描述',
  `sort_order` int(11) DEFAULT 5 COMMENT '排序',
  `img_url` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '图片url',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店编号',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `goods_id`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4258 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci COMMENT = '商品详情图片' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_group
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_group`;
CREATE TABLE `mall_goods_group`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '团购主题',
  `item_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '活动条例图片',
  `abbr_pic_url` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '简略图片',
  `launch_num` int(11) DEFAULT NULL,
  `goods_id` int(11) NOT NULL,
  `sort_order` int(11) DEFAULT NULL,
  `min_open_group` int(4) DEFAULT NULL,
  `subtitle` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `retail_min_price` decimal(10, 2) NOT NULL COMMENT '团购价格',
  `open_time` datetime(0) DEFAULT NULL COMMENT '开团时间',
  `end_time` datetime(0) DEFAULT NULL COMMENT '结束时间',
  `open_status` int(4) DEFAULT NULL COMMENT '状态 1开团中 2过期 3失效',
  `ad_desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '广告语',
  `valid_days` int(4) DEFAULT NULL COMMENT '开团有效期',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  INDEX `topic_id`(`id`) USING BTREE,
  INDEX `group_goods_id_index`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品分类图片表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_group_open
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_group_open`;
CREATE TABLE `mall_goods_group_open`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `group_id` bigint(20) NOT NULL COMMENT '开团Id',
  `user_id` bigint(20) NOT NULL COMMENT '开团人',
  `open_time` datetime(0) NOT NULL COMMENT '参团时间',
  `end_time` datetime(0) DEFAULT NULL,
  `attend_status` int(4) NOT NULL COMMENT '参团状态 0待付款  1拼团中 2拼团成功 3拼团失败',
  `attend_num` int(4) DEFAULT NULL COMMENT '当前参团人数',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci COMMENT = '开团商品表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_group_open_detail
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_group_open_detail`;
CREATE TABLE `mall_goods_group_open_detail`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `open_id` bigint(20) NOT NULL COMMENT '开团Id',
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `attend_time` datetime(0) NOT NULL COMMENT '参团时间',
  `attend_status` int(2) NOT NULL COMMENT '参团状态 0待付款  1拼团中 2拼团成功 3拼团失败',
  `form_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '表单提交formId',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci COMMENT = '开团商品详情表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_history_price
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_history_price`;
CREATE TABLE `mall_goods_history_price`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `goods_sn` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品编码',
  `sku` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'sku',
  `PLU` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'PLU',
  `third_merch_sn` int(11) DEFAULT NULL COMMENT '第三方商户编号，主键编号',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户编号',
  `store_number` varchar(30) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '门店编号',
  `batch_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '批次编号',
  `daily_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '日常价',
  `activeity_price` decimal(10, 2) DEFAULT NULL COMMENT '活动价',
  `price_time` datetime(0) DEFAULT NULL COMMENT '价格时间',
  `retail_price_date` datetime(0) DEFAULT NULL COMMENT '价格日期',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '+创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '+创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '+修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '+修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '+时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '商品历史价格表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_issue
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_issue`;
CREATE TABLE `mall_goods_issue`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `question` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '问题',
  `answer` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '回答',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品说明表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_label_head
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_label_head`;
CREATE TABLE `mall_goods_label_head`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` mediumint(8) DEFAULT NULL COMMENT '门店编号',
  `label_head_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '标签头名称',
  `label_head_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '标签头url',
  `sort_order` int(11) DEFAULT 5 COMMENT '排序',
  `is_valid` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '标签头维护表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_product
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_product`;
CREATE TABLE `mall_goods_product`  (
  `mall_goods_product_sn` int(11) NOT NULL AUTO_INCREMENT COMMENT '产品信息备案编号',
  `merch_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `third_merch_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户编号',
  `prod_barcode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '产品条码',
  `sku` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'sku',
  `cus_goods_code` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关商品编码',
  `prod_name` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '中文名称',
  `ciq_prod_model` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '国检规格型号',
  `prod_brand` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '品牌',
  `ori_cnt_code` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '原产国代码，海关编码',
  `unit_code` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '计量单位代码，参见海关编码',
  `decl_price` decimal(16, 2) DEFAULT NULL COMMENT '申报价格',
  `decl_currency_code` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '申报币种代码,参见海关编码',
  `supplier_name` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '供应商企业名称，非必送',
  `supplier_cnt_code` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '供货商企业国别代码，非必送，海关编码',
  `prod_comp_name` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '生产企业名称',
  `prod_comp_cnt_code` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '生产企业国别名称',
  `ciq_main_ele` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '主要成分',
  `ciq_monitor_type` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '国检监管类别，\r\n             0101:3C目录内\r\n             0102:HS编码涉及3C但在3C目录外\r\n             0201:普通食品、化妆品及一般要求\r\n             0202:保健食品\r\n             0203:有检疫要求（含肉、含蛋、含乳等）的深加工食品\r\n             0204:备案管理的化妆品（婴幼儿化妆品除外）\r\n             0205:实施注册管理的进口婴幼儿乳粉、实施备案管理的进口婴幼儿化妆品\r\n             0206:其他有特殊检验检疫监管要求的食品\r\n             0301:一次性卫生用品\r\n             0401:医学微生物、人体组、生物制品、血液及其制品、环保微生物菌剂\r\n             9999:其他产品）',
  `is_law` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否法检   0:否 1:是',
  `is_gift` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否赠品 0:否 1:是',
  `cus_decl_ele` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关申报要素，报统一版',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  `ex_field` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `ex_field2` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `ex_field3` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `ex_field4` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `ex_field5` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `legal_unit1_qty` decimal(10, 5) DEFAULT NULL COMMENT '第一法定单位数量',
  `net_weight` decimal(16, 5) DEFAULT NULL COMMENT '净重,kg',
  `legal_unit2_qty` decimal(10, 5) DEFAULT NULL COMMENT '第二法定单位数量',
  `gross_weight` decimal(16, 5) DEFAULT NULL COMMENT '毛重,kg',
  `local_ems_no` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '园区账册编号',
  `item_record_no` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '园区商品序号',
  `ems_class_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '账册分类代码',
  `is_send` char(4) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '0:未发送 1:发送成功 2:发送失败',
  `prod_ename` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '英文名称',
  `prod_record_name` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '中文备案名称',
  `prod_record_ename` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '英文备案名称',
  `up_img` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '上方图片',
  `down_img` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '下方图片',
  `left_img` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '左侧图片',
  `right_img` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '右侧图片',
  `before_img` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '正面图片',
  `after_img` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '反面图片',
  `send_time` datetime(0) DEFAULT NULL COMMENT '发送时间',
  `batch_no` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '批次号',
  `oms_audit_status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'oms审核状态',
  `oms_callback_time` datetime(0) DEFAULT NULL COMMENT 'oms回调时间',
  `oms_audit_time` datetime(0) DEFAULT NULL COMMENT 'oms审核时间',
  `oms_audit_remark` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'oms审核备注',
  `status` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备案状态',
  PRIMARY KEY (`mall_goods_product_sn`) USING BTREE,
  INDEX `Index_sku_cus`(`sku`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '产品信息备案表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_specification
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_specification`;
CREATE TABLE `mall_goods_specification`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `goods_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品编号',
  `specification_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '规格编号',
  `value` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '规格值',
  `pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '图片url',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `goods_id`(`goods_id`) USING BTREE,
  INDEX `specification_id`(`specification_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 13045 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品对应规格表值表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_transport_info
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_transport_info`;
CREATE TABLE `mall_goods_transport_info`  (
  `trans_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '在途编号',
  `transport_type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '00:海运，10:空运，20:公路，30:铁路',
  `transport_tool` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '运输工具',
  `third_merch_sn` int(11) DEFAULT NULL COMMENT '第三方商户编号',
  `way_status` tinyint(4) DEFAULT 0 COMMENT '0:是，1:否，默认为0',
  `origin` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '始发地',
  `destination` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '目的地',
  `start_time` datetime(0) DEFAULT NULL COMMENT '始发时间',
  `arrival_time` datetime(0) DEFAULT NULL COMMENT '到达时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`trans_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '在途运输信息表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_goods_transport_info_detail
-- ----------------------------
DROP TABLE IF EXISTS `mall_goods_transport_info_detail`;
CREATE TABLE `mall_goods_transport_info_detail`  (
  `trans_item_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '明细编号',
  `way_status` tinyint(4) DEFAULT 0 COMMENT '是否在途（0:是，1:否，默认为0）',
  `sku` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品sku',
  `supplier_id` int(11) DEFAULT NULL COMMENT '供应商id',
  `origin_country` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '原产地',
  `num` int(11) DEFAULT NULL COMMENT '数量',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`trans_item_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 42 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '在途商品明细表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_help_issue
-- ----------------------------
DROP TABLE IF EXISTS `mall_help_issue`;
CREATE TABLE `mall_help_issue`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `type_id` int(11) DEFAULT NULL COMMENT '问题分类',
  `question` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '问题',
  `answer` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '回答',
  `sort` int(4) DEFAULT NULL COMMENT '排序',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 34 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_help_type
-- ----------------------------
DROP TABLE IF EXISTS `mall_help_type`;
CREATE TABLE `mall_help_type`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `type_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '问题分类',
  `sort` int(4) DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_interface_send_log
-- ----------------------------
DROP TABLE IF EXISTS `mall_interface_send_log`;
CREATE TABLE `mall_interface_send_log`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `sys_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '请求/响应系统类型',
  `interface_type` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '请求/响应接口类型',
  `request_msg` varchar(5024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '请求信息',
  `msg_status` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '响应状态码',
  `response_msg` varchar(5024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '响应结果',
  `request_date` datetime(0) DEFAULT NULL COMMENT '发送时间',
  `response_date` datetime(0) DEFAULT NULL COMMENT '响应时间',
  `exception_msg` varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '异常信息',
  `tstm` timestamp(0) DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `index_ordersn_vmctype`(`interface_type`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8336 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '接口日志记录' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_keywords
-- ----------------------------
DROP TABLE IF EXISTS `mall_keywords`;
CREATE TABLE `mall_keywords`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `keyword` varchar(90) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '关键字',
  `is_hot` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '热销',
  `is_default` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '默认',
  `is_show` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '显示',
  `sort_order` int(11) NOT NULL DEFAULT 100 COMMENT '排序',
  `scheme_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '关键词的跳转链接',
  `type` int(11) NOT NULL DEFAULT 0 COMMENT '类型',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '关键词表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_merch
-- ----------------------------
DROP TABLE IF EXISTS `mall_merch`;
CREATE TABLE `mall_merch`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `merch_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户编号',
  `merch_name` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户名称',
  `merch_short_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户简称',
  `merch_img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户图片',
  `sort_order` int(11) DEFAULT NULL COMMENT '排序',
  `is_show` tinyint(1) UNSIGNED DEFAULT 1 COMMENT '是否显示:0是;1否',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 35 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_merch_user
-- ----------------------------
DROP TABLE IF EXISTS `mall_merch_user`;
CREATE TABLE `mall_merch_user`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `merch_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店编号',
  `user_id` int(11) DEFAULT NULL COMMENT '用户编号',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `is_load_goods` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '门店商品是否有修改，  0：否 1：是',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `store_id_merch_sn_index`(`store_id`, `merch_sn`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 77671 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户商户关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_mng_change
-- ----------------------------
DROP TABLE IF EXISTS `mall_mng_change`;
CREATE TABLE `mall_mng_change`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `change_num` int(11) DEFAULT NULL COMMENT '商品库存变化数',
  `original_num` int(11) DEFAULT NULL COMMENT '商品原库存数',
  `valid_num` int(11) DEFAULT NULL COMMENT '商品库存可用数',
  `merch_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户编号',
  `third_party_merch_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '第三方商户代码',
  `goods_id` int(11) DEFAULT NULL COMMENT '商品id',
  `is_valid` int(11) DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `change_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '变动类型 0：还原 1：扣减 2:新增调整 3：更新调整增加 4：更新调整减少',
  `change_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '变动原因',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `order_sn` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 372590 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '库存变化表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_order
-- ----------------------------
DROP TABLE IF EXISTS `mall_order`;
CREATE TABLE `mall_order`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `merch_order_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户订单编号',
  `order_type` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订单类型 1普通订单 2团购订单',
  `order_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '订单编号：商户（拼音首字母）+业务类型+编号',
  `user_id` mediumint(8) UNSIGNED DEFAULT 0 COMMENT '用户编号',
  `order_biz_type` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订单业务类型：00:保税备货， 02:保税展示补货，10:保税展示跨境，11:普通商品',
  `order_status` int(11) DEFAULT NULL COMMENT '订单状态： 0订单创建成功等待付款, 100订单付款中,101订单已取消，　102订单已删除，201订单已付款，等待发货，300订单已发货， 301用户确认收货，401 没有发货，退款　402 已收货，退款退货，500订单已关闭；501 支付失败',
  `pay_status` int(11) DEFAULT NULL COMMENT '付款状态 支付状态;0未付款;1付款中;2已付款;3退款中;4退款;5：退款关闭；6：退款异常；7：订单关闭；8：支付失败；',
  `pay_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '支付单号',
  `pay_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '支付人名称',
  `pay_transaction_id` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '支付流水号',
  `pay_mobile` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '支付人电话',
  `pay_time` datetime(0) DEFAULT NULL COMMENT '付款时间',
  `pay_sign` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '支付签名',
  `shipping_status` tinyint(1) UNSIGNED DEFAULT 0 COMMENT '发货状态 商品配送情况;0未发货,1已发货,2已收货,4退货',
  `shipping_id` int(3) DEFAULT 0 COMMENT '快递ID',
  `shipping_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '快递名称',
  `shipping_mobile` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '快递电话',
  `shipping_fee` decimal(10, 2) DEFAULT 0.00 COMMENT '快递费',
  `shipping_no` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '配送单号',
  `shipping_code` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '快递简写',
  `consignee` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '收货人名称',
  `mobile` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '收货人电话',
  `country` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '收货人国家',
  `province` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '收货人省',
  `city` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '收货人城市',
  `district` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '收货人区',
  `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '详细地址',
  `address_id` int(11) DEFAULT NULL COMMENT '地址编号',
  `postscript` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '补充说明',
  `actual_price` decimal(10, 2) DEFAULT 0.00 COMMENT '实际需要支付的金额',
  `integral` int(10) UNSIGNED DEFAULT 0 COMMENT '积分',
  `integral_money` decimal(10, 2) DEFAULT 0.00 COMMENT '积分抵扣金额',
  `order_price` decimal(10, 2) DEFAULT 0.00 COMMENT '订单总价',
  `goods_price` decimal(10, 2) DEFAULT 0.00 COMMENT '商品总价',
  `add_time` datetime(0) DEFAULT NULL COMMENT '订单创建时间',
  `confirm_time` datetime(0) DEFAULT NULL COMMENT '订单确认时间',
  `freight_price` int(10) UNSIGNED DEFAULT 0 COMMENT '配送费用',
  `coupon_id` mediumint(8) UNSIGNED DEFAULT 0 COMMENT '使用的优惠券id，对应mk_store_ticket_discount表的tick_disc_id字段',
  `coupon_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '优惠券名称',
  `coupon_price` decimal(10, 2) DEFAULT NULL COMMENT '优惠券优惠金额',
  `callback_status` enum('true','false') CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT 'true' COMMENT '废弃',
  `camp_minus_id` int(11) DEFAULT NULL COMMENT '促销活动id，满减满折表',
  `camp_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '促销活动名称',
  `full_cut_price` decimal(10, 2) DEFAULT NULL COMMENT '促销活动费用',
  `activity_id` bigint(20) DEFAULT NULL COMMENT '活动Id',
  `store_id` int(11) DEFAULT NULL COMMENT '门店Id',
  `delivery_date` datetime(0) DEFAULT NULL COMMENT '送达日期',
  `delivery_remark` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '送到说明',
  `predict_time` datetime(0) DEFAULT NULL COMMENT '预计送达时间',
  `comment_count` tinyint(4) DEFAULT 0 COMMENT '评价次数 0未评价 1评价一次',
  `buyer_pay_check` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订购人支付人校验，0:未知，1:一致，2:不一致,3:校验异常，核对订购人与支付人证件类型，证件号码，姓名是否一致',
  `pay_flag` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '支付方式：weixin:微信;pingan平安支付;wxglobalpay:微信国际支付;tenpay:QQ财付通;alipay:支付宝;cash:现金',
  `is_scan` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否扫描 0：未扫描 1:已扫描；',
  `is_merge_pay` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否合并支付：0：单笔支付，1：合并支付；业务类型不同是否合并支付',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `order_sn_wx` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '付款码支付成功时发往微信的订单编号',
  `ali_trade_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '支付宝流水号',
  `cash_fee` int(11) DEFAULT NULL COMMENT '用户支付金额；微信国际支付返回数据',
  `cash_fee_type` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户支付币种；微信国际支付返回数据',
  `total_fee` int(11) DEFAULT NULL COMMENT '标价金额；微信国际支付返回数据',
  `fee_type` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '标价币种；微信国际支付返回数据',
  `rate` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '汇率；微信国际支付返回数据',
  `is_onffline_order` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '区分是否线下订单：0：线上购买 1：线下购买  ',
  `resend_order_status` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订单重推状态：1:为重推；2:已重推;',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `order_sn`(`order_sn`) USING BTREE,
  INDEX `user_id`(`user_id`) USING BTREE,
  INDEX `order_status`(`order_status`) USING BTREE,
  INDEX `shipping_status`(`shipping_status`) USING BTREE,
  INDEX `pay_status`(`pay_status`) USING BTREE,
  INDEX `shipping_id`(`shipping_id`) USING BTREE,
  INDEX `pay_id`(`pay_id`) USING BTREE,
  INDEX `query_index`(`id`, `store_id`, `user_id`, `order_status`) USING BTREE,
  INDEX `id`(`id`) USING BTREE,
  INDEX `store_id`(`store_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 148730 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订单表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_order_buyer_pay_check
-- ----------------------------
DROP TABLE IF EXISTS `mall_order_buyer_pay_check`;
CREATE TABLE `mall_order_buyer_pay_check`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `order_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单编号',
  `buyer_pay_check` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订购人支付人核验，0:一致，1:不一致，2:未知，核对订购人与支付人证件类型，证件号码，姓名是否一致',
  `check_time` datetime(0) DEFAULT NULL COMMENT '核验时间',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '订单订购人支付人核验记录' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_order_compared_error
-- ----------------------------
DROP TABLE IF EXISTS `mall_order_compared_error`;
CREATE TABLE `mall_order_compared_error`  (
  `moce_id` int(11) NOT NULL AUTO_INCREMENT,
  `merch_order_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `order_amount` decimal(10, 2) DEFAULT NULL,
  `order_source` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `create_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `reason` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`moce_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 22713 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_order_exception_record
-- ----------------------------
DROP TABLE IF EXISTS `mall_order_exception_record`;
CREATE TABLE `mall_order_exception_record`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `order_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单编号',
  `user_id` mediumint(8) DEFAULT NULL COMMENT '用户编号',
  `exception_content` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '异常信息',
  `exception_status` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '异常状态 00订单支付失败01系统异常02订单超时03订单退款失败04其他',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 112 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '订单异常记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_order_goods
-- ----------------------------
DROP TABLE IF EXISTS `mall_order_goods`;
CREATE TABLE `mall_order_goods`  (
  `id` int(12) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `order_id` int(12) UNSIGNED NOT NULL DEFAULT 0 COMMENT '订单Id',
  `goods_id` int(12) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品id',
  `sku` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'sku',
  `goods_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品名称',
  `goods_sn` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品序列号',
  `product_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0 COMMENT '产品Id',
  `number` smallint(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT '商品数量',
  `market_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '市场价',
  `goods_rate` decimal(10, 4) DEFAULT NULL COMMENT '商品税率',
  `retail_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '零售价格（含税价格）',
  `discounted_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '已优惠价（含税价格）',
  `actual_payment_amount` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '实际支付价（含税价格）',
  `tax_price` decimal(10, 2) DEFAULT NULL COMMENT '税费',
  `settle_price` decimal(10, 2) DEFAULT NULL COMMENT '商品结算平摊价格（含运费金额） = 单商品总价+运费税率；商品结算平摊价格（含优惠券金额） = 单商品总价-优惠券税率',
  `goods_specification_name_value` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '商品规格详情',
  `is_real` tinyint(1) UNSIGNED DEFAULT 0 COMMENT '虚拟商品',
  `goods_specification_ids` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '商品规格Ids',
  `list_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '图片链接',
  `order_biz_type` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订单业务类型：00:保税备货， 02:保税展示补货，10:保税展示跨境，11:普通商品',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `is_dist_sell_scan` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订单详情是否被渠道销售扫描 0：否 1：是',
  `store_topic_id` int(11) DEFAULT NULL COMMENT '活动Id',
  `activity` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '活动名称',
  `deduction_score` int(8) DEFAULT NULL COMMENT '计算出的抵扣积分数量',
  `deduction_price` decimal(10, 2) DEFAULT NULL COMMENT '积分抵扣金额',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `order_id`(`order_id`) USING BTREE,
  INDEX `goods_id`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 386127 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订单详情表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_order_process_record
-- ----------------------------
DROP TABLE IF EXISTS `mall_order_process_record`;
CREATE TABLE `mall_order_process_record`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
  `order_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订单编号',
  `user_id` mediumint(8) DEFAULT NULL COMMENT '用户编号',
  `order_biz_type` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订单业务类型：00:保税备货， 02:保税展示补货，10:保税展示跨境，11:普通商品',
  `add_order_start_time` datetime(0) DEFAULT NULL COMMENT '下单开始时间',
  `add_order_succ_time` datetime(0) DEFAULT NULL COMMENT '下单成功时间',
  `is_add_order_send` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '下单发送状态 0：失败；1：成功',
  `pay_start_time` datetime(0) DEFAULT NULL COMMENT '支付开始时间',
  `pay_succ_time` datetime(0) DEFAULT NULL COMMENT '支付成功时间',
  `payment_start_time` datetime(0) DEFAULT NULL COMMENT '支付单开始时间',
  `payment_succ_time` datetime(0) DEFAULT NULL COMMENT '支付单成功时间',
  `is_payment_send` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '支付单状态 0：失败；1：成功；2：支付单单申报中',
  `ele_order_start_time` datetime(0) DEFAULT NULL COMMENT '电子订单开始时间',
  `ele_order_succ_time` datetime(0) DEFAULT NULL COMMENT '电子订单成功时间',
  `is_ele_order_send` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '电子订单状态 0：失败；1：成功；2：电子订单申报中',
  `waybill_start_time` datetime(0) DEFAULT NULL COMMENT '运单开始时间',
  `waybill_succ_time` datetime(0) DEFAULT NULL COMMENT '运单成功时间',
  `logistics_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '运单编号',
  `customs_start_time` datetime(0) DEFAULT NULL COMMENT '清单开始时间',
  `customs_succ_time` datetime(0) DEFAULT NULL COMMENT '清单成功时间',
  `invt_no` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '清单编号',
  `is_customs_send` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '清关状态 1：放行:2：查验；3：清关失败； 4：其他',
  `customs_send_sms_status` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '清关成功发送短信状态 0：未开始；1：成功；2：失败；3：发送中',
  `shipment_start_time` datetime(0) DEFAULT NULL COMMENT '出货开始时间',
  `shipment_succ_time` datetime(0) DEFAULT NULL COMMENT '出货成功时间',
  `process_content` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订单流转信息',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `customs_msg` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '海关清关结果信息',
  `shipping_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '快递公司简称',
  `shipping_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '快递公司名称',
  `clear_type` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '1：放行:2：查验；3：清关失败； 4：其他',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 144263 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '订单流转过程记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_order_refund
-- ----------------------------
DROP TABLE IF EXISTS `mall_order_refund`;
CREATE TABLE `mall_order_refund`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `order_id` mediumint(1) NOT NULL COMMENT '订单Id',
  `user_id` mediumint(8) UNSIGNED DEFAULT 0 COMMENT '用户Id',
  `out_refund_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '商户退款单号',
  `refund_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '微信退款单号',
  `refund_type` tinyint(3) DEFAULT 1 COMMENT '退款类型 1用户全额退款 2系统部分退款',
  `refund_time` datetime(0) DEFAULT NULL COMMENT '退款时间',
  `creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `refund_money` decimal(8, 2) DEFAULT NULL COMMENT '退款金额',
  `refund_status` int(11) DEFAULT NULL COMMENT '退款状态 1申请中 2退款成功 3已拒绝 4微信退款失败 5微信退款处理中',
  `refund_reason` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '退款原因',
  `wechat_refund_status_des` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '微信退款状态 SUCCESS—退款成功 REFUNDCLOSE—退款关闭。PROCESSING—退款处理中 CHANGE—退款异常，退款到银行发现用户的卡作废或者冻结了，导致原路退款银行卡失败',
  `refund_recv_accout` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '退款入账账户 1）退回银行卡：{银行名称}{卡类型}{卡尾号} 2）退回支付用户零钱:支付用户零钱3）退还商户:商户基本账户 商户结算银行账户4）退回支付用户零钱通:支付用户零钱通',
  `approver` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '审核人',
  `approval_time` datetime(0) DEFAULT NULL COMMENT '审核时间',
  `approval_remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '审核备注',
  `create_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `refund_fee_type` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '退款币种；微信国际退款返回数据',
  `total_fee` int(11) DEFAULT NULL COMMENT '标价金额；微信国际支付返回数据',
  `fee_type` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '标价币种；微信国际支付返回数据',
  `cash_fee` int(11) DEFAULT NULL COMMENT '用户支付金额；微信国际支付返回数据',
  `cash_fee_type` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户支付币种；微信国际支付返回数据',
  `cash_refund_fee` int(11) DEFAULT NULL COMMENT '用户支付退款金额；微信国际退款返回数据',
  `cash_refund_fee_type` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户支付退款币种；微信国际退款返回数据',
  `rate` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '汇率；微信国际支付返回数据',
  `restore` int(10) DEFAULT NULL COMMENT '是否需要恢复库存',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4345 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订单退款记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_order_wxpay_record
-- ----------------------------
DROP TABLE IF EXISTS `mall_order_wxpay_record`;
CREATE TABLE `mall_order_wxpay_record`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `return_code` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '返回状态码',
  `return_msg` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '返回信息',
  `result_code` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '业务结果',
  `err_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '错误代码',
  `err_code_des` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '错误代码描述',
  `openid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户标识',
  `is_subscribe` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否关注公众账号',
  `trade_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '交易类型(MICROPAY 付款码支付)',
  `fee_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '货币类型(默认人民币：CNY)',
  `total_fee` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单金额(订单总金额，单位为分，只能为整数)',
  `transaction_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '微信支付订单号',
  `out_trade_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户订单号',
  `out_trade_no_wx` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '发送给微信的商户订单号  outTradeNo + _ + (发送次数-1)',
  `attach` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商家数据包，原样返回',
  `time_end` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '支付完成时间，格式为yyyyMMddHHmmss',
  `trade_state` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '交易状态,SUCCESS—支付成功,REFUND—转入退款,NOTPAY—未支付,CLOSED—已关闭,REVOKED—已撤销（付款码支付）,USERPAYING--用户支付中（付款码支付）,PAYERROR--支付失败(其他原因，如银行返回失败)',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `out_trade_no_wx`(`out_trade_no_wx`) USING BTREE,
  INDEX `out_trade_no`(`out_trade_no`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 147817 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信付款码支付记录' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_pay_order_info
-- ----------------------------
DROP TABLE IF EXISTS `mall_pay_order_info`;
CREATE TABLE `mall_pay_order_info`  (
  `mpoi_id` int(11) NOT NULL AUTO_INCREMENT,
  `merch_order_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `pay_status` varchar(5) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `order_amount` decimal(10, 2) DEFAULT NULL,
  `refund_amount` decimal(10, 2) DEFAULT NULL,
  `order_status` varchar(5) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `pay_flag` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `pay_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `import_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `importer` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `compared` varchar(2) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `compared_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `tstm` timestamp(0) DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`mpoi_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 92377 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_payer_child_order_real
-- ----------------------------
DROP TABLE IF EXISTS `mall_payer_child_order_real`;
CREATE TABLE `mall_payer_child_order_real`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `order_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单编号',
  `user_id` mediumint(8) DEFAULT NULL COMMENT '用户编号',
  `merch_order_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户订单号',
  `pay_no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '支付单编号',
  `merch_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户编号',
  `pay_price` decimal(10, 2) DEFAULT NULL COMMENT '子订单实付金额',
  `goods_biz_type` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '货品业务类型， 01:保税展示店提，02:一般贸易，10:保税展示补货',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '支付单子订单关联记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_pick_up_code
-- ----------------------------
DROP TABLE IF EXISTS `mall_pick_up_code`;
CREATE TABLE `mall_pick_up_code`  (
  `order_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '订单编号：商户（拼音首字母）+业务类型+编号',
  `pick_up_code_sn` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '取货码',
  `merch_order_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户订单编号',
  `pick_up_code_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '取货码状态：0:待清关，1:核销成功，2:清关成功,3：退款，4:清关失败，5：已提货，6：订单推单失败',
  `pick_up_code_createtime` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '取货码生成时间',
  `pick_up_code_verificationtime` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '取货码核销时间',
  `store_id` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '门店id',
  `create_time` datetime(0) DEFAULT NULL COMMENT '+创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '+修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '+修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '+时间戳',
  PRIMARY KEY (`order_sn`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '取货码信息表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_price_modification_record
-- ----------------------------
DROP TABLE IF EXISTS `mall_price_modification_record`;
CREATE TABLE `mall_price_modification_record`  (
  `mpmr_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '价格修改记录表id',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户编码',
  `third_merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '第三方商户',
  `shop_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店编码',
  `barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '条码',
  `sku` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'sku',
  `current_price` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '当前价格',
  `modify_price` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改价格',
  `modify_type` int(11) DEFAULT NULL COMMENT '修改方式 （1.界面修改 2.excel修改 ）',
  `modify_source` int(11) DEFAULT NULL COMMENT '修改价格源头 (1.门店商品 2.日常活动 3.临时促销)',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`mpmr_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '价格修改记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_product
-- ----------------------------
DROP TABLE IF EXISTS `mall_product`;
CREATE TABLE `mall_product`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `goods_id` int(11) UNSIGNED DEFAULT 0 COMMENT '商品Id',
  `goods_specification_ids` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '商品规格ids',
  `goods_sn` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '商品序列号',
  `goods_number` mediumint(8) UNSIGNED DEFAULT 0 COMMENT '商品编码',
  `retail_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '零售价格',
  `market_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '团购价格',
  `goods_specification_name_value` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '规格属性组成的字符串，用来显示用',
  `goods_default` tinyint(4) DEFAULT 0 COMMENT '商品默认 0否 1是',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 13301 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_product_store_rela
-- ----------------------------
DROP TABLE IF EXISTS `mall_product_store_rela`;
CREATE TABLE `mall_product_store_rela`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `store_id` mediumint(8) NOT NULL COMMENT '门店Id',
  `product_id` mediumint(8) NOT NULL COMMENT '门店产品Id',
  `sku` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'sku',
  `stock_num` int(6) DEFAULT NULL COMMENT '库存数量',
  `goods_id` int(11) NOT NULL COMMENT '商品Id',
  `retail_price` decimal(10, 2) DEFAULT NULL COMMENT '零售价格',
  `market_price` decimal(10, 2) DEFAULT NULL COMMENT '市场价格',
  `stock_price` decimal(10, 2) DEFAULT NULL COMMENT '库存价格',
  `sell_volume` int(11) UNSIGNED DEFAULT 0 COMMENT '销售量',
  `goods_biz_type` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '货品业务类型， 01:保税展示店提，02:一般贸易，10:保税展示补货',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `category_id` int(11) UNSIGNED DEFAULT 0 COMMENT '分类id',
  `brand_id` int(11) UNSIGNED DEFAULT 0 COMMENT '品牌id',
  `freight_id` int(11) DEFAULT NULL COMMENT '运费id',
  `attribute_category` int(11) UNSIGNED DEFAULT 0 COMMENT '商品属性分类id(改为分类id父节点)',
  `supplier_third_id` int(11) DEFAULT NULL COMMENT '商品供货商所属第三方商户id',
  `hot_sort_num` int(11) DEFAULT NULL COMMENT '商品热销排序',
  `batch_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '批次编号',
  `batch_expire_date` datetime(0) DEFAULT NULL COMMENT '批次到期时间',
  `bottom_line_price` decimal(10, 2) DEFAULT NULL COMMENT '底线价',
  `park_stock` int(8) DEFAULT NULL COMMENT '园区库存',
  `last_sale_time` datetime(0) DEFAULT NULL COMMENT '最后销售时间',
  `to_be_restored` int(11) DEFAULT NULL COMMENT '待退款数量',
  `exit_region_number` int(11) DEFAULT NULL COMMENT '出区数',
  `points_rules_id` int(12) DEFAULT NULL COMMENT '积分生成规则id',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `goods_id_index`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 20103 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '门店商品表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_product_store_rela_copy1
-- ----------------------------
DROP TABLE IF EXISTS `mall_product_store_rela_copy1`;
CREATE TABLE `mall_product_store_rela_copy1`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `store_id` mediumint(8) NOT NULL COMMENT '门店Id',
  `product_id` mediumint(8) NOT NULL COMMENT '门店产品Id',
  `sku` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'sku',
  `stock_num` int(6) DEFAULT NULL COMMENT '库存数量',
  `goods_id` int(11) NOT NULL COMMENT '商品Id',
  `retail_price` decimal(10, 2) DEFAULT NULL COMMENT '零售价格',
  `market_price` decimal(10, 2) DEFAULT NULL COMMENT '市场价格',
  `stock_price` decimal(10, 2) DEFAULT NULL COMMENT '库存价格',
  `sell_volume` int(11) UNSIGNED DEFAULT 0 COMMENT '销售量',
  `goods_biz_type` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '货品业务类型， 01:保税展示店提，02:一般贸易，10:保税展示补货',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `category_id` int(11) UNSIGNED DEFAULT 0 COMMENT '分类id',
  `brand_id` int(11) UNSIGNED DEFAULT 0 COMMENT '品牌id',
  `freight_id` int(11) DEFAULT NULL COMMENT '运费id',
  `attribute_category` int(11) UNSIGNED DEFAULT 0 COMMENT '商品属性分类id(改为分类id父节点)',
  `supplier_third_id` int(11) DEFAULT NULL COMMENT '商品供货商所属第三方商户id',
  `hot_sort_num` int(11) DEFAULT NULL COMMENT '商品热销排序',
  `batch_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '批次编号',
  `batch_expire_date` datetime(0) DEFAULT NULL COMMENT '批次到期时间',
  `bottom_line_price` decimal(10, 2) DEFAULT NULL COMMENT '底线价',
  `park_stock` int(8) DEFAULT NULL COMMENT '园区库存',
  `last_sale_time` datetime(0) DEFAULT NULL COMMENT '最后销售时间',
  `to_be_restored` int(11) DEFAULT NULL COMMENT '待退款数量',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `goods_id_index`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 13767 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '门店商品表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_product_store_rela_copy2
-- ----------------------------
DROP TABLE IF EXISTS `mall_product_store_rela_copy2`;
CREATE TABLE `mall_product_store_rela_copy2`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `store_id` mediumint(8) NOT NULL COMMENT '门店Id',
  `product_id` mediumint(8) NOT NULL COMMENT '门店产品Id',
  `sku` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'sku',
  `stock_num` int(6) DEFAULT NULL COMMENT '库存数量',
  `goods_id` int(11) NOT NULL COMMENT '商品Id',
  `retail_price` decimal(10, 2) DEFAULT NULL COMMENT '零售价格',
  `market_price` decimal(10, 2) DEFAULT NULL COMMENT '市场价格',
  `stock_price` decimal(10, 2) DEFAULT NULL COMMENT '库存价格',
  `sell_volume` int(11) UNSIGNED DEFAULT 0 COMMENT '销售量',
  `goods_biz_type` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '货品业务类型， 01:保税展示店提，02:一般贸易，10:保税展示补货',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `category_id` int(11) UNSIGNED DEFAULT 0 COMMENT '分类id',
  `brand_id` int(11) UNSIGNED DEFAULT 0 COMMENT '品牌id',
  `freight_id` int(11) DEFAULT NULL COMMENT '运费id',
  `attribute_category` int(11) UNSIGNED DEFAULT 0 COMMENT '商品属性分类id(改为分类id父节点)',
  `supplier_third_id` int(11) DEFAULT NULL COMMENT '商品供货商所属第三方商户id',
  `hot_sort_num` int(11) DEFAULT NULL COMMENT '商品热销排序',
  `batch_sn` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '批次编号',
  `batch_expire_date` datetime(0) DEFAULT NULL COMMENT '批次到期时间',
  `bottom_line_price` decimal(10, 2) DEFAULT NULL COMMENT '底线价',
  `park_stock` int(8) DEFAULT NULL COMMENT '园区库存',
  `last_sale_time` datetime(0) DEFAULT NULL COMMENT '最后销售时间',
  `to_be_restored` int(11) DEFAULT NULL COMMENT '待退款数量',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `goods_id_index`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 13767 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '门店商品表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_region
-- ----------------------------
DROP TABLE IF EXISTS `mall_region`;
CREATE TABLE `mall_region`  (
  `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `parent_id` smallint(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT '父级id',
  `name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '地区名称',
  `type` tinyint(1) DEFAULT 2,
  `agency_id` smallint(5) UNSIGNED DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `parent_id`(`parent_id`) USING BTREE,
  INDEX `region_type`(`type`) USING BTREE,
  INDEX `agency_id`(`agency_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4108 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_related_goods
-- ----------------------------
DROP TABLE IF EXISTS `mall_related_goods`;
CREATE TABLE `mall_related_goods`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `goods_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品Id',
  `related_goods_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联商品id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_sale_record
-- ----------------------------
DROP TABLE IF EXISTS `mall_sale_record`;
CREATE TABLE `mall_sale_record`  (
  `msr_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `order_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订单编号',
  `cashier_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '收银机编号',
  `saller_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '店员id',
  `discount_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '活动id',
  `sales_time` datetime(0) DEFAULT NULL COMMENT '销售时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`msr_id`) USING BTREE,
  UNIQUE INDEX `order_sn`(`order_sn`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 143333 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '销售记录' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_sales_data_download
-- ----------------------------
DROP TABLE IF EXISTS `mall_sales_data_download`;
CREATE TABLE `mall_sales_data_download`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '下载编号',
  `file_id` mediumint(8) DEFAULT NULL COMMENT '下载文件编号',
  `download_ip` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '下载人IP',
  `download_sn` mediumint(8) DEFAULT NULL COMMENT '下载人编号',
  `download_time` datetime(0) DEFAULT NULL COMMENT '下载时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 633 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '销售数据下载表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_sales_data_upload
-- ----------------------------
DROP TABLE IF EXISTS `mall_sales_data_upload`;
CREATE TABLE `mall_sales_data_upload`  (
  `file_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '上传文件编号',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `third_merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户编号',
  `shop_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '门店编号',
  `file_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '文件名称',
  `file_type` varchar(72) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '文件类型',
  `upload_address` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '上传地址',
  `bill_time` datetime(0) DEFAULT NULL COMMENT '账单时间',
  `check_time` datetime(0) DEFAULT NULL COMMENT '核对时间',
  `creater_sn` mediumint(8) DEFAULT NULL COMMENT '添加人编号',
  `creater_time` datetime(0) DEFAULT NULL COMMENT '加入时间',
  PRIMARY KEY (`file_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 704 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '销售数据上传表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_sales_detail_data_log
-- ----------------------------
DROP TABLE IF EXISTS `mall_sales_detail_data_log`;
CREATE TABLE `mall_sales_detail_data_log`  (
  `id` mediumint(8) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `merch_sn_name` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户名称',
  `third_merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户编号',
  `third_merch_sn_name` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户名称',
  `receipt_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '销售单号',
  `store_name` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '门店名称',
  `store_name_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '门店编号',
  `ash_register_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '收银台',
  `time_stamp` datetime(0) DEFAULT NULL COMMENT '销售时间',
  `staff_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '收银员id',
  `staff_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '收银员姓名',
  `pay_flag` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '支付方式',
  `order_status` int(11) DEFAULT NULL COMMENT '支付状态',
  `order_sn_wx` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '微信流水号',
  `order_sn_ali` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '支付宝流水号',
  `hs_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关商品编码',
  `hs_code_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '品类名称',
  `ematou_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '料件号',
  `plu` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'PLU',
  `mychem_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'MychemID',
  `product_name_en` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品名称(英文)',
  `product_name_cn` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品名称(中文)',
  `barcode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品主条码',
  `pack_size` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '规格',
  `product_spec` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '单位',
  `brand` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '品牌',
  `edlp` decimal(10, 2) DEFAULT NULL COMMENT '日常价',
  `current_price` decimal(10, 2) DEFAULT NULL COMMENT '实际销售价',
  `cost_price` decimal(10, 2) DEFAULT NULL COMMENT '进货价',
  `tax_rate` decimal(10, 0) DEFAULT NULL COMMENT '综合税率',
  `product_category` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品类型',
  `supplier_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '主供应商名称',
  `transaction_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '销售类型',
  `sale_return_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '退货类型',
  `remark` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) DEFAULT CURRENT_TIMESTAMP COMMENT '时间戳',
  `det_status` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'eccs推送状态(1:推送成功；2：推送失败；3：待推送)',
  `det_msg` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'eccs返回结果',
  `det_date` datetime(0) DEFAULT NULL COMMENT '推送时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `index_receipt_no`(`receipt_no`) USING BTREE,
  INDEX `index_time_stamp`(`time_stamp`) USING BTREE,
  INDEX `index_time_receipt`(`receipt_no`, `time_stamp`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1463 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'kmall数据接收表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_search_history
-- ----------------------------
DROP TABLE IF EXISTS `mall_search_history`;
CREATE TABLE `mall_search_history`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `keyword` char(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '关键字',
  `from` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '搜索来源，如PC、小程序、APP等',
  `add_time` int(11) NOT NULL DEFAULT 0 COMMENT '搜索时间',
  `user_id` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '会员Id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_shipping
-- ----------------------------
DROP TABLE IF EXISTS `mall_shipping`;
CREATE TABLE `mall_shipping`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '物流编号',
  `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '物流名称',
  `status` int(1) UNSIGNED ZEROFILL NOT NULL DEFAULT 0 COMMENT '状态 0正常 1删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 103 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_shop_error_price_record
-- ----------------------------
DROP TABLE IF EXISTS `mall_shop_error_price_record`;
CREATE TABLE `mall_shop_error_price_record`  (
  `msepr_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '异常记录id',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户编码',
  `third_merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '第三方商户',
  `shop_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店编码',
  `barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '条码',
  `sku` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'sku',
  `current_price` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '当前价格',
  `price_type` int(2) DEFAULT NULL COMMENT '价格来源  （1.门店商品 2.日常活动 3.临时促销）',
  `suggested_price` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '建议价格',
  `check_time` datetime(0) DEFAULT NULL COMMENT '校验时间',
  `verifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '校验人',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  `lowest_price` decimal(10, 2) DEFAULT NULL COMMENT '最低价格',
  `highest_price` decimal(10, 2) DEFAULT NULL COMMENT '最高价格',
  `modify` varchar(2) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '是否修改过',
  `mka_id` int(11) DEFAULT NULL COMMENT '活动id',
  PRIMARY KEY (`msepr_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '门店价格异常记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_specification
-- ----------------------------
DROP TABLE IF EXISTS `mall_specification`;
CREATE TABLE `mall_specification`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '规范名称',
  `sort_order` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '规格表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_store
-- ----------------------------
DROP TABLE IF EXISTS `mall_store`;
CREATE TABLE `mall_store`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `merch_name` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户名称',
  `store_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '门店名称',
  `store_number` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '门店编号',
  `store_address` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '门店地址',
  `province_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '省',
  `city_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '市',
  `county_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '区',
  `latitude` decimal(10, 6) UNSIGNED DEFAULT 0.000000 COMMENT '纬度',
  `longitude` decimal(10, 6) UNSIGNED DEFAULT 0.000000 COMMENT '经度',
  `cover_radius` decimal(6, 2) DEFAULT NULL COMMENT '配送半径（km）',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `third_party_merch_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户编号',
  `third_party_merch_name` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户名称',
  `expr_agreement_type` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户快递协议类型，00:e码头，01:商户自谈',
  `is_valid` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `is_load_goods` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '门店商品是否有修改，  0：否 1：是',
  `telephone_number` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '门店电话',
  `store_img_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '门店二维码图片地址',
  `points_rules_id` int(12) DEFAULT NULL COMMENT '积分生成规则类型ID',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `id_index`(`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 174 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户门店表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_store_coupon
-- ----------------------------
DROP TABLE IF EXISTS `mall_store_coupon`;
CREATE TABLE `mall_store_coupon`  (
  `id` mediumint(8) NOT NULL COMMENT '编号',
  `coupon_id` tinyint(3) UNSIGNED DEFAULT 0 COMMENT '活动id',
  `coupon_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '活动名称',
  `store_id` mediumint(8) DEFAULT NULL COMMENT '门店id',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店活动表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_store_goods_gallery
-- ----------------------------
DROP TABLE IF EXISTS `mall_store_goods_gallery`;
CREATE TABLE `mall_store_goods_gallery`  (
  `id` int(11) NOT NULL COMMENT '主键',
  `goods_id` int(11) DEFAULT NULL COMMENT '商品id',
  `product_store_id` mediumint(8) DEFAULT NULL COMMENT '门店商品id',
  `img_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '详情信息',
  `sort_order` int(11) DEFAULT NULL COMMENT '排序',
  `img_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '详情图片信息',
  `goods_biz_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '货品业务类型， 00:保税备货， 02:保税展示补货，10:保税展示跨境，11:普通商品',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店商品详情表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_store_mng
-- ----------------------------
DROP TABLE IF EXISTS `mall_store_mng`;
CREATE TABLE `mall_store_mng`  (
  `id` int(11) NOT NULL COMMENT '编号',
  `mall_store_id` int(11) DEFAULT NULL COMMENT '门店编号',
  `sku` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'sku',
  `goods_biz_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '货品业务类型， 00:保税备货， 02:保税展示补货，10:保税展示跨境，11:普通商品',
  `store_num` int(11) DEFAULT NULL COMMENT '门店库存',
  `store_valid_num` int(11) DEFAULT NULL COMMENT '门店可用数',
  `store_freeze_num` int(11) DEFAULT NULL COMMENT '门店冻结数',
  `is_valid` int(11) DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店商品库存表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_store_mng_change
-- ----------------------------
DROP TABLE IF EXISTS `mall_store_mng_change`;
CREATE TABLE `mall_store_mng_change`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `store_change_num` int(11) DEFAULT NULL COMMENT '门店库存变化数',
  `store_original_num` int(11) DEFAULT NULL COMMENT '门店原库存数',
  `store_valid_num` int(11) DEFAULT NULL COMMENT '门店库存可用数',
  `merch_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户编号',
  `store_id` mediumint(8) DEFAULT NULL COMMENT '门店编号',
  `goods_id` int(11) DEFAULT NULL COMMENT '商品id',
  `is_valid` int(11) DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `change_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '变动类型 0：还原 1：扣减 2:新增调整 3：更新调整增加 4：更新调整减少',
  `change_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '变动原因',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `order_sn` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 383533 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店库存变化表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_store_sms_config
-- ----------------------------
DROP TABLE IF EXISTS `mall_store_sms_config`;
CREATE TABLE `mall_store_sms_config`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `store_id` int(11) DEFAULT NULL COMMENT '门店id',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `send_start_time` datetime(0) DEFAULT NULL COMMENT '发送开始时间',
  `send_end_time` datetime(0) DEFAULT NULL COMMENT '发送结束时间',
  `is_valid` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '是否有效,0:有效，1:无效',
  `is_enable` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '启用状态,0:按时间启用，1:禁用 2:全部发送',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `goods_id`(`store_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '门店短信配置表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_store_topic
-- ----------------------------
DROP TABLE IF EXISTS `mall_store_topic`;
CREATE TABLE `mall_store_topic`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '活动名称',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '活动内容',
  `item_pic_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '活动图片',
  `subtitle` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '\'' COMMENT '子标题',
  `prom_type_id` int(11) UNSIGNED DEFAULT 0 COMMENT '活动类别',
  `topic_price` decimal(10, 2) UNSIGNED DEFAULT 0.00 COMMENT '活动价格',
  `store_id` int(11) DEFAULT NULL COMMENT '门店id',
  `third_merch_sn` int(11) DEFAULT NULL COMMENT '第三方商户id',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `topic_id`(`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 356 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店活动表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_store_transfer_inventory_order
-- ----------------------------
DROP TABLE IF EXISTS `mall_store_transfer_inventory_order`;
CREATE TABLE `mall_store_transfer_inventory_order`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '门店转移单id',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户编号',
  `merch_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户名称',
  `in_store_sn` varchar(30) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '转入门店编号',
  `in_store_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '转入门店名称',
  `out_store_sn` varchar(30) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '转出门店编号',
  `out_store_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '转出门店名称',
  `status` int(11) DEFAULT 0 COMMENT '状态 0：未转移 1：转移成功 2：转移失败',
  `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '备注',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `create_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人',
  `modify_time` timestamp(0) DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `modify_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `mall_stio_merch_sn_idx`(`merch_sn`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '门店库存转移单表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_store_transfer_inventory_order_detail
-- ----------------------------
DROP TABLE IF EXISTS `mall_store_transfer_inventory_order_detail`;
CREATE TABLE `mall_store_transfer_inventory_order_detail`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '门店转移单详情id',
  `order_id` int(11) DEFAULT NULL COMMENT '门店转移单id',
  `sku` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '转移商品sku',
  `num` int(11) DEFAULT NULL COMMENT '转移商品数量',
  `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '备注',
  `create_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人',
  `modify_time` timestamp(0) DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `modify_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `mall_stiod_order_id_idx`(`order_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 558 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '门店库存转移单详情表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_supplier
-- ----------------------------
DROP TABLE IF EXISTS `mall_supplier`;
CREATE TABLE `mall_supplier`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `level_merch_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '一级商户编号',
  `level_merch_flag` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '一级商户标识（首字母大写）',
  `child_supplier_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '二级供货商名称',
  `child_supplier_flag` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '二级供货商标识（首字母大写）',
  `sort_order` int(11) DEFAULT NULL COMMENT '排序',
  `is_show` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否禁用：0：否；1：是',
  `child_supplier_name` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '二级供货商名称',
  `third_party_merch_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户代码',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 75 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '供货商表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_tax_compared_error
-- ----------------------------
DROP TABLE IF EXISTS `mall_tax_compared_error`;
CREATE TABLE `mall_tax_compared_error`  (
  `mtce_id` int(11) NOT NULL AUTO_INCREMENT,
  `merch_order_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `kmall_tax` decimal(10, 2) DEFAULT NULL,
  `oms_tax` decimal(10, 2) DEFAULT NULL,
  `create_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`mtce_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8639 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_tax_error_record
-- ----------------------------
DROP TABLE IF EXISTS `mall_tax_error_record`;
CREATE TABLE `mall_tax_error_record`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `sku` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '料件号',
  `goods_rate` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '税率',
  `money` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '金额',
  `error_time` datetime(0) DEFAULT NULL COMMENT '异常发生时间',
  `handle` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否修改过',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1370 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '税款异常记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_tax_info
-- ----------------------------
DROP TABLE IF EXISTS `mall_tax_info`;
CREATE TABLE `mall_tax_info`  (
  `mti_id` int(11) NOT NULL AUTO_INCREMENT,
  `merch_order_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `pre_tax_price` decimal(10, 2) DEFAULT NULL,
  `tax` decimal(10, 2) DEFAULT NULL,
  `import_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `importer` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `compared` varchar(2) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `compared_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`mti_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 23718 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_template_conf
-- ----------------------------
DROP TABLE IF EXISTS `mall_template_conf`;
CREATE TABLE `mall_template_conf`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `template_type` tinyint(4) DEFAULT NULL COMMENT '模板类型 1订单付款成功 2团购成功 3拼团失败通知 4拼团进度 5 6 7订单配送 8订单评价提醒 9拼团参与通知 10待支付提醒',
  `template_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '推送模板Id',
  `desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '描述',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信模板消息日志' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_template_log
-- ----------------------------
DROP TABLE IF EXISTS `mall_template_log`;
CREATE TABLE `mall_template_log`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `user_id` int(11) NOT NULL COMMENT '用户编号',
  `template_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '模板编号',
  `desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '日志描述',
  `create_time` datetime(0) NOT NULL COMMENT '创建日期',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信模板消息日志' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_topic
-- ----------------------------
DROP TABLE IF EXISTS `mall_topic`;
CREATE TABLE `mall_topic`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '\'\'' COMMENT '活动主题',
  `content` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '活动内容',
  `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '化名',
  `item_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '活动条例图片',
  `subtitle` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '\'' COMMENT '子标题',
  `topic_category_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '活动类别',
  `price_info` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '活动价格',
  `read_count` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0',
  `scene_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '场景图片链接',
  `topic_template_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '活动模板Id',
  `topic_tag_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '活动标签Id',
  INDEX `topic_id`(`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_topic_category
-- ----------------------------
DROP TABLE IF EXISTS `mall_topic_category`;
CREATE TABLE `mall_topic_category`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '活动类别主题',
  `pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '活动类别图片链接',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_user
-- ----------------------------
DROP TABLE IF EXISTS `mall_user`;
CREATE TABLE `mall_user`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `username` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '用户姓名',
  `password` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '登陆密码',
  `gender` tinyint(1) DEFAULT NULL COMMENT '性别',
  `birthday` datetime(0) DEFAULT NULL COMMENT '出生年月格式：yyyy-MM-dd',
  `register_time` datetime(0) DEFAULT NULL COMMENT '注册时间',
  `last_login_time` datetime(0) DEFAULT NULL COMMENT '最后登陆时间',
  `last_login_ip` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '最后登陆ip',
  `user_level_id` tinyint(3) DEFAULT NULL COMMENT '用户等级id',
  `nickname` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '用户昵称',
  `mobile` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '手机号',
  `register_ip` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '注册IP',
  `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '星级',
  `weixin_openid` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '微信openid',
  `id_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '身份证号',
  `last_face_time` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '最后活体人脸核身时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `open_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海控会员系统openid',
  `member_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海控会员系统会员码',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `user_id_index`(`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 76985 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '登陆用户信息表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_user_camp_minus
-- ----------------------------
DROP TABLE IF EXISTS `mall_user_camp_minus`;
CREATE TABLE `mall_user_camp_minus`  (
  `user_camp_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户满减满折id',
  `store_topic_id` int(11) UNSIGNED DEFAULT 0 COMMENT '门店活动id',
  `camp_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '活动名称',
  `user_id` int(11) UNSIGNED DEFAULT 0 COMMENT '用户id',
  `used_time` datetime(0) DEFAULT NULL COMMENT '使用时间',
  `order_id` int(11) UNSIGNED DEFAULT 0 COMMENT '订单id',
  `end_time` datetime(0) DEFAULT NULL COMMENT '失效时间',
  `money` decimal(8, 2) DEFAULT NULL COMMENT '活动金额',
  `is_used` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否已使用 0：否；1：是',
  `creater_sn` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` datetime(0) DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`user_camp_id`) USING BTREE,
  INDEX `user_id`(`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户满减满折表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_user_collection
-- ----------------------------
DROP TABLE IF EXISTS `mall_user_collection`;
CREATE TABLE `mall_user_collection`  (
  `id` int(8) NOT NULL COMMENT '编号',
  `user_id` mediumint(8) DEFAULT NULL COMMENT '用户id',
  `good_id` int(8) DEFAULT NULL COMMENT '商品id',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户收藏表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_user_coupon
-- ----------------------------
DROP TABLE IF EXISTS `mall_user_coupon`;
CREATE TABLE `mall_user_coupon`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户活动id',
  `store_topic_id` int(11) UNSIGNED DEFAULT 0 COMMENT '门店活动id',
  `coupon_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '活动名称',
  `coupon_number` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '兑换号',
  `user_id` int(11) UNSIGNED DEFAULT 0 COMMENT '用户id',
  `used_time` datetime(0) DEFAULT NULL COMMENT '使用时间',
  `add_time` datetime(0) DEFAULT NULL COMMENT '领取时间',
  `valid_time` datetime(0) DEFAULT NULL COMMENT '生效时间',
  `order_id` mediumint(8) UNSIGNED DEFAULT 0 COMMENT '订单id',
  `source_key` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '来源key',
  `referrer` int(32) DEFAULT NULL COMMENT '发券人',
  `show_state` tinyint(4) DEFAULT NULL COMMENT '是否需要显示 0：未显示 1：已显示',
  `end_time` datetime(0) DEFAULT NULL COMMENT '失效时间',
  `type_money` decimal(8, 2) DEFAULT NULL COMMENT '活动金额',
  `send_type` tinyint(3) UNSIGNED DEFAULT 0,
  `is_used` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否已使用 0：否；1：是',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  `enabled` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '1可用 0不可用',
  `coupon_id` int(11) DEFAULT NULL COMMENT '微信审核成功后删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_id`(`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户优惠券表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_user_level
-- ----------------------------
DROP TABLE IF EXISTS `mall_user_level`;
CREATE TABLE `mall_user_level`  (
  `id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '等级名称',
  `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '描述',
  `user_id` mediumint(8) DEFAULT NULL COMMENT '用户id',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户等级表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall_wechat_followers
-- ----------------------------
DROP TABLE IF EXISTS `mall_wechat_followers`;
CREATE TABLE `mall_wechat_followers`  (
  `id` mediumint(8) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户编号',
  `wechat_followers` int(10) NOT NULL COMMENT '微信好友数',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4350 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall2_cashier
-- ----------------------------
DROP TABLE IF EXISTS `mall2_cashier`;
CREATE TABLE `mall2_cashier`  (
  `mc_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `machine_code_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '机器码类型',
  `machine_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '机器码',
  `cashier_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '收银机编号',
  `station_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '站点编码',
  `shop_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店编号',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户编号',
  `third_merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '第三方商户编号',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`mc_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 105 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '收银机表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall2_cashier_login_record
-- ----------------------------
DROP TABLE IF EXISTS `mall2_cashier_login_record`;
CREATE TABLE `mall2_cashier_login_record`  (
  `mclr_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `saller_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '店员id',
  `cashier_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '收银机id',
  `shop_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店编号',
  `login_time` datetime(0) DEFAULT NULL COMMENT '登录时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`mclr_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8899 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '店员登录收银机记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall2_express_address_info
-- ----------------------------
DROP TABLE IF EXISTS `mall2_express_address_info`;
CREATE TABLE `mall2_express_address_info`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `store_id` int(11) DEFAULT NULL COMMENT '商家编号',
  `courie_id` int(11) DEFAULT NULL COMMENT '快递编号',
  `exprtype_id` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '快递类型编号',
  `is_valid` tinyint(2) DEFAULT 0 COMMENT '快递是否启用 0禁用 1启用',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '门店和快递关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall2_express_company
-- ----------------------------
DROP TABLE IF EXISTS `mall2_express_company`;
CREATE TABLE `mall2_express_company`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `express_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '快递公司标识',
  `express_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '快递公司名称',
  `is_valid` tinyint(2) DEFAULT 0 COMMENT '是否启用 默认0：未启用 1： 启用',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `id_index`(`id`) USING BTREE COMMENT '快递编号'
) ENGINE = InnoDB AUTO_INCREMENT = 103 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '快递公司表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall2_low_price_warning
-- ----------------------------
DROP TABLE IF EXISTS `mall2_low_price_warning`;
CREATE TABLE `mall2_low_price_warning`  (
  `mlrw_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '价格过低预警id',
  `sale_price` decimal(10, 0) DEFAULT NULL COMMENT '销售价格',
  `warning_price` decimal(10, 0) DEFAULT NULL COMMENT '预警价格',
  `warning_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '预警类别  00.底线价    10.活动价',
  `sku` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '产品sku',
  `store_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店id',
  `activity_id` int(11) DEFAULT NULL COMMENT '活动id',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  `viewed` int(11) DEFAULT NULL COMMENT '是否已查看  0.否  1.是',
  PRIMARY KEY (`mlrw_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '价格过低预警表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall2_member_consumption_records
-- ----------------------------
DROP TABLE IF EXISTS `mall2_member_consumption_records`;
CREATE TABLE `mall2_member_consumption_records`  (
  `mmcr_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '用户id',
  `order_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订单编号',
  `consumption_time` datetime(0) DEFAULT NULL COMMENT '消费时间',
  `shop_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '消费门店id',
  `is_use_birthday_offer` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '是否使用生日优惠',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '+创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '+创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '+修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '+修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '+时间戳',
  `deduction_score` int(11) DEFAULT NULL COMMENT '订单抵扣积分',
  `member_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '会员码',
  `member_phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '会员手机号',
  `order_total_price` decimal(10, 2) DEFAULT NULL COMMENT '订单总额',
  `score_deduction_price` decimal(10, 2) DEFAULT NULL COMMENT '积分抵扣金额',
  `score_limit` int(11) DEFAULT NULL COMMENT '积分抵扣规则，多少积分抵一元',
  `before_score` int(11) DEFAULT NULL COMMENT '下单之前积分数量',
  `after_score` int(11) DEFAULT NULL COMMENT '下单之后积分数量',
  `order_gift_score` int(11) DEFAULT NULL COMMENT '下单赠送积分数量',
  PRIMARY KEY (`mmcr_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 143302 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '会员消费记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall2_member_points
-- ----------------------------
DROP TABLE IF EXISTS `mall2_member_points`;
CREATE TABLE `mall2_member_points`  (
  `mmp_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '用户id',
  `points` int(11) DEFAULT NULL COMMENT '积分数',
  `points_expire_date` datetime(0) DEFAULT NULL COMMENT '积分到期时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '+创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '+创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '+修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '+修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '+时间戳',
  PRIMARY KEY (`mmp_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 72426 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '会员积分表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall2_ordering_early_warning_reminds
-- ----------------------------
DROP TABLE IF EXISTS `mall2_ordering_early_warning_reminds`;
CREATE TABLE `mall2_ordering_early_warning_reminds`  (
  `moewr_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `goods_id` mediumint(8) DEFAULT NULL COMMENT '商品id',
  `goods_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品名称',
  `average_sales` decimal(10, 0) DEFAULT NULL COMMENT '平均销量',
  `total_num` int(6) DEFAULT NULL COMMENT '总库存数',
  `alarm_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '预警条件  00 周  10  月',
  `alarm_time` datetime(0) DEFAULT NULL COMMENT '预警时间',
  `is_warning` int(1) DEFAULT NULL COMMENT '是否已经预警',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  `sku` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'sku',
  PRIMARY KEY (`moewr_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '订货提醒预警表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall2_payment_order_data
-- ----------------------------
DROP TABLE IF EXISTS `mall2_payment_order_data`;
CREATE TABLE `mall2_payment_order_data`  (
  `pay_order_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `merchant_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户名称',
  `out_trade_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户订单号',
  `pay_money` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '支付金额(wx订单金额 zfb收入)',
  `refund_money` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '退款金额(wx退款金额  zfb支出)',
  `pay_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '支付类型(wx交易类型 zfb账务类型)',
  `payment_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '付款类型(wx付款银行 zfb支付渠道)',
  `transaction_order` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '交易订单号(wx订单号,zfb交易号)',
  `time_str` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '时间',
  `attach` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商家数据包，原样返回',
  `transaction_status` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '交易状态',
  `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '货币种类',
  `Amount_order` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '应结订单金额',
  `refund_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '微信退款单号',
  `mer_refund_number` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户退款单号',
  `refund_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '退款类型',
  `refund_status` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '退款状态',
  `cash_coupon` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '代金券',
  `refund_rechargp_coupon` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '充值券退款金额',
  `apply_refund_amount` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '申请退款金额',
  `fee_charge` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '手续费',
  `rate` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '费率',
  `pay_flag` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '支付方式：weixin:微信;pingan平安支付;wxglobalpay:微信国际支付;tenpay:QQ财付通;alipay:支付宝;cash:现金',
  `serial_number` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '流水号',
  `opposite_account` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '对方账户',
  `other_name` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '对方名称',
  `bank_order` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '银行订单号',
  `business_basic_order` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '业务基础订单号',
  `business_billing_source` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '业务账单来源',
  `business_order` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '业务订单号',
  `business_description` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '业务描述',
  `remark` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '备注',
  `rate_remark` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '费率备注',
  `payment_notes` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '付款备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`pay_order_id`) USING BTREE,
  INDEX `Index_out_trade_no`(`out_trade_no`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 262087 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '支付订单表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall2_points_rules
-- ----------------------------
DROP TABLE IF EXISTS `mall2_points_rules`;
CREATE TABLE `mall2_points_rules`  (
  `mpr_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `points_type` int(2) DEFAULT NULL COMMENT '积分类型 :0.门店 ,1.商品类别,2.门店商品',
  `points_rules_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '积分生成规则类型ID',
  `ratio` decimal(10, 2) DEFAULT NULL COMMENT '积分规则生成比例',
  `points_begin_time` datetime(0) DEFAULT NULL COMMENT '积分规则适用开始时间',
  `points_end_time` datetime(0) DEFAULT NULL COMMENT '积分规则适用结束时间',
  `is_valid` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '积分规则是否有效: 0有效 1无效',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`mpr_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '积分规则表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall2_points_rules_detil
-- ----------------------------
DROP TABLE IF EXISTS `mall2_points_rules_detil`;
CREATE TABLE `mall2_points_rules_detil`  (
  `id` int(12) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `father_id` int(12) NOT NULL COMMENT '积分生成主表ID',
  `points_rules_type` int(10) DEFAULT NULL COMMENT '积分生成规则类型ID',
  `points_detil_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品/门店/分类名称',
  `points_detil_name_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店ID/商品sku/商品分类ID',
  `points_store_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '当导入商品时，对应的商品门店名称',
  `points_store_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '当导入商品时，对应的商品门店ID',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 196 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '积分规则明细表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall2_reminder_rules_config
-- ----------------------------
DROP TABLE IF EXISTS `mall2_reminder_rules_config`;
CREATE TABLE `mall2_reminder_rules_config`  (
  `mrrc_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '规则配置id',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商户编号',
  `thrid_merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '第三方商户编号',
  `reminder_category` char(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '提醒类别  0.出货提醒 1.订货提醒',
  `reminder_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '提醒类型 00.固定值  10.周期计算（天）',
  `reminder_value` int(11) DEFAULT NULL COMMENT '提醒值',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`mrrc_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '提醒规则配置表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mall2_shipping_reminder_alarm
-- ----------------------------
DROP TABLE IF EXISTS `mall2_shipping_reminder_alarm`;
CREATE TABLE `mall2_shipping_reminder_alarm`  (
  `msra_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `goods_id` mediumint(8) DEFAULT NULL COMMENT '商品id',
  `goods_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品名称',
  `average_sales` decimal(10, 0) DEFAULT NULL COMMENT '平均销量',
  `store_id` mediumint(8) DEFAULT NULL COMMENT '门店id',
  `sku` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店商品sku',
  `store_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店名称',
  `stock_num` int(6) DEFAULT NULL COMMENT '门店库存数',
  `alarm_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '预警条件  00 周  10  月',
  `alarm_time` datetime(0) DEFAULT NULL COMMENT '预警时间',
  `is_warning` int(1) DEFAULT NULL COMMENT '是否已经预警',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`msra_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '出货提醒预警表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for merch_cus_cfg
-- ----------------------------
DROP TABLE IF EXISTS `merch_cus_cfg`;
CREATE TABLE `merch_cus_cfg`  (
  `cus_cfg_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '海关配置编号',
  `merch_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '商户编号,由e码头分配',
  `cus_flag` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '报送海关标识,GUANGZHOU_ZS 广州（总署版），\r\n            GUANGZHOU_HP_GJ 广州黄埔国检（需推送订单至黄埔国检的订单需分别推送广州（总署版）和广州黄埔国检，即需要请求两次报关接口），\r\n            GUANGZHOU_NS_GJ 广州南沙国检（需推送订单至南沙国检的订单需分别推送广州（总署版）和广州南沙国检，即需要请求两次报关接口），\r\n            HANGZHOU_ZS 杭州（总署版），\r\n            NINGBO 宁波，\r\n            ZHENGZHOU_BS 郑州（保税物流中心），\r\n            CHONGQING 重庆，\r\n            XIAN 西安，\r\n            SHANGHAI_ZS 上海（总署版），\r\n            SHENZHEN 深圳，\r\n            ZHENGZHOU_ZH_ZS 郑州综保（总署版），\r\n            TIANJIN 天津，\r\n            BEIJING 北京',
  `is_valid` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `remark` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`cus_cfg_sn`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户海关配置，商户:海关，1:n' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for merch_noti
-- ----------------------------
DROP TABLE IF EXISTS `merch_noti`;
CREATE TABLE `merch_noti`  (
  `noti_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '通知编号',
  `all_pay_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '支付内部编号,全平台,可能是微信内部编号，也可能是阿里内部支付编号',
  `merch_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '00' COMMENT '商户编号,e码头分配',
  `merch_name` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户名称',
  `merch_erp_order_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户erp订单编号',
  `plat_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '平台编号,e码头分配',
  `plat_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '平台中文名',
  `third_party_merch_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户代码',
  `third_party_merch_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户名称',
  `all_merch_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '支付商户号,全平台',
  `all_order_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户订单号,全平台',
  `all_pay_no` varchar(28) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '支付订单号,全平台',
  `all_sub_order_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户子订单号',
  `all_sub_order_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '微信子订单号',
  `pay_chnl_flag` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '支付通道标识,weixin:微信，alipay:蚂蚁金服',
  `buyer_payer_check` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订购人支付人校验，0:未知，1:一致，2:不一致,3:校验异常',
  `noti_count` int(11) DEFAULT NULL COMMENT '通知次数',
  `is_stoped` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否停止通知,0:否,1:是',
  `cus_decl_status` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '海关申报状态，10:等待海关处理，11:海关申报中，12:海关申报成功，13:海关申报中失败',
  `noti_statue` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '通知状态,0:初始，1:通知已发送，2:通知发送成功，3:通知发送失败',
  `code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '消息代码',
  `msg` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '消息',
  `notify_url` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户通知回调接口',
  `remark` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  `order_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订单号',
  PRIMARY KEY (`noti_sn`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户通知，通知编号:支付订单号=1:n' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_activities
-- ----------------------------
DROP TABLE IF EXISTS `mk_activities`;
CREATE TABLE `mk_activities`  (
  `mka_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `mka_topic` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '活动主题',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `third_merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户编号',
  `mka_store_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '活动门店id',
  `mka_status` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否启用，1:启用，0:不启用',
  `mka_start_time` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '开始时间',
  `mkd_end_time` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '结束时间',
  `mka_end_early` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否提前结束',
  `mkd_end_early_time` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '提前结束时间',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `priority` int(11) DEFAULT NULL COMMENT '活动优先级，数字越小优先级越高，最低为0',
  PRIMARY KEY (`mka_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 236 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '营销活动表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_activities_association
-- ----------------------------
DROP TABLE IF EXISTS `mk_activities_association`;
CREATE TABLE `mk_activities_association`  (
  `mkaa_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `mk_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '活动形式代码',
  `mka_id` bigint(20) DEFAULT NULL COMMENT '营销活动编号',
  `merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户编号',
  `third_merch_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户编号',
  `mka_store_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '活动门店id',
  `mka_status` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否启用',
  `mka_start_time` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '开始时间',
  `mkd_end_time` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '结束时间',
  `mka_end_early` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否提前结束',
  `mkd_end_early_time` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '提前结束时间',
  PRIMARY KEY (`mkaa_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 236 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '营销活动-活动关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_activities_combination_price
-- ----------------------------
DROP TABLE IF EXISTS `mk_activities_combination_price`;
CREATE TABLE `mk_activities_combination_price`  (
  `macp_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `goods_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品编码',
  `barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '条形码',
  `combination_num` char(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '组合的产品数量',
  `combined_price` decimal(10, 2) DEFAULT NULL COMMENT '组合价',
  `combination_type` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '组合类别',
  `mka_id` bigint(20) DEFAULT NULL COMMENT '营销活动编号',
  `deadline` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '截止日期',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`macp_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '营销活动-组合价' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_activities_coupon
-- ----------------------------
DROP TABLE IF EXISTS `mk_activities_coupon`;
CREATE TABLE `mk_activities_coupon`  (
  `mac_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `goods_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '适用商品编号',
  `barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '适用商品条码',
  `shop_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店编号',
  `coupon_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '优惠券码',
  `coupon_price` decimal(10, 2) DEFAULT NULL COMMENT '优惠金额',
  `mka_id` bigint(20) DEFAULT NULL COMMENT '营销活动编号',
  `deadline` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '截止日期',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `activity_type` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '优惠券类型，0:按品牌 1:按商品分类 2：按商品',
  `brand_id` int(12) DEFAULT NULL COMMENT '品牌id',
  `category_id` int(12) DEFAULT NULL COMMENT '分类id',
  `brand_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '品牌名称',
  `category_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '分类名称',
  PRIMARY KEY (`mac_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '营销活动-优惠券' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_activities_discount
-- ----------------------------
DROP TABLE IF EXISTS `mk_activities_discount`;
CREATE TABLE `mk_activities_discount`  (
  `mad_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `product_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '产品中文名',
  `activity_price` decimal(10, 2) DEFAULT NULL COMMENT '活动价格',
  `shop_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店编号',
  `goods_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品编码',
  `barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '条形码',
  `product_brand` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品品牌',
  `product_series` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品系列',
  `discount` decimal(10, 2) DEFAULT NULL COMMENT '折扣',
  `mka_id` bigint(20) DEFAULT NULL COMMENT '营销活动编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`mad_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '营销活动-全场打折' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_activities_full_gift
-- ----------------------------
DROP TABLE IF EXISTS `mk_activities_full_gift`;
CREATE TABLE `mk_activities_full_gift`  (
  `mafr_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `product_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '产品中文名',
  `shop_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店编号',
  `goods_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品编码',
  `barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '条形码',
  `product_brand` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品品牌',
  `product_series` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品系列',
  `qualified_amount` decimal(10, 2) DEFAULT NULL COMMENT '满足条件金额',
  `gift_barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '赠品条码',
  `mka_id` bigint(20) DEFAULT NULL COMMENT '营销活动编号',
  `deadline` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '截止日期',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `gift_goods_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '赠品商品编号',
  `full_gift_type` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '满赠类型，0:按品牌 1:按商品分类',
  `brand_id` int(11) DEFAULT NULL COMMENT '品牌id',
  `category_id` int(11) DEFAULT NULL COMMENT '分类id',
  `category_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '分类名',
  `shop_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店名称',
  `gift_number` int(8) DEFAULT NULL COMMENT '赠品数量',
  PRIMARY KEY (`mafr_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '营销活动-满赠' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_activities_full_reduction
-- ----------------------------
DROP TABLE IF EXISTS `mk_activities_full_reduction`;
CREATE TABLE `mk_activities_full_reduction`  (
  `mafr_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `product_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '产品中文名',
  `shop_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店编号',
  `goods_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品编码',
  `barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '条形码',
  `product_brand` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品品牌',
  `product_series` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品系列',
  `gift_barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '赠品条码',
  `qualified_amount` decimal(10, 2) DEFAULT NULL COMMENT '满足条件金额',
  `deduction_amount` decimal(10, 2) DEFAULT NULL COMMENT '减扣金额',
  `mka_id` bigint(20) DEFAULT NULL COMMENT '营销活动编号',
  `deadline` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '截止日期',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `gift_goods_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '赠品商品编号',
  `full_gift_type` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '满赠类型，0:按品牌 1:按商品分类',
  `brand_id` int(11) DEFAULT NULL COMMENT '品牌id',
  `category_id` int(11) DEFAULT NULL COMMENT '分类id',
  `category_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '分类名称',
  `shop_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店名称',
  PRIMARY KEY (`mafr_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 55 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '商品编码为主要匹配/上传依据，商品条形码为辅助查看而已活动方式满减，满xxx元立减xx元（x' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_activities_get_one_free_goods
-- ----------------------------
DROP TABLE IF EXISTS `mk_activities_get_one_free_goods`;
CREATE TABLE `mk_activities_get_one_free_goods`  (
  `mka_free_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `product_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '产品中文名',
  `edlp` decimal(10, 2) DEFAULT NULL COMMENT '每日最低价',
  `suggested_retail_price` decimal(10, 2) DEFAULT NULL COMMENT '建议零售价',
  `activity_price` decimal(10, 2) DEFAULT NULL COMMENT '活动价格',
  `shop_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店编号',
  `goods_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品编码',
  `buy_num` decimal(10, 0) DEFAULT NULL COMMENT '购买的数量',
  `barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '条形码',
  `product_brand` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品品牌',
  `product_series` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品系列',
  `send_num` decimal(10, 0) DEFAULT NULL COMMENT '赠送的数量',
  `gift_barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '赠品条码',
  `mka_id` bigint(20) DEFAULT NULL COMMENT '营销活动编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`mka_free_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '营销活动--买一送\r\n说明：购买商品条码，购买商品品牌，购买商品系列三列不可以同是为空' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_activities_promotion
-- ----------------------------
DROP TABLE IF EXISTS `mk_activities_promotion`;
CREATE TABLE `mk_activities_promotion`  (
  `map_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `product_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '产品中文名',
  `activity_price` decimal(10, 2) DEFAULT NULL COMMENT '活动价格',
  `shop_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店编号',
  `sku` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品sku',
  `barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '条形码',
  `product_brand` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品品牌',
  `product_series` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品系列',
  `mka_id` bigint(20) DEFAULT NULL COMMENT '营销活动编号',
  `reject_score` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '是否与积分抵扣互斥，0:不互斥 1:互斥',
  `deadline` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '截止日期',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`map_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 18964 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '营销活动-临时促销' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_activities_score
-- ----------------------------
DROP TABLE IF EXISTS `mk_activities_score`;
CREATE TABLE `mk_activities_score`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `prod_barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品条码',
  `sku` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'sku',
  `store_id` int(11) DEFAULT NULL COMMENT '门店id',
  `score_limit` decimal(10, 2) DEFAULT NULL COMMENT '积分最大抵扣比例，如：设为0.3，则积分最多抵扣当前订单价的30%',
  `mka_id` bigint(20) DEFAULT NULL COMMENT '营销活动编号',
  `deadline` datetime(0) DEFAULT NULL COMMENT '截止日期',
  `reject` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '\n0：参与\n 1：不参与，如导入的商品为参与积分抵扣，则默认其余商品为不参与积分抵扣，\n如导入的商品为不参与积分抵扣，则默认其余商品为参与积分抵扣\r',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 79 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '营销方式-积分抵扣' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_activities_the_second_half_price
-- ----------------------------
DROP TABLE IF EXISTS `mk_activities_the_second_half_price`;
CREATE TABLE `mk_activities_the_second_half_price`  (
  `mafr_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `product_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '产品中文名',
  `shop_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店编号',
  `goods_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品编码',
  `barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '条形码',
  `product_brand` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品品牌',
  `product_series` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品系列',
  `qualified_amount` decimal(10, 2) DEFAULT NULL COMMENT '满足条件金额',
  `deduction_amount` decimal(10, 2) DEFAULT NULL COMMENT '减扣金额',
  `mka_id` bigint(20) DEFAULT NULL COMMENT '营销活动编号',
  `deadline` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '截止日期',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`mafr_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '商品编码为主要匹配/上传依据，商品条形码为辅助查看而已活动方式满减，满xxx元立减xx元（x' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_activity_form
-- ----------------------------
DROP TABLE IF EXISTS `mk_activity_form`;
CREATE TABLE `mk_activity_form`  (
  `mm_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `mk_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '活动形式名称',
  `mk_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '活动形式代码',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  PRIMARY KEY (`mm_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 37 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '活动形式表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_center_menu
-- ----------------------------
DROP TABLE IF EXISTS `mk_center_menu`;
CREATE TABLE `mk_center_menu`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `menu_name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '菜单名称',
  `menu_detail` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '菜单描述',
  `pic_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '菜单图片链接',
  `menu_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '菜单跳转url',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '营销中心菜单表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_center_menu_store_real
-- ----------------------------
DROP TABLE IF EXISTS `mk_center_menu_store_real`;
CREATE TABLE `mk_center_menu_store_real`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `center_menu_id` int(11) DEFAULT NULL COMMENT '营销菜单id',
  `store_id` int(11) DEFAULT NULL COMMENT '门店id',
  `third_merch_sn` int(11) DEFAULT NULL COMMENT '第三方商户id',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 104 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '营销中心菜单门店关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_coupon
-- ----------------------------
DROP TABLE IF EXISTS `mk_coupon`;
CREATE TABLE `mk_coupon`  (
  `id` int(11) NOT NULL,
  `coupon_category` int(20) DEFAULT NULL COMMENT '优惠券分类，枚举：0.订单满减；1.订单免运费；2.订单折扣；3.商品满减；4.商品折扣',
  `name` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '优惠券名称',
  `discount_fee` int(20) DEFAULT NULL COMMENT '优惠金额，单位：分。如果是折扣券，范围需在1~99内',
  `coupon_type` int(11) DEFAULT NULL COMMENT '优惠券有效期类型 0.领取时间以后多少天有效 1.固定时间段',
  `rules` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '优惠券使用规则',
  `begin_time` datetime(0) DEFAULT NULL COMMENT '有效开始时间，固定时间段的优惠券（coupon_type=1必传）',
  `end_time` datetime(0) DEFAULT NULL COMMENT '有效结束时间，固定时间段的优惠券（coupon_type=1必传）',
  `fixed_term` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '领取后多少天内有效的优惠券（coupon_type=0必传）',
  `quantity` int(20) DEFAULT NULL COMMENT '发放量：0 无限制(券库存)',
  `minimum_fee` int(20) DEFAULT NULL COMMENT '消费门槛，单位：分',
  `claim_number` int(20) DEFAULT NULL COMMENT '每人可领取次数，为0时不限制',
  `coupon_centre_status` int(20) DEFAULT NULL COMMENT '优惠券发送渠道，枚举:1.领券中心',
  `member_restrict_type` int(20) DEFAULT NULL COMMENT '领取条件，枚举：0.限定新用户；1.限定会员等级;2.全部（ 默认值 ）',
  `receive_method` int(20) DEFAULT NULL COMMENT '领取方式，枚举：0-免费、1积分兑换',
  `use_scope_type` int(20) DEFAULT NULL COMMENT '核销优惠劵使用范围，枚举：1.限定发放的业态',
  `suit_store_type` int(20) DEFAULT NULL COMMENT '可用门店/商家，枚举：0-适用于所有门店/商家 1-部分门店/商家',
  `suit_item_type` int(20) DEFAULT NULL COMMENT '可用商品，枚举：0-适用于所有商品 1-部分商品 2-部分类目',
  `stores` int(20) DEFAULT NULL COMMENT '门店id',
  `items` int(20) DEFAULT NULL COMMENT '可用商品明细id',
  `categories` int(20) DEFAULT NULL COMMENT '商品分类id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_coupon_goods_item
-- ----------------------------
DROP TABLE IF EXISTS `mk_coupon_goods_item`;
CREATE TABLE `mk_coupon_goods_item`  (
  `id` int(20) NOT NULL COMMENT '主键id',
  `sku` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '料件号',
  `name` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品名称',
  `coupon_id` int(20) DEFAULT NULL COMMENT '优惠券id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_daily_activities
-- ----------------------------
DROP TABLE IF EXISTS `mk_daily_activities`;
CREATE TABLE `mk_daily_activities`  (
  `mda_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `product_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '产品中文名',
  `daily_price` decimal(10, 2) DEFAULT NULL COMMENT '日常价',
  `activity_price` decimal(10, 2) DEFAULT NULL COMMENT '活动价格',
  `shop_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '门店编号',
  `goods_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品编码',
  `barcode` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '条形码',
  `product_brand` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品品牌',
  `product_series` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '商品系列',
  `mka_id` bigint(20) DEFAULT NULL COMMENT '营销活动编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `deadline` datetime(0) DEFAULT NULL COMMENT '截止日期',
  PRIMARY KEY (`mda_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 163439 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '营销活动-日常活动' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_dist
-- ----------------------------
DROP TABLE IF EXISTS `mk_dist`;
CREATE TABLE `mk_dist`  (
  `dist_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '分销商id',
  `dist_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '分销商名称',
  `dist_ename` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '分销商英文名',
  `dist_flag` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '分销商标识',
  `third_merch_sn` int(11) DEFAULT NULL COMMENT '所属三方商户',
  `store_id` int(11) DEFAULT NULL COMMENT '门店id',
  `supplier_id` int(11) DEFAULT NULL COMMENT '所属供应商',
  `sort_order` smallint(5) UNSIGNED DEFAULT 0 COMMENT '排序',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`dist_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '分销商，distributor' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_dist_chnl
-- ----------------------------
DROP TABLE IF EXISTS `mk_dist_chnl`;
CREATE TABLE `mk_dist_chnl`  (
  `dist_chnl_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '分销渠道id',
  `dist_flag` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '分销渠道名称',
  `part_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '所属分类，【part_type，00:三方商户，10:供应商，20::三方商户及供货商】',
  `third_merch_sn` int(11) DEFAULT NULL COMMENT '所属三方商户',
  `supplier_id` int(11) DEFAULT NULL COMMENT '所属供应商',
  `sort_order` smallint(5) UNSIGNED DEFAULT 0 COMMENT '排序',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`dist_chnl_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '分销渠道' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_dist_hier
-- ----------------------------
DROP TABLE IF EXISTS `mk_dist_hier`;
CREATE TABLE `mk_dist_hier`  (
  `dist_hier_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '分销层级id',
  `dist_chnl_id` int(11) DEFAULT NULL COMMENT '分销渠道id',
  `pdist_id` int(11) DEFAULT NULL COMMENT '上级分销商id',
  `dist_id` int(11) DEFAULT NULL COMMENT '分销商id',
  `dist_hier_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '分销层级名称',
  `dist_hier_nname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '分销层级昵称',
  `hier_lvl` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '层级级别，最大支持99级，【hier_lvl，01:01，02:02，......，99:99】',
  `supplier_id` int(11) DEFAULT NULL COMMENT '所属供应商',
  `sort_order` smallint(5) UNSIGNED DEFAULT 0 COMMENT '排序',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`dist_hier_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '分销层级，树状层级，每个子级只有唯一一个父级，一个父级可以多个子级' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_dist_sell_allocation
-- ----------------------------
DROP TABLE IF EXISTS `mk_dist_sell_allocation`;
CREATE TABLE `mk_dist_sell_allocation`  (
  `sell_alloc_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '销售分配id',
  `dist_chnl_id` int(11) DEFAULT NULL COMMENT '分销渠道id',
  `dist_flag` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '分销渠道名称',
  `third_merch_sn` int(11) DEFAULT NULL COMMENT '所属三方商户',
  `supplier_id` int(11) DEFAULT NULL COMMENT '所属供应商',
  `dist_id` smallint(5) UNSIGNED DEFAULT 0 COMMENT '商品所属分销商id',
  `store_id` int(11) DEFAULT NULL COMMENT '门店id',
  `goods_id` int(11) DEFAULT NULL COMMENT '商品id',
  `alloc_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '分配方式，【alloc_type，00:比例，10:金额】',
  `expend_dist_ids` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '支出分销商id，格式为【一级经销商id，二级经销商id，三级经销商id...】，a,b,c...,n,m',
  `expend_dist_lines` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '支出分销商金额【比例/金额】，格式为【一级提成额度，二级提成额度，三级提成额度...】，3,2,1...,n,m',
  `sell_alloc_history_id` int(11) DEFAULT NULL COMMENT '历史id',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`sell_alloc_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '渠道销售分配，分销商针对某个商品sku的销售分配' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_dist_sell_allocation_history
-- ----------------------------
DROP TABLE IF EXISTS `mk_dist_sell_allocation_history`;
CREATE TABLE `mk_dist_sell_allocation_history`  (
  `sell_alloc_history_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '销售分配历史记录id',
  `dist_chnl_id` int(11) DEFAULT NULL COMMENT '分销渠道id',
  `dist_flag` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '分销渠道名称',
  `third_merch_sn` int(11) DEFAULT NULL COMMENT '所属三方商户',
  `supplier_id` int(11) DEFAULT NULL COMMENT '所属供应商',
  `dist_id` smallint(5) UNSIGNED DEFAULT 0 COMMENT '商品所属分销商id',
  `store_id` int(11) DEFAULT NULL COMMENT '门店id',
  `goods_id` int(11) DEFAULT NULL COMMENT '商品id',
  `alloc_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '分配方式，【alloc_type，00:比例，10:金额】',
  `expend_dist_ids` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '支出分销商id，格式为【一级经销商id，二级经销商id，三级经销商id...】，a,b,c...,n,m',
  `expend_dist_lines` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '支出分销商金额【比例/金额】，格式为【一级提成额度，二级提成额度，三级提成额度...】，3,2,1...,n,m',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`sell_alloc_history_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '渠道销售分配，分销商针对某个商品sku的销售分配' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_dist_sell_statis
-- ----------------------------
DROP TABLE IF EXISTS `mk_dist_sell_statis`;
CREATE TABLE `mk_dist_sell_statis`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `dist_chnl_id` int(11) DEFAULT NULL COMMENT '分销渠道id',
  `dist_flag` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '分销渠道名称',
  `third_merch_sn` int(11) DEFAULT NULL COMMENT '所属三方商户',
  `supplier_id` int(11) DEFAULT NULL COMMENT '所属供应商',
  `dist_id` smallint(5) UNSIGNED DEFAULT 0 COMMENT '商品所属分销商id',
  `user_id` int(11) DEFAULT NULL COMMENT '用户编号',
  `order_goods_id` int(11) DEFAULT NULL COMMENT '订单详情编号',
  `order_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单编号',
  `store_id` int(11) DEFAULT NULL COMMENT '门店id',
  `goods_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商品id',
  `goods_price` decimal(10, 2) DEFAULT NULL COMMENT '商品价格',
  `sell_alloc_history_id` int(11) DEFAULT NULL COMMENT '渠道销售分配历史id',
  `expend_dist_id` int(11) DEFAULT NULL COMMENT '支出分销商id',
  `expend_dist_price` decimal(10, 5) DEFAULT NULL COMMENT '支出分销商金额【比例/金额】，公式：商品价格*设置比例/金额',
  `expend_dist_level` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '支出分销商等级 1 一级，2 二级，3 三级',
  `expend_source` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '来源',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '购买商品生成销售分配记录统计，渠道销售统计' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_store_camp_minus
-- ----------------------------
DROP TABLE IF EXISTS `mk_store_camp_minus`;
CREATE TABLE `mk_store_camp_minus`  (
  `camp_minus_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '满减活动id',
  `camp_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '活动名称',
  `third_merch_sn` int(11) DEFAULT NULL COMMENT '第三方商户id',
  `store_id` mediumint(8) DEFAULT NULL COMMENT '门店id',
  `store_topic_id` int(11) DEFAULT NULL COMMENT '活动id',
  `camp_beg_time` datetime(0) DEFAULT NULL COMMENT '活动起始时间，yyyy-MM-dd HH:mi',
  `camp_end_time` datetime(0) DEFAULT NULL COMMENT '活动结束时间，yyyy-MM-dd HH:mi',
  `camp_minus_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '减免活动类型， 00:满x元减，01:满x件减，10:满x元折，11:满x件折，减免活动类型为00，01时，减免方式必选',
  `minus_mode` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '减免方式【minus_mode，00:满足最高层级减一次，10:每满一次减一次】，1、减免方式选择10时，满件、满元每人最多项必填；2、减免方式为00，如设置每满100（2件）减10元，满200（4件）减20元....等； 按最高层级优惠满减，仅减一次。',
  `apply_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '适用类型，【apply_type，00:全部商品参与，01:指定商品参与，02:指定商品不参与】',
  `adv_img_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '活动图片url',
  `adv_desc` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '活动说明',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `is_past` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否过期，0：进行中，1：已结束，2：未开始',
  `is_store_show` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否展示在小程序门店首页广告栏，0：否，1：是',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  `goods_biz_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '货品业务类型， 00:保税备货， 02:保税展示补货，10:保税展示跨境，11:普通商品',
  PRIMARY KEY (`camp_minus_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店满减活动' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_store_camp_minus_goods
-- ----------------------------
DROP TABLE IF EXISTS `mk_store_camp_minus_goods`;
CREATE TABLE `mk_store_camp_minus_goods`  (
  `minus_good_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '满减活动商品id',
  `camp_minus_id` int(11) DEFAULT NULL COMMENT '满减活动id',
  `apply_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '适用类型，【apply_type，00:全部商品参与，01:指定商品参与，02:指定商品不参与】',
  `store_rela_id` mediumint(8) UNSIGNED DEFAULT NULL COMMENT '门店商品id，当满减适用类型为00时，门店商品id可以为空，否则必填',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`minus_good_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店满减活动商品，参与满减活动的商品' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_store_camp_minus_level
-- ----------------------------
DROP TABLE IF EXISTS `mk_store_camp_minus_level`;
CREATE TABLE `mk_store_camp_minus_level`  (
  `camp_minus_level_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '满减活动层级id',
  `camp_minus_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '减免活动类型， 00:满x元减，01:满x件减，10:满x元折，11:满x件折，减免活动类型为00，01时，减免方式必选',
  `camp_minus_id` int(11) DEFAULT NULL COMMENT '满减活动id',
  `minus_mode` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '减免方式【minus_mode，00:满足最高层级减一次，10:每满一次减一次】，1、减免方式选择10时，满件、满元每人最多项必填；2、减免方式为00，如设置每满100（2件）减10元，满200（4件）减20元....等； 按最高层级优惠满减，仅减一次。',
  `yuan_minus_cond` decimal(10, 2) DEFAULT NULL COMMENT '满元减条件(元)',
  `yuan_minus_pref` decimal(10, 2) DEFAULT NULL COMMENT '满元减优惠(元)',
  `piece_minus_conf` tinyint(4) DEFAULT NULL COMMENT '满件减条件(件)',
  `piece_minus_pref` decimal(10, 2) DEFAULT NULL COMMENT '满件减优惠(元)',
  `piece_minus_each_disc` decimal(10, 2) DEFAULT NULL COMMENT '满减件每人优惠(元)，填0代表不设置上限，减免活动类型为10，且减免方式选择10时，满件每人最多项必填。',
  `yuan_disc_cond` decimal(10, 2) DEFAULT NULL COMMENT '满元折条件(元)，大于等于0的2位小数',
  `yuan_disc_pref` decimal(2, 1) DEFAULT NULL COMMENT '满元折优惠(折)，大于0且小于10的1位小数。',
  `piece_disc_conf` tinyint(4) DEFAULT NULL COMMENT '满件折条件(件)，大于等于0的整数',
  `piece_disc_pref` decimal(10, 2) DEFAULT NULL COMMENT '满件折优惠(折)，大于0且小于10的数，可带1位小数。',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`camp_minus_level_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店满减活动层级表，活动减免类型为00：按满足最高层级减一次时增加的活动层级数据' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_store_prom
-- ----------------------------
DROP TABLE IF EXISTS `mk_store_prom`;
CREATE TABLE `mk_store_prom`  (
  `prom_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '推广ID',
  `prom_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '推广名称',
  `third_merch_sn` int(11) DEFAULT NULL COMMENT '第三方商户编号',
  `store_id` mediumint(8) DEFAULT NULL COMMENT '门店id',
  `prom_beg_time` datetime(0) DEFAULT NULL COMMENT '推广起始时间，yyyy-MM-dd HH:mi',
  `prom_end_time` datetime(0) DEFAULT NULL COMMENT '推广结束时间，yyyy-MM-dd HH:mi',
  `prom_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '推广分类，【prom_type，00:活动，10:商品】',
  `prom_type_id` int(11) DEFAULT NULL COMMENT '活动分类',
  `store_topic_id` int(11) DEFAULT NULL COMMENT '活动ID，不同活动对应的ID',
  `goods_id` int(11) DEFAULT NULL COMMENT '商品id',
  `prom_url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '推广url',
  `prom_chnl_id` int(11) NOT NULL COMMENT '推广渠道ID',
  `is_put` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否投放,0:是，1:否',
  `is_finished` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否结束,0：已结束，1：进行中，2：未开始',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`prom_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店推广' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_store_prom_chnl
-- ----------------------------
DROP TABLE IF EXISTS `mk_store_prom_chnl`;
CREATE TABLE `mk_store_prom_chnl`  (
  `prom_chnl_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '推广渠道ID',
  `prom_chn_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '推广渠道名称',
  `store_id` mediumint(8) DEFAULT NULL COMMENT '门店id',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`prom_chnl_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店推广渠道' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_store_prom_order_real
-- ----------------------------
DROP TABLE IF EXISTS `mk_store_prom_order_real`;
CREATE TABLE `mk_store_prom_order_real`  (
  `prom_order_real_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '推广订单关联id',
  `prom_id` int(11) DEFAULT NULL COMMENT '推广id',
  `cart_id` int(11) DEFAULT NULL COMMENT '购物车id',
  `order_id` int(11) DEFAULT NULL COMMENT '订单id',
  `order_goods_id` int(11) DEFAULT NULL COMMENT '订单明细id',
  `user_id` int(11) DEFAULT NULL COMMENT '购买用户id',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  `is_prom_stat_scan` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订单详情是否被渠道追踪统计扫描 0：否 1：是',
  PRIMARY KEY (`prom_order_real_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店推广订单关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_store_prom_stat
-- ----------------------------
DROP TABLE IF EXISTS `mk_store_prom_stat`;
CREATE TABLE `mk_store_prom_stat`  (
  `prom_stat_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '推广统计ID',
  `prom_id` int(11) NOT NULL COMMENT '推广ID',
  `store_id` mediumint(8) DEFAULT NULL COMMENT '门店id',
  `referrer` int(11) DEFAULT NULL COMMENT '分享用户id',
  `browse_num` mediumint(9) DEFAULT NULL COMMENT '浏览数',
  `visit_num` mediumint(9) DEFAULT NULL COMMENT '访客量',
  `rela_browse_num` mediumint(9) DEFAULT NULL COMMENT '连带浏览量',
  `rela_visitor_num` mediumint(9) DEFAULT NULL COMMENT '连带访客量',
  `ave_stop_time` mediumint(9) DEFAULT NULL COMMENT '人均停留时长(秒)',
  `ave_visitor_num` mediumint(9) DEFAULT NULL COMMENT '人均访问次数',
  `visit_page_deep` mediumint(9) DEFAULT NULL COMMENT '页面访问深度',
  `trans_visitor_num` mediumint(9) DEFAULT NULL COMMENT '转发访客量',
  `trans_num` mediumint(9) DEFAULT NULL COMMENT '转发次数',
  `submit_order_num` mediumint(9) DEFAULT NULL COMMENT '下单单数',
  `submit_num` mediumint(9) DEFAULT NULL COMMENT '下单人数',
  `pay_order_num` mediumint(9) DEFAULT NULL COMMENT '支付单数',
  `rela_pay_order_num` mediumint(9) DEFAULT NULL COMMENT '连带支付单数',
  `payer_num` mediumint(9) DEFAULT NULL COMMENT '支付人数',
  `rela_payer_num` mediumint(9) DEFAULT NULL COMMENT '连带支付人数',
  `pay_case_num` mediumint(9) DEFAULT NULL COMMENT '支付件数',
  `rela_pay_case_num` mediumint(9) DEFAULT NULL COMMENT '连带支付件数',
  `receiv_money` decimal(18, 2) DEFAULT NULL COMMENT '应收金额',
  `rela_receiv_money` decimal(18, 2) DEFAULT NULL COMMENT '连带应收金额',
  `act_money` decimal(18, 2) DEFAULT NULL COMMENT '实收金额',
  `rela_act_money` decimal(18, 2) DEFAULT NULL COMMENT '连带实收金额',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`prom_stat_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店推广统计' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_store_prom_type
-- ----------------------------
DROP TABLE IF EXISTS `mk_store_prom_type`;
CREATE TABLE `mk_store_prom_type`  (
  `prom_type_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '活动分类编号',
  `title` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '活动类别主题',
  `prom_type_name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '活动类别名称',
  `pic_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '活动类别图片链接',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`prom_type_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店活动分类表，store promotion' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_store_prom_visitors
-- ----------------------------
DROP TABLE IF EXISTS `mk_store_prom_visitors`;
CREATE TABLE `mk_store_prom_visitors`  (
  `prom_visitors_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '推广访客id',
  `prom_id` int(11) DEFAULT NULL COMMENT '推广id',
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`prom_visitors_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店推广渠道' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_store_ticket_discount
-- ----------------------------
DROP TABLE IF EXISTS `mk_store_ticket_discount`;
CREATE TABLE `mk_store_ticket_discount`  (
  `tick_disc_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '优惠券id',
  `tick_disc_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '优惠类型，【tick_disc_type，00:代金券，01:折扣券，02:兑换券】',
  `tick_disc_sub_title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '优惠券副标题',
  `merch_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户编号',
  `third_merch_sn` int(11) DEFAULT NULL COMMENT '第三方商户id',
  `store_id` mediumint(8) DEFAULT NULL COMMENT '门店id',
  `store_topic_id` int(11) DEFAULT NULL COMMENT '活动id',
  `goods_biz_type` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '货品业务类型， 00:保税备货， 02:保税展示补货，10:保税展示跨境，11:普通商品',
  `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '优惠券标题',
  `voucher_money` decimal(10, 0) DEFAULT NULL COMMENT '代金券减免金额(元)',
  `voucher_cond` decimal(10, 0) DEFAULT NULL COMMENT '代金券使用条件(元)，消费金额满多少使用',
  `disc_ratio` decimal(2, 1) DEFAULT NULL COMMENT '折扣券折扣(折)，1-9.9之间的数字，精确到小数点后1位',
  `disc_cond` decimal(10, 0) DEFAULT NULL COMMENT '折扣券使用条件(元)，消费金额满多少使用',
  `disc_sell_count` int(11) DEFAULT NULL COMMENT '折扣最多优惠（件）',
  `disc_sell_doller` decimal(10, 0) DEFAULT NULL COMMENT '折扣最多优惠（元）',
  `exch_cond` decimal(10, 0) DEFAULT NULL COMMENT '兑换券使用条件(元)，消费金额满多少使用\r\n            ',
  `effect_time_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '生效时间类型，【effect_time_type，00:固定时间，01:领取后生效】',
  `fix_beg_time` datetime(0) DEFAULT NULL COMMENT '固定开始时间，yyyy-MM-dd',
  `fix_end_time` datetime(0) DEFAULT NULL COMMENT '固定结束时间，yyyy-MM-dd',
  `postpone_num` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '领券延期生效天数(天)',
  `valid_day_num` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '领券使用有效天数(天)',
  `ticket_num` smallint(6) DEFAULT NULL COMMENT '库存',
  `apply_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '适用类型，【apply_type，00:全部商品参与，01:指定商品参与，02:指定商品不参与】',
  `get_enter` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '领取入口，格式：1,2,...,n，【get_enter，1:商品详情页/购物车等商城页面】',
  `can_share_get` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '能否分享领取，【can_share_get，0:能，1:否】',
  `limit_num` int(11) DEFAULT 1 COMMENT '每人限领数(张)，每个用户领券上限，如不填则默认为1',
  `adv_img_url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '活动图片url(小图)',
  `store_logo_url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '门店logo图url',
  `store_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '门店名称，默认填写商户门店名称',
  `ticket_color` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '券面颜色，如:#ababab',
  `opt_decl` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '操作说明',
  `disc_decl` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '优惠说明',
  `use_noti` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '使用须知',
  `svr_tel` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '客服电话，手机或固话',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `is_past` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否过期，0：否，1：是',
  `is_store_show` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否展示在小程序门店首页广告栏，0：否，1：是',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  `send_type` tinyint(3) UNSIGNED DEFAULT 0 COMMENT '发放方式 0：按订单发放 1：按用户发放(通用优惠券，用户点击领取) 2:商品转发送券 3：按商品发放 4:新用户注册 5：线下发放 6评价好评红包（固定或随机红包） 7包邮（不入会员优惠券表）',
  `guid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '唯一id',
  PRIMARY KEY (`tick_disc_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店优惠券活动' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_store_ticket_discount_goods
-- ----------------------------
DROP TABLE IF EXISTS `mk_store_ticket_discount_goods`;
CREATE TABLE `mk_store_ticket_discount_goods`  (
  `disc_good_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '优惠券商品id',
  `tick_disc_id` int(11) DEFAULT NULL COMMENT '优惠券id',
  `apply_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '适用类型，【apply_type，00:全部商品参与，01:指定商品参与，02:指定商品不参与】',
  `store_rela_id` int(11) DEFAULT NULL COMMENT '门店商品id',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`disc_good_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店优惠券活动商品，参与优惠的商品' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_store_topic_goods_temp
-- ----------------------------
DROP TABLE IF EXISTS `mk_store_topic_goods_temp`;
CREATE TABLE `mk_store_topic_goods_temp`  (
  `disc_good_temp_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '优惠券商品id',
  `guid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '唯一id',
  `apply_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '适用类型，【apply_type，00:全部商品参与，01:指定商品参与，02:指定商品不参与】',
  `store_rela_id` int(11) DEFAULT NULL COMMENT '门店商品id',
  `is_submit` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '弹框按钮，0确认，1：取消',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '弹框按钮触发时商品是否有效, 0:有效，1:无效',
  `is_button_cannel` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '页面触发取消按钮时商品是否有效，0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  `store_topic_id` int(11) UNSIGNED DEFAULT 0 COMMENT '门店活动id（当商品为优惠券商品时，id可为空）',
  PRIMARY KEY (`disc_good_temp_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店优惠券活动商品，参与优惠的商品临时表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_store_topic_stat
-- ----------------------------
DROP TABLE IF EXISTS `mk_store_topic_stat`;
CREATE TABLE `mk_store_topic_stat`  (
  `store_topic_stat_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '活动统计ID',
  `store_topic_id` int(11) NOT NULL COMMENT '活动id',
  `store_id` mediumint(8) DEFAULT NULL COMMENT '门店id',
  `browse_num` mediumint(9) DEFAULT NULL COMMENT '浏览数',
  `visit_num` mediumint(9) DEFAULT NULL COMMENT '访客量',
  `receive_num` mediumint(9) DEFAULT NULL COMMENT '领取量',
  `rela_browse_num` mediumint(9) DEFAULT NULL COMMENT '连带浏览量',
  `rela_visitor_num` mediumint(9) DEFAULT NULL COMMENT '连带访客量',
  `visit_page_deep` mediumint(9) DEFAULT NULL COMMENT '页面访问深度',
  `trans_visitor_num` mediumint(9) DEFAULT NULL COMMENT '转发访客量',
  `submit_order_num` mediumint(9) DEFAULT NULL COMMENT '下单单数',
  `submit_num` mediumint(9) DEFAULT NULL COMMENT '下单人数',
  `pay_order_num` mediumint(9) DEFAULT NULL COMMENT '支付单数',
  `rela_pay_order_num` mediumint(9) DEFAULT NULL COMMENT '连带支付单数',
  `payer_num` mediumint(9) DEFAULT NULL COMMENT '支付人数',
  `rela_payer_num` mediumint(9) DEFAULT NULL COMMENT '连带支付人数',
  `pay_case_num` mediumint(9) DEFAULT NULL COMMENT '支付件数',
  `rela_pay_case_num` mediumint(9) DEFAULT NULL COMMENT '连带支付件数',
  `receiv_money` decimal(18, 2) DEFAULT NULL COMMENT '应收金额',
  `rela_receiv_money` decimal(18, 2) DEFAULT NULL COMMENT '连带应收金额',
  `act_money` decimal(18, 2) DEFAULT NULL COMMENT '实收金额',
  `rela_act_money` decimal(18, 2) DEFAULT NULL COMMENT '连带实收金额',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`store_topic_stat_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店活动统计' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk_store_topic_visitors
-- ----------------------------
DROP TABLE IF EXISTS `mk_store_topic_visitors`;
CREATE TABLE `mk_store_topic_visitors`  (
  `topic_visitors_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '门店活动访客id',
  `store_topic_id` int(11) DEFAULT NULL COMMENT '活动id',
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `is_valid` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `note` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`topic_visitors_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店活动访客记录' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk2_goods_topic_history_price
-- ----------------------------
DROP TABLE IF EXISTS `mk2_goods_topic_history_price`;
CREATE TABLE `mk2_goods_topic_history_price`  (
  `mgthp_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `topic_id` int(11) DEFAULT NULL COMMENT '活动id',
  `topic_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '活动类别',
  `topic_price` decimal(10, 0) DEFAULT NULL COMMENT '活动价格',
  `topic_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '活动名称',
  `topic_content` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '活动内容',
  `topic_goods_sku` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '活动产品',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  `topic_begin_time` datetime(0) DEFAULT NULL COMMENT '活动开始时间',
  `topic_end_time` datetime(0) DEFAULT NULL COMMENT '活动结束时间',
  PRIMARY KEY (`mgthp_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 160 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '商品活动历史价格表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk2_goods_topic_price
-- ----------------------------
DROP TABLE IF EXISTS `mk2_goods_topic_price`;
CREATE TABLE `mk2_goods_topic_price`  (
  `mgthp_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `topic_id` int(11) DEFAULT NULL COMMENT '活动id',
  `topic_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '活动类别',
  `topic_price` decimal(10, 0) DEFAULT NULL COMMENT '活动价格',
  `topic_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '活动名称',
  `topic_content` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '活动内容',
  `topic_goods_sku` varchar(22) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '活动产品',
  `topic_begin_time` datetime(0) DEFAULT NULL COMMENT '活动开始时间',
  `topic_end_time` datetime(0) DEFAULT NULL COMMENT '活动结束时间',
  `import_time` datetime(0) DEFAULT NULL COMMENT '导入时间',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`mgthp_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 168 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '商品活动价格表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for mk2_member_birthday
-- ----------------------------
DROP TABLE IF EXISTS `mk2_member_birthday`;
CREATE TABLE `mk2_member_birthday`  (
  `mmb_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '生日优惠活动id',
  `topic_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '活动名称',
  `topic_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '优惠类型 00.按比例  10.按金额',
  `topic_price` decimal(10, 0) DEFAULT NULL COMMENT '优惠金额',
  `topic_proportion` varchar(8) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '优惠比例',
  `is_valid` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '是否有效',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`mmb_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '会员生日优惠表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for offline_cart
-- ----------------------------
DROP TABLE IF EXISTS `offline_cart`;
CREATE TABLE `offline_cart`  (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` mediumint(8) UNSIGNED DEFAULT 0 COMMENT '会员Id',
  `goods_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品Id',
  `sku` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'sku',
  `goods_sn` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '商品序列号',
  `prod_barcode` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '产品条码',
  `product_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0 COMMENT '产品Id',
  `goods_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '产品名称',
  `market_price` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '市场价',
  `retail_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '零售价格',
  `number` smallint(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT '数量',
  `stock_num` int(6) DEFAULT NULL COMMENT '商品库存数量',
  `list_pic_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品图片',
  `store_id` mediumint(11) DEFAULT NULL COMMENT '门店Id',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '线下购物车表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for pingan_pay_order
-- ----------------------------
DROP TABLE IF EXISTS `pingan_pay_order`;
CREATE TABLE `pingan_pay_order`  (
  `id` mediumint(9) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `out_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户订单编号',
  `pmt_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '收单机构名称',
  `pmt_tag` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '收单机构标签',
  `ord_mct_id` int(11) DEFAULT NULL COMMENT '商户流水号（从1开始自增长不重复）',
  `ord_shop_id` int(11) DEFAULT NULL COMMENT '门店流水号（从1开始自增长不重复）',
  `ord_currency` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '币种',
  `currency_sign` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '币种符号',
  `ord_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '平安订单号',
  `ord_type` int(11) DEFAULT NULL COMMENT '订单类型（1消费，2辙单）',
  `original_amount` int(11) DEFAULT NULL COMMENT '原始金额（以分为单位，没有小数点）',
  `discount_amount` int(11) DEFAULT NULL COMMENT '折扣金额（以分为单位，没有小数点）',
  `ignore_amount` int(11) DEFAULT NULL COMMENT '抹零金额（以分为单位，没有小数点）',
  `trade_account` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '交易帐号（银行卡号、支付宝帐号、微信帐号等，某些收单机构没有此数据）',
  `trade_no` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '收单机构交易号',
  `trade_amount` int(11) DEFAULT NULL COMMENT '实际交易金额（以分为单位，没有小数点）',
  `trade_qrcode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '二维码字符串',
  `amount` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '交易金额（分为单位）',
  `trade_time` datetime(0) DEFAULT NULL COMMENT '交易时间',
  `trade_pay_time` datetime(0) DEFAULT NULL COMMENT '付款完成时间（以收单机构为准）',
  `pay_time` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '交易成功时间（yyyymmddhhiiss）',
  `status` int(11) DEFAULT NULL COMMENT '订单状态（1交易成功，2待支付，4已取消，9等待用户输入密码确认）',
  `trade_result` varchar(4000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '收单机构原始交易数据',
  `jsapi_pay_url` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '公众号订单支付地址，如果为非公众号订单，此参数为空',
  `rand_str` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '随机字符串',
  `appId` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '小程序的appid',
  `timeStamp` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '小程序返回时间戳',
  `nonceStr` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '随机字符串',
  `signType` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '签名方式',
  `prepay_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '统一下单接口返回prepay_id参数值',
  `paySign` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '签名',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '平安支付订单信息' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for pingan_response
-- ----------------------------
DROP TABLE IF EXISTS `pingan_response`;
CREATE TABLE `pingan_response`  (
  `id` mediumint(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '编号',
  `out_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户订单编号',
  `req_interface` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '请求方法',
  `errcode` varchar(5) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '返回错误码，为0表示没有错误',
  `msg` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '返回错误提示，会根据lang参数返回不同的语言',
  `data` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT 'open_key进行aes加密后的数据',
  `sign` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '签名',
  `datajson` text CHARACTER SET utf8 COLLATE utf8_general_ci,
  `timestamp` datetime(0) DEFAULT NULL COMMENT '返回时间戳',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '平安支付回执信息' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for send_sms_record
-- ----------------------------
DROP TABLE IF EXISTS `send_sms_record`;
CREATE TABLE `send_sms_record`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `order_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '订单编号',
  `clear_no` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '清单编号',
  `phone_numbers` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '手机号码，多个以英文逗号分隔',
  `send_status` tinyint(4) NOT NULL COMMENT '发送状态，0：发送失败，1：发送成功',
  `send_fail_msg` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '发送失败原因',
  `request_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '请求id-阿里云短信接口返回',
  `biz_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '回执id-阿里云短信接口返回',
  `create_time` datetime(0) NOT NULL COMMENT '创建时间',
  `update_time` datetime(0) NOT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 29 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '短信发送记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for third_merch_express
-- ----------------------------
DROP TABLE IF EXISTS `third_merch_express`;
CREATE TABLE `third_merch_express`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `express_account` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户快递账号',
  `express_pwd` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户快递密码',
  `express_cus_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户快递月结账号',
  `third_party_merch_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户代码',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `creater_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `moder_sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间',
  `tstm` datetime(0) DEFAULT NULL COMMENT '时间戳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '第三方商户快递账号表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for third_merchant_biz
-- ----------------------------
DROP TABLE IF EXISTS `third_merchant_biz`;
CREATE TABLE `third_merchant_biz`  (
  `third_merch_sn` int(11) NOT NULL AUTO_INCREMENT COMMENT '第三方商户编号，主键编号',
  `merch_sn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商户编号',
  `third_party_merch_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户代码',
  `third_party_merch_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户名称',
  `is_stock_share` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商品库存是否共享 0：否 1：是',
  `is_store_user_share` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '门店用户是否共享 0：否 1：是',
  `is_map_show` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户地图是否显示 0：否 1：是',
  `is_dist_sell_start` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否开启渠道销售  0：否 1：是',
  `is_supplier_goods` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '门店第三方商户是否属于供应商模式商品购买 0：否 1：是',
  `is_face_check` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否使用人脸核验 0：否 1：是',
  `is_valid` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '是否有效,0:有效，1:无效',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人序号',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `mod_time` datetime(0) DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  PRIMARY KEY (`third_merch_sn`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 41 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '第三方商户表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for wx_cb_pay_doc
-- ----------------------------
DROP TABLE IF EXISTS `wx_cb_pay_doc`;
CREATE TABLE `wx_cb_pay_doc`  (
  `wx_pay_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '微信支付内部编号',
  `merch_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '00' COMMENT '商户编号,e码头分配',
  `merch_name` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户名称',
  `merch_erp_order_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '接入平台内部编号',
  `plat_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '平台编号,e码头分配',
  `plat_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '平台中文名',
  `third_party_merch_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户代码',
  `third_party_merch_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '第三方商户名称',
  `appid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '微信公众ID',
  `mch_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '微信支付商户号',
  `out_trade_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户订单号，商户系统内部订单号，要求32个字符内，只能是数字、大小写字母_-|*@ ，且在同一个商户号下唯一。',
  `sub_order_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '微信子订单号',
  `transaction_id` varchar(28) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '微信支付订单号',
  `customs` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '报送海关，NO 无需上报海关，\r\n            GUANGZHOU_ZS 广州（总署版），\r\n            GUANGZHOU_HP_GJ 广州黄埔国检（需推送订单至黄埔国检的订单需分别推送广州（总署版）和广州黄埔国检，即需要请求两次报关接口），\r\n            GUANGZHOU_NS_GJ 广州南沙国检（需推送订单至南沙国检的订单需分别推送广州（总署版）和广州南沙国检，即需要请求两次报关接口），\r\n            HANGZHOU_ZS 杭州（总署版），\r\n            NINGBO 宁波，\r\n            ZHENGZHOU_BS 郑州（保税物流中心），\r\n            CHONGQING 重庆，\r\n            XIAN 西安，\r\n            SHANGHAI_ZS 上海（总署版），\r\n            SHENZHEN 深圳，\r\n            ZHENGZHOU_ZH_ZS 郑州综保（总署版），\r\n            TIANJIN 天津，\r\n            BEIJING 北京，',
  `mch_customs_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户海关备案号',
  `duty` int(11) DEFAULT NULL COMMENT '关税，以分为单位，少数海关特殊要求上传该字段时需要',
  `action_type` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '报关类型，默认是新增，ADD 新增报关申请，MODIFY 修改\r\n            ',
  `sub_order_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '商户子订单号，如有拆单则必传',
  `fee_type` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '币种,暂只支持人民币CNY,如有拆单则必传',
  `order_fee` int(11) DEFAULT NULL COMMENT '应付金额,子订单金额，以分为单位，不能超过原订单金额，order_fee=transport_fee+product_fee（应付金额=物流费+商品价格），如有拆单则必传',
  `transport_fee` int(11) DEFAULT NULL COMMENT '物流费用，以分为单位，如有拆单则必传。',
  `product_fee` int(11) DEFAULT NULL COMMENT '商品费用，以分为单位，如有拆单则必传',
  `cert_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '证件类型，传固定值IDCARD,暂只支持大陆身份证',
  `cert_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '证件号码，用户大陆身份证号，尾号为字母X的身份证号，请大写字母X。',
  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '真实姓名',
  `doc_status` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '单证状态，00:待申报，01:申报中，03:申报失败，10:等待处理，11:业务处理中，12:业务成功，13:业务失败，20：申报重推',
  `buyer_payer_check` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '订购人支付人校验，0:未知，1:一致，2:不一致,3:校验异常',
  `remark` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `return_code` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '返回状态码，SUCCESS/FAIL，通信标识，非交易标识，交易是否成功需要查看result_code来判断',
  `return_msg` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '返回信息，返回信息，如非空，为错误原因，如：签名失败 等',
  `result_code` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '业务结果，SUCCESS/FAIL',
  `err_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '错误代码，详见微信推单错误代码',
  `err_code_des` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '错误代码描述',
  `creater_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人编号',
  `create_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建时间,yyyy-MM-dd HH:mm:ss',
  `moder_sn` varchar(22) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改人编号',
  `mod_time` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '修改时间,yyyy-MM-dd HH:mm:ss',
  `tstm` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
  `ex_field` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '扩展字段1',
  `ex_field2` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '扩展字段2',
  `ex_field3` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '扩展字段3',
  `ex_field4` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '扩展字段4',
  `ex_field5` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '扩展字段5',
  PRIMARY KEY (`wx_pay_sn`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信跨境支付单证' ROW_FORMAT = Compact;

SET FOREIGN_KEY_CHECKS = 1;
