-- 工作底稿表
CREATE TABLE `cost_project_task_draft` (
  `id` VARCHAR(64) NOT NULL COMMENT '主键',
  `task_id` VARCHAR(64) NOT NULL COMMENT '子任务ID',
  `content` TEXT COMMENT '工作底稿内容',
  `is_deleted` VARCHAR(1) DEFAULT '0' COMMENT '逻辑删除：0正常 1删除',
  `create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` VARCHAR(64) COMMENT '创建人',
  `update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` VARCHAR(64) COMMENT '更新人',
  PRIMARY KEY (`id`),
  KEY `idx_task_id` (`task_id`),
  KEY `idx_is_deleted` (`is_deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作底稿表';

-- 核增核减记录表
CREATE TABLE `cost_project_task_adjustment_record` (
  `id` VARCHAR(64) NOT NULL COMMENT '主键',
  `task_id` VARCHAR(64) NOT NULL COMMENT '子任务ID',
  `subject` VARCHAR(500) COMMENT '核增核减科目',
  `basic_situation` VARCHAR(1000) COMMENT '基本情况',
  `description` VARCHAR(2000) COMMENT '核增核减说明',
  `time` VARCHAR(200) COMMENT '时间',
  `attachment_id` VARCHAR(64) COMMENT '附件ID',
  `order_num` INT DEFAULT 0 COMMENT '序号',
  `is_deleted` VARCHAR(1) DEFAULT '0' COMMENT '逻辑删除：0正常 1删除',
  `create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` VARCHAR(64) COMMENT '创建人',
  `update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `update_by` VARCHAR(64) COMMENT '更新人',
  PRIMARY KEY (`id`),
  KEY `idx_task_id` (`task_id`),
  KEY `idx_is_deleted` (`is_deleted`),
  KEY `idx_order_num` (`order_num`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='核增核减记录表';

