CREATE TABLE IF NOT EXISTS `ccdi_project_risk_exclusion` (
  `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `project_id` BIGINT NOT NULL COMMENT '项目ID',
  `staff_id_card` VARCHAR(18) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '人员证件号',
  `rule_code` VARCHAR(64) COLLATE utf8mb4_general_ci NOT NULL COMMENT '规则编码',
  `exclusion_type` VARCHAR(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '排除类型：STATEMENT/OBJECT',
  `bank_statement_id` BIGINT DEFAULT NULL COMMENT '流水ID，仅流水型排除使用',
  `exclude_reason` VARCHAR(1000) COLLATE utf8mb4_general_ci NOT NULL COMMENT '排除原因',
  `create_by` VARCHAR(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建者',
  `create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` VARCHAR(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新者',
  `update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `remark` VARCHAR(500) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_ccdi_project_risk_exclusion_statement` (`project_id`,`rule_code`,`exclusion_type`,`bank_statement_id`),
  UNIQUE KEY `uk_ccdi_project_risk_exclusion_object` (`project_id`,`staff_id_card`,`rule_code`,`exclusion_type`),
  KEY `idx_ccdi_project_risk_exclusion_project` (`project_id`,`exclusion_type`),
  KEY `idx_ccdi_project_risk_exclusion_staff` (`staff_id_card`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='项目结果页排除可疑记录表';
