-- 余额变动计录表
DROP TABLE IF EXISTS `custody_acco_balance_change_record`;
CREATE TABLE `custody_acco_balance_change_record`  (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `admin` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '租户名',
  `bank_acco` varchar(28) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '银行账号',
  `acco_type_code` varchar(5) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账户类型：ZJ001-托管户；ZJ002-募集户',
  `fund_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '基金代码',
  `fund_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '基金名称',
  `acco_balance_before` decimal(20, 2) NULL DEFAULT NULL COMMENT '变化前余额值',
  `acco_balance_after` decimal(20, 2) NULL DEFAULT NULL COMMENT '变化后余额值',
  `send_flag` int(1) NULL DEFAULT NULL COMMENT '是否已发送成功邮件/短信；0：都发送失败；1：邮件发送成功；2: 短信发送成功 3：都发送成功',
  `read_flag` int(1) NULL DEFAULT NULL COMMENT '私募平台消息是否已读',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
  `is_deleted` int(1) NULL DEFAULT NULL COMMENT '是否删除(有效|0,无效|1)',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `queryKey`(`admin`, `acco_type_code`, `bank_acco`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '余额变动记录表（custody_acco_balance_change_record）' ROW_FORMAT = Dynamic;

--  订阅人信息表
DROP TABLE IF EXISTS `custody_subscribe_info`;
CREATE TABLE `custody_subscribe_info`  (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `admin` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '租户名',
  `notifier` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '通知人',
  `subscribe_prt_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '订阅基金产品带代码',
  `email_address` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱地址',
  `mobile_no` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号码',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
  `is_deleted` int(1) NULL DEFAULT 0 COMMENT '是否删除(有效|0,无效|1)',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订阅信息表(custody_subscribe_info)' ROW_FORMAT = Dynamic;