ALTER TABLE `zh_tender`
ADD COLUMN `copy_id` INT(10) NULL COMMENT '被拷贝标段id' AFTER `uuid`;


ALTER TABLE `zh_change_audit_list` ADD `gcl_id` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '台账对应id（非准确）' AFTER `xmj_jldy`;
UPDATE `zh_change_audit_list` SET `gcl_id`=`lid` WHERE `lid` != '0';

-- sync2bim相关
ALTER TABLE `zh_s2b_proj`
ADD COLUMN `merge_code`  tinyint(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `common_option`;

-- ----------------------------
-- Table structure for zh_tender_tag
-- ----------------------------
CREATE TABLE `zh_tender_tag` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `tid` int(11) NOT NULL COMMENT '标段id',
  `pid` int(11) NOT NULL COMMENT '项目id',
  `ledger_time` datetime DEFAULT NULL COMMENT '台账分解审批完成时间',
  `revise_time` datetime DEFAULT NULL COMMENT '最后一次台账修订审批完成时间',
  `stage_time` datetime DEFAULT NULL COMMENT '最后一次期审批完成时间',
  `bgl_time` datetime DEFAULT NULL COMMENT '最后一次变更令审批完成时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2049 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Table structure for zh_s2b_proj_push
-- ----------------------------
CREATE TABLE `zh_s2b_proj_push` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `pid` int(11) NOT NULL COMMENT '项目id-zh_s2b_proj中的id',
  `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '名称',
  `url` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT '推送的url',
  `ledger` tinyint(1) NOT NULL DEFAULT '1' COMMENT '台账审批通过-是否推送',
  `revise` tinyint(1) NOT NULL DEFAULT '1' COMMENT '台账修订审批通过-是否推送',
  `stage` tinyint(1) NOT NULL DEFAULT '1' COMMENT '期审批通过-是否推送',
  `bgl` tinyint(1) NOT NULL DEFAULT '1' COMMENT '变更令审批通过-是否需要推送',
  `add_time` datetime(4) DEFAULT NULL COMMENT '创建时间',
  `lastest_time` datetime(4) DEFAULT NULL COMMENT '最后修改时间',
  `push_time` datetime(4) DEFAULT NULL COMMENT '最近一次推送时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Insert Into zh_tender_tag (tid, pid) Select id, project_id From zh_tender Where 1=1;

-- ----------------------------
-- Table structure for zh_s2b_proj_push
-- ----------------------------
CREATE TABLE `zh_s2b_proj_push` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `pid` int(11) NOT NULL COMMENT '项目id-zh_s2b_proj中的id',
  `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '名称',
  `url` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT '推送的url',
  `ledger` tinyint(1) NOT NULL DEFAULT '1' COMMENT '台账审批通过-是否推送',
  `revise` tinyint(1) NOT NULL DEFAULT '1' COMMENT '台账修订审批通过-是否推送',
  `stage` tinyint(1) NOT NULL DEFAULT '1' COMMENT '期审批通过-是否推送',
  `bgl` tinyint(1) NOT NULL DEFAULT '1' COMMENT '变更令审批通过-是否需要推送',
  `add_time` datetime(4) DEFAULT NULL COMMENT '创建时间',
  `lastest_time` datetime(4) DEFAULT NULL COMMENT '最后修改时间',
  `push_time` datetime(4) DEFAULT NULL COMMENT '最近一次推送时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE `zh_s2b_c_proj`
ADD COLUMN `push_tender`  varchar(1000) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT '推送的标段' AFTER `base_data`;

ALTER TABLE `zh_s2b_proj`
ADD COLUMN `filter_tender`  varchar(1000) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT '过滤标段' AFTER `merge_code`;
