-- ----------------------------
-- Records of sys_tenant_package
-- ----------------------------

SET FOREIGN_KEY_CHECKS = 1;
DROP TABLE IF EXISTS `sys_home_layout`;
CREATE TABLE  `sys_home_layout`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `block_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NOT NULL COMMENT '区块名称',
  `block_url` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NOT NULL COMMENT '区块url',
  `block_type` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NOT NULL COMMENT '区块类型',
  `sort_order` int NOT NULL DEFAULT 0 COMMENT '排序权重',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态: 0=禁用 1=启用',
  `deleted` tinyint(1) NOT NULL COMMENT '逻辑删除标记(0-正常，1-已删除)',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
  `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '修改人',
  `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '租户id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_german2_ci COMMENT = '首页布局配置表' ROW_FORMAT = DYNAMIC;


-- ----------------------------
-- Table structure for mp_account
-- ----------------------------
DROP TABLE IF EXISTS `mp_account`;
CREATE TABLE `mp_account`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '公众号名称',
  `account` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '公众号账号',
  `app_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '公众号appid',
  `app_secret` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '公众号密钥',
  `url` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '公众号url',
  `token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '公众号token',
  `aes_key` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '加密密钥',
  `qr_code_url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '二维码图片URL',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '逻辑删除标记(0-正常,1-已删除)',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '修改人',
  `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT 'Default' COMMENT '租户id',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_name`(`name` ASC) USING BTREE COMMENT '公众号名称',
  INDEX `idx_account`(`account` ASC) USING BTREE COMMENT '公众号账号'
) ENGINE = InnoDB  CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '公众号账号表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of mp_account
-- ----------------------------
INSERT INTO `seer_teach`.`mp_account` (`id`, `name`, `account`, `app_id`, `app_secret`, `url`, `token`, `aes_key`, `qr_code_url`, `remark`, `deleted`, `create_time`, `update_time`, `create_by`, `update_by`, `tenant_id`) VALUES (6, 'zs_wx', 'gh_00df122546c6', 'wx282bf10d32dec7d1', 'b084d2effa8a4c05d4ffb8b2b8629fea', NULL, 'b084d2effa8a4c05d4ffb8b2b8629fea', '123456', NULL, 'test', b'0', '2025-08-03 14:58:30', '2025-08-03 06:58:33', NULL, NULL, 'Default');
INSERT INTO `seer_teach`.`mp_account` (`id`, `name`, `account`, `app_id`, `app_secret`, `url`, `token`, `aes_key`, `qr_code_url`, `remark`, `deleted`, `create_time`, `update_time`, `create_by`, `update_by`, `tenant_id`) VALUES (7, 'zs', 'gh_01127b4e121f', 'wx6e4dc0d5e7081bc3', '69fed03557707e30d811993176d2f391', NULL, '2781772744', 'QSCBNMBSxbfkbwp9df9saS8YofQtvc0hzXfgCVcxZNH', NULL, '', b'0', '2025-08-04 14:57:27', '2025-08-04 06:57:27', NULL, NULL, 'Default');
INSERT INTO `seer_teach`.`mp_account` (`id`, `name`, `account`, `app_id`, `app_secret`, `url`, `token`, `aes_key`, `qr_code_url`, `remark`, `deleted`, `create_time`, `update_time`, `create_by`, `update_by`, `tenant_id`) VALUES (8, 'zs_llp', 'gh_da6de131ee0e', 'wx8f2aa0defc700688', '099a83451fe163f0cec329a7b13ad665', NULL, '099a83451fe163f0cec329a7b13ad665', 'QSCBNMBSxbfkbwp9df9saS8YofQtvc0hzXfgCVcxZNH', NULL, '', b'0', '2025-08-08 10:31:50', '2025-08-08 02:31:52', NULL, NULL, 'Default');


