/*
 Navicat Premium Data Transfer

 Source Server         : 主机
 Source Server Type    : MySQL
 Source Server Version : 50718 (5.7.18-log)
 Source Host           : localhost:3306
 Source Schema         : la_order

 Target Server Type    : MySQL
 Target Server Version : 50718 (5.7.18-log)
 File Encoding         : 65001

 Date: 16/05/2024 11:30:14
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_invoicing_application
-- ----------------------------
DROP TABLE IF EXISTS `t_invoicing_application`;
CREATE TABLE `t_invoicing_application`  (
                                            `id` bigint(20) NOT NULL COMMENT '开票申请id',
                                            `member_id` bigint(20) NULL DEFAULT NULL COMMENT '会员id',
                                            `order_id` bigint(20) NULL DEFAULT NULL COMMENT '订单id',
                                            `apply_time` datetime NULL DEFAULT NULL COMMENT '申请时间',
                                            `status` tinyint(4) NULL DEFAULT NULL COMMENT '状态 1=待审核 2=审核通过 3=已拒绝',
                                            `invoice_type` tinyint(4) NULL DEFAULT NULL COMMENT '发票类型 1=普票 2=专票',
                                            `title_type` tinyint(4) NULL DEFAULT NULL COMMENT '抬头类型 1=企业单位 2=个人/非企业单位',
                                            `company_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '公司名称',
                                            `company_tax_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '公司税号',
                                            `company_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '公司地址',
                                            `company_phone` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '公司电话',
                                            `bank_name` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '公司开户行',
                                            `bank_account` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '公司账号',
                                            `total_amount` decimal(10, 0) NULL DEFAULT NULL COMMENT '总金额',
                                            `email` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '公司邮箱',
                                            `create_by` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
                                            `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                                            `update_by` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
                                            `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                            `del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '删除标志（0代表存在 1代表删除）',
                                            PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '开票申请表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_invoicing_application
-- ----------------------------

-- ----------------------------
-- Table structure for t_order
-- ----------------------------
DROP TABLE IF EXISTS `t_order`;
CREATE TABLE `t_order`  (
                            `id` bigint(20) NOT NULL COMMENT '订单id',
                            `order_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '订单编号',
                            `order_time` datetime NOT NULL COMMENT '下单时间',
                            `order_from` tinyint(4) NOT NULL COMMENT '订单来源 1=商品订单 2=秒杀订单 3=团购订单 4=保证金 5=拍卖订单',
                            `member_id` bigint(20) NOT NULL COMMENT '会员id',
                            `member_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '会员姓名',
                            `phone_number` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '联系方式',
                            `payment_method` tinyint(4) NOT NULL COMMENT '支付方式 1=微信 2=支付宝',
                            `total_amount` decimal(10, 0) NOT NULL COMMENT '支付合计',
                            `order_status` tinyint(4) NOT NULL COMMENT '订单状态 1=待发货 2=待收货 3=已完成 4=已取消',
                            `pay_time` datetime NULL DEFAULT NULL COMMENT '支付时间',
                            `cancel_time` datetime NULL DEFAULT NULL COMMENT '取消时间',
                            `order_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单备注',
                            `delivery_time` datetime NULL DEFAULT NULL COMMENT '发货时间',
                            `receive_time` datetime NULL DEFAULT NULL COMMENT '确认收货时间',
                            `discount_money` decimal(10, 0) NULL DEFAULT NULL COMMENT '优惠金额',
                            `goods_quantity` int(11) NULL DEFAULT NULL COMMENT '商品数量',
                            `create_by` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
                            `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                            `update_by` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
                            `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                            `del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '删除标志（0代表存在 1代表删除）',
                            PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单表' ROW_FORMAT = Dynamic;

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

-- ----------------------------
-- Table structure for t_order_auction
-- ----------------------------
DROP TABLE IF EXISTS `t_order_auction`;
CREATE TABLE `t_order_auction`  (
                                    `id` bigint(20) NOT NULL COMMENT '拍卖订单id',
                                    `order_id` bigint(20) NOT NULL COMMENT '订单id',
                                    `auction_salesroom_id` bigint(20) NULL DEFAULT NULL COMMENT '拍卖场id',
                                    `goods_sku_id` bigint(20) NOT NULL COMMENT '商品id',
                                    `auction_saleroom_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '所属拍卖场',
                                    `goods_sku_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '商品名称',
                                    `goods_cover_pic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '商品封面图',
                                    `create_by` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
                                    `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                                    `update_by` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
                                    `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                    `del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '删除标志（0代表存在 1代表删除）',
                                    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '拍卖订单表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_order_auction
-- ----------------------------

-- ----------------------------
-- Table structure for t_order_auction_bond
-- ----------------------------
DROP TABLE IF EXISTS `t_order_auction_bond`;
CREATE TABLE `t_order_auction_bond`  (
                                         `id` bigint(20) NOT NULL COMMENT '拍卖订单id',
                                         `order_id` bigint(20) NOT NULL COMMENT '订单id',
                                         `auction_salesroom_id` bigint(20) NULL DEFAULT NULL COMMENT '拍卖场id',
                                         `goods_sku_id` bigint(20) NULL DEFAULT NULL COMMENT '商品id',
                                         `bound_status` tinyint(1) NULL DEFAULT NULL COMMENT '是否缴纳保证金',
                                         `create_by` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
                                         `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                                         `update_by` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
                                         `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                         `del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '删除标志（0代表存在 1代表删除）',
                                         PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '拍卖保证金表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_order_auction_bond
-- ----------------------------

-- ----------------------------
-- Table structure for t_order_delivery
-- ----------------------------
DROP TABLE IF EXISTS `t_order_delivery`;
CREATE TABLE `t_order_delivery`  (
                                     `id` bigint(20) NOT NULL COMMENT '订单物流记录id',
                                     `order_id` bigint(20) NOT NULL COMMENT '订单id',
                                     `delivery_company` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '物流公司(配送方式)',
                                     `courier_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '快递单号',
                                     `receiver_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '收货人姓名',
                                     `receiver_phone` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '收货人电话',
                                     `receiver_province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '省份/直辖市',
                                     `receiver_city` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '城市',
                                     `receiver_region` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区',
                                     `receiver_detail_address` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详细地址',
                                     `delivery_status` tinyint(4) NULL DEFAULT NULL COMMENT '物流状态 0=运输中；1=已收货',
                                     `delivery_time` datetime NULL DEFAULT NULL COMMENT '发货时间',
                                     `receive_time` datetime NULL DEFAULT NULL COMMENT '确认收货时间',
                                     `create_by` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
                                     `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                                     `update_by` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
                                     `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                     `del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '删除标志（0代表存在 1代表删除）',
                                     PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单物流记录表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_order_delivery
-- ----------------------------

-- ----------------------------
-- Table structure for t_order_mall
-- ----------------------------
DROP TABLE IF EXISTS `t_order_mall`;
CREATE TABLE `t_order_mall`  (
                                 `id` bigint(20) NOT NULL COMMENT '商城订单id',
                                 `coupon_id` bigint(20) NULL DEFAULT NULL COMMENT '优惠券id',
                                 `order_id` bigint(20) NOT NULL COMMENT '订单id',
                                 `goods_sku_id` bigint(20) NOT NULL COMMENT '商品id',
                                 `goods_sku_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '商品名称',
                                 `goods_cover_pic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '商品封面图',
                                 `create_by` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
                                 `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                                 `update_by` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
                                 `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                 `del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '删除标志（0代表存在 1代表删除）',
                                 PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城订单表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_order_mall
-- ----------------------------

-- ----------------------------
-- Table structure for t_order_return_request
-- ----------------------------
DROP TABLE IF EXISTS `t_order_return_request`;
CREATE TABLE `t_order_return_request`  (
                                           `id` bigint(20) NOT NULL COMMENT '售后id',
                                           `order_id` bigint(20) NOT NULL COMMENT '订单id',
                                           `request_time` datetime NULL DEFAULT NULL COMMENT '申请时间',
                                           `request_type` tinyint(4) NULL DEFAULT NULL COMMENT '售后类型 1=退款 2=退款退货',
                                           `request_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '申请原因',
                                           `status` tinyint(4) NULL DEFAULT NULL COMMENT '售后状态 1=待审核 2=待退货 3=待平台收货 4=已完成 5=已拒绝',
                                           `audit_status` tinyint(4) NULL DEFAULT NULL COMMENT '审核状态 1=待审核 2=已通过 3=已拒绝',
                                           `refuse_resson` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '拒绝理由',
                                           `create_by` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
                                           `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                                           `update_by` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
                                           `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                           `del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '删除标志（0代表存在 1代表删除）',
                                           PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '售后表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_order_return_request
-- ----------------------------

-- ----------------------------
-- Table structure for undo_log
-- ----------------------------
DROP TABLE IF EXISTS `undo_log`;
CREATE TABLE `undo_log`  (
                             `id` bigint(20) NOT NULL AUTO_INCREMENT,
                             `branch_id` bigint(20) NOT NULL,
                             `xid` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
                             `context` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
                             `rollback_info` longblob NOT NULL,
                             `log_status` int(11) NOT NULL,
                             `log_created` datetime NOT NULL,
                             `log_modified` datetime NOT NULL,
                             `ext` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
                             PRIMARY KEY (`id`) USING BTREE,
                             UNIQUE INDEX `ux_undo_log`(`xid`, `branch_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of undo_log
-- ----------------------------

SET FOREIGN_KEY_CHECKS = 1;
