ALTER TABLE `zh_budget`
ADD COLUMN `final_time`  timestamp NULL DEFAULT NULL COMMENT '生成动态决算时间' AFTER `decimal`,
ADD COLUMN `final_id`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `final_time`;

CREATE TABLE `zh_budget_final` (
`id`  bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT ,
`bid`  int(11) UNSIGNED NOT NULL COMMENT '动态决算id' ,
`uid`  int(11) UNSIGNED NOT NULL COMMENT '生成决算人' ,
`create_time`  timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间' ,
`update_time`  timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间' ,
`tender`  varchar(1000) NOT NULL DEFAULT '' COMMENT '关联标段id(\',\'分隔)' ,
`tender_info`  text NULL COMMENT '关联标段信息(json)' ,
`status`  tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0: 取消, 1: 等待, 2: 进行中, 3: 完成' ,
PRIMARY KEY (`id`),
INDEX `idx_bid` (`bid`, `create_time`) USING BTREE
)
;