DROP TABLE IF EXISTS `mp_message`;
CREATE TABLE `mp_message`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `msg_id` bigint NULL DEFAULT NULL COMMENT '微信公众号的消息编号',
  `app_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '公众号 appId',
  `user_id` bigint NOT NULL COMMENT '公众号用户的编号',
  `from_user` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '发送方账号（一个OpenID）',
  `to_user` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '开发者微信号',
  `type` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '消息类型',
  `send_from` tinyint NULL COMMENT '消息来源',
  `content` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '消息内容',
  `media_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '媒体文件 id',
  `media_url` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '媒体文件 URL',
  `recognition` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '语音识别后文本',
  `format` varchar(16) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '语音格式',
  `title` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '标题',
  `description` varchar(256) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '描述',
  `thumb_media_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '缩略图的媒体 id',
  `thumb_media_url` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '缩略图的媒体 URL',
  `url` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '点击图文消息跳转链接',
  `location_x` double NULL DEFAULT NULL COMMENT '地理位置维度',
  `location_y` double NULL DEFAULT NULL COMMENT '地理位置经度',
  `scale` double NULL DEFAULT NULL COMMENT '地图缩放大小',
  `label` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '详细地址',
  `articles` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '图文消息数组',
  `music_url` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '音乐链接',
  `hq_music_url` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '高质量音乐链接',
  `event` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '事件类型',
  `event_key` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '事件 Key',
  `deleted` bit(1) NOT NULL COMMENT '逻辑删除标记(0-正常,1-已删除)',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '修改人',
  `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT 'Default' COMMENT '租户id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 414 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '公众号消息表 ';

-- ----------------------------
-- Table structure for mp_user
-- ----------------------------
DROP TABLE IF EXISTS `mp_user_subscribe`;
CREATE TABLE `mp_user_subscribe`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  `user_id`  bigint(20)  NULL DEFAULT NULL COMMENT '用户',
  `subscribe_status` tinyint  NULL COMMENT '关注状态',
  `subscribe_time` datetime  NULL COMMENT '关注时间',
  `unsubscribe_time` datetime NULL DEFAULT NULL COMMENT '取消关注时间',
  `account_id` bigint NULL COMMENT '微信公众号ID',
  `app_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '微信公众号 appid',
  `deleted` bit(1) NOT NULL COMMENT '逻辑删除标记(0-正常,1-已删除)',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_time` datetime  NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '修改人',
  `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT 'Default' COMMENT '租户id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 55 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '公众号用户订阅表';


DROP TABLE IF EXISTS `mp_dealer_applications`;
CREATE TABLE `mp_dealer_applications` (
    `id` INT AUTO_INCREMENT COMMENT '主键',
    `applicant_user_id` bigint NOT NULL COMMENT '申请人的userId',
    `applicant_name` VARCHAR(100) NOT NULL COMMENT '申请人的姓名',
    `phone` VARCHAR(100) NOT NULL COMMENT '申请人的手机号码',
    `business_license_number` VARCHAR(255) NOT NULL COMMENT '加密存储的营业执照号码',
    `business_license_image` longtext NOT NULL COMMENT '加密存储的营业执照照片路径或Base64',
    `id_card_number` VARCHAR(255) NOT NULL COMMENT '加密存储的身份证号码',
    `id_card_front_image` longtext NOT NULL COMMENT '加密存储的身份证正面照片的Base64',
    `id_card_back_image` longtext NOT NULL COMMENT '加密存储的身份证反面照片的Base64',
    `description` varchar(500) NULL COMMENT '描述',
    `status` bit(1) NOT NULL DEFAULT b'0' COMMENT '申请状态，0-待审核，1-审核通过，2-审核拒绝',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '创建人',
    `update_time` datetime  NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
    `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '修改人',
    `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
     tenant_id VARCHAR(64)  NULL DEFAULT 'Default'  COMMENT '租户id',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `index_applicant_user_id` (`applicant_user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '经销商申请表' ROW_FORMAT = DYNAMIC;


-- ----------------------------
-- Table structure for mp_template_message_mapping
-- ----------------------------
DROP TABLE IF EXISTS `mp_template_message_mapping`;
CREATE TABLE `mp_template_message_mapping`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `template_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NOT NULL COMMENT '微信模板ID',
  `template_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '模板名称',
  `system_field` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NOT NULL COMMENT '系统字段名',
  `wechat_field` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NOT NULL COMMENT '微信模板字段名',
  `field_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '字段类型(character_string/thing/number等)',
  `is_required` TINYINT(1) DEFAULT 1 COMMENT '是否必填',
  `max_length` INT COMMENT '最大长度限制',
  `default_value` VARCHAR(200) COMMENT '默认值',
  `sample_value` VARCHAR(200) COMMENT '示例值',
  `description` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '字段说明',
  `deleted` tinyint(1) NOT NULL COMMENT '逻辑删除标记(0-正常，1-已删除)',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
  `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '修改人',
  `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT 'Default'   COMMENT '租户id',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `index_template_id` (`template_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_german2_ci COMMENT = '微信模板消息映射表'  ROW_FORMAT = Dynamic;


