/*
 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_promotion

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

 Date: 16/05/2024 11:22:46
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_coupon
-- ----------------------------
DROP TABLE IF EXISTS `t_coupon`;
CREATE TABLE `t_coupon`  (
                             `id` bigint(20) NOT NULL,
                             `coupon_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '优惠券名称',
                             `coupon_type` tinyint(4) NOT NULL COMMENT '优惠券类型 1=满减券 2=代金券 3=折扣券',
                             `coupon_status` tinyint(4) NULL DEFAULT NULL COMMENT '状态 0=已上架 1=已下架',
                             `full_reduction_amount` decimal(10, 0) NULL DEFAULT NULL COMMENT '满减金额，例如：满100元',
                             `reduction_amount` decimal(10, 0) NULL DEFAULT NULL COMMENT '减少金额，例如：减50元',
                             `voucher_amount` decimal(10, 0) NULL DEFAULT NULL COMMENT '代金券金额，例如：50元',
                             `discount_rate` double NULL DEFAULT NULL COMMENT '折扣额度，例如：8折',
                             `max_discount` decimal(10, 0) NULL DEFAULT NULL COMMENT '最高可抵扣金额，例如：200元',
                             `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '优惠券说明',
                             `start_date` datetime NOT NULL COMMENT '有效期起',
                             `end_date` datetime NOT NULL COMMENT '有效期止',
                             `member_level` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '会员等级，多等级以\",\"隔开',
                             `issued_quantity` int(11) NOT 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_coupon
-- ----------------------------

-- ----------------------------
-- Table structure for t_coupon_member
-- ----------------------------
DROP TABLE IF EXISTS `t_coupon_member`;
CREATE TABLE `t_coupon_member`  (
                                    `id` bigint(20) NOT NULL COMMENT '优惠券领取id',
                                    `coupon_id` bigint(20) NOT NULL COMMENT '优惠券id',
                                    `member_id` bigint(20) NOT NULL COMMENT '会员id',
                                    `coupon_type` tinyint(4) NOT NULL COMMENT '优惠券类型 1=满减券 2=代金券 3=折扣券',
                                    `coupon_status` tinyint(4) NULL DEFAULT NULL COMMENT '优惠券状态-1删除0已过期1已领取2已使用',
                                    `coupon_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '优惠券名称',
                                    `full_reduction_amount` decimal(10, 0) NULL DEFAULT NULL COMMENT '满减金额，例如：满100元',
                                    `reduction_amount` decimal(10, 0) NULL DEFAULT NULL COMMENT '减少金额，例如：减50元',
                                    `voucher_amount` decimal(10, 0) NULL DEFAULT NULL COMMENT '代金券金额，例如：50元',
                                    `discount_rate` int(11) NULL DEFAULT NULL COMMENT '折扣额度，例如：8折',
                                    `max_discount` decimal(10, 0) NULL DEFAULT NULL COMMENT '最高可抵扣金额，例如：200元',
                                    `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '优惠券说明',
                                    `start_date` datetime NOT NULL COMMENT '有效期起',
                                    `end_date` datetime NOT 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_coupon_member
-- ----------------------------

-- ----------------------------
-- Table structure for t_promotion_banner
-- ----------------------------
DROP TABLE IF EXISTS `t_promotion_banner`;
CREATE TABLE `t_promotion_banner`  (
                                       `id` bigint(20) NOT NULL COMMENT '轮播图id',
                                       `banner_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '轮播图名称',
                                       `banner_type` tinyint(4) NULL DEFAULT NULL COMMENT '轮播图类型 1=商城首页 2=资讯首页',
                                       `pic_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '图片',
                                       `sort_num` int(11) NOT 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_promotion_banner
-- ----------------------------

-- ----------------------------
-- Table structure for t_promotion_video
-- ----------------------------
DROP TABLE IF EXISTS `t_promotion_video`;
CREATE TABLE `t_promotion_video`  (
                                      `id` bigint(20) NOT NULL COMMENT '视频id',
                                      `video_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '视频名称',
                                      `video_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT 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_promotion_video
-- ----------------------------

-- ----------------------------
-- Table structure for t_promotion_wish_list
-- ----------------------------
DROP TABLE IF EXISTS `t_promotion_wish_list`;
CREATE TABLE `t_promotion_wish_list`  (
                                          `id` bigint(20) NOT NULL COMMENT '心愿求购id',
                                          `goods_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '商品名称',
                                          `expected_price` decimal(10, 0) NOT NULL COMMENT '期望价格',
                                          `goods_image_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '商品图片 [\'a\',\'b\',\'c\',\'d\',\'e\']',
                                          `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注',
                                          `replies` 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_promotion_wish_list
-- ----------------------------

-- ----------------------------
-- 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;
