CREATE TABLE IF NOT EXISTS `ccdi_intermediary_enterprise_relation` (
  `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `intermediary_biz_id` VARCHAR(64) NOT NULL COMMENT '所属中介biz_id',
  `social_credit_code` VARCHAR(18) NOT NULL COMMENT '统一社会信用代码',
  `relation_person_post` VARCHAR(100) DEFAULT NULL COMMENT '关联角色/职务',
  `remark` VARCHAR(500) DEFAULT NULL COMMENT '备注',
  `created_by` VARCHAR(64) DEFAULT NULL COMMENT '创建人',
  `create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_by` VARCHAR(64) DEFAULT NULL COMMENT '更新人',
  `update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_intermediary_enterprise` (`intermediary_biz_id`, `social_credit_code`),
  KEY `idx_intermediary_biz_id` (`intermediary_biz_id`),
  KEY `idx_social_credit_code` (`social_credit_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='中介关联机构关系表';