DROP TABLE IF EXISTS `mp_template_message`;
CREATE TABLE `mp_template_message` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` bigint NOT NULL COMMENT '微信公众号 appid',
  `app_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '用户ID',
  `openid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '微信openid',
  `msg_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '消息id',
  `business_id` bigint NULL DEFAULT NULL COMMENT '业务ID',
  `template_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '微信模板ID',
  `url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '跳转链接',
  `data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '模板数据（JSON格式）',
  `status` tinyint NOT NULL DEFAULT 0 COMMENT '发送状态：0-待发送，1-发送成功，2-发送失败',
  `error_msg` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '失败消息',
  `deleted` tinyint(1) NOT NULL COMMENT '逻辑删除标记(0-正常，1-已删除)',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
  `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '修改人',
  `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT 'Default'  COMMENT '租户id',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_user_id`(`user_id` ASC) USING BTREE,
  INDEX `idx_openid`(`openid` ASC) USING BTREE,
  INDEX `idx_template_id`(`template_id` ASC) USING BTREE,
  INDEX `idx_create_time`(`create_time` ASC) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='模板消息表';


DROP TABLE IF EXISTS `mp_message_group`;
CREATE TABLE mp_message_group (
    id INT AUTO_INCREMENT PRIMARY KEY COMMENT '主键',
    group_name VARCHAR(100) NOT NULL COMMENT '群组名称',
    description VARCHAR(500) COMMENT '描述',
    create_by VARCHAR(64) NOT NULL COMMENT '创建人',
    create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    update_by VARCHAR(64) COMMENT '更新人',
    update_time DATETIME ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    deleted TINYINT DEFAULT 0 NOT NULL COMMENT '是否删除：0-正常，1-删除',
    tenant_id VARCHAR(64) NOT NULL DEFAULT 'Default' COMMENT '租户ID'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息群组表';

DROP TABLE IF EXISTS `mp_message_group_user`;
CREATE TABLE mp_message_group_user (
    id INT AUTO_INCREMENT PRIMARY KEY COMMENT '主键',
    group_id INT NOT NULL COMMENT '群组ID',
    user_id VARCHAR(64) NOT NULL COMMENT '用户ID',
    create_by VARCHAR(64) NULL COMMENT '创建人',
    create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    update_by VARCHAR(64) NULL COMMENT '更新人',
    update_time DATETIME ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    deleted TINYINT DEFAULT 0 NOT NULL COMMENT '是否删除：0-正常，1-删除',
    tenant_id VARCHAR(64) NULL DEFAULT 'Default' COMMENT '租户ID',
    UNIQUE KEY uk_group_user (group_id, user_id, deleted) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='群组人员关系表';

DROP TABLE IF EXISTS `mp_template_message_config`;
CREATE TABLE `mp_template_message_config` (
   id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `app_id` varchar(64) NOT NULL COMMENT 'app ID',
  `template_id` varchar(128) NOT NULL COMMENT '模板ID',
  `template_title` varchar(512)  NULL COMMENT '模板标题',
  `group_ids` VARCHAR(128) NOT NULL COMMENT '群组ID',
  `business_scene_code` varchar(64) NOT NULL COMMENT '业务场景编码',
  `url` varchar(64) NULL COMMENT 'url',
  `mini_program_app_id` varchar(64)  NULL COMMENT '跳转到小程序的appId',
  `mini_program_page_path` varchar(64)  NULL COMMENT '跳转到小程序的页面路径',
  `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态：0-禁用，1-启用',
   remark varchar(255) DEFAULT NULL COMMENT '备注',
   create_by VARCHAR(64)  NULL COMMENT '创建人',
   create_time DATETIME  NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
   update_by VARCHAR(64) COMMENT '更新人',
   update_time DATETIME ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
   deleted TINYINT DEFAULT 0 NOT NULL COMMENT '是否删除：0-正常，1-删除',
   tenant_id VARCHAR(64)  NULL DEFAULT 'Default'  COMMENT '租户id',
  PRIMARY KEY (id),
  UNIQUE KEY `uk_business_scene_code` (`business_scene_code`,`app_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='模板消息自动发送配置表';