ALTER TABLE `zh_stage_audit`
ADD COLUMN `lock_lid`  text NULL COMMENT '锁定台账id(以,分隔)' AFTER `opinion`;

ALTER TABLE `zh_material_stage_bills` ADD `expr` VARCHAR(1000) NULL DEFAULT NULL COMMENT '表达式' AFTER `quantity`;
-- 同步旧数据
UPDATE `zh_material_stage_bills` a, `zh_material_bills` b SET a.`expr`= b.`expr` WHERE a.`mb_id` = b.`id`;

UPDATE `zh_material_bills` a, `zh_material` b SET a.`expr`= null WHERE a.`mid` = b.`id` AND t_type = 2 AND b.`is_stage_self` = 1;

CREATE TABLE `zh_s2b_spec_pull` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pid` int(11) NOT NULL,
  `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '名称',
  `pull_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '类型',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
  `info` text COLLATE utf8_unicode_ci COMMENT '拉取数据所需信息(json)',
  `memo` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '备注',
  `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '获取数据地址',
  `valid` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用',
  `pull_class` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '分类',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE `zh_tender_info`
ADD COLUMN `gxby_info`  varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '工序报验信息' AFTER `fun_rela`,
ADD COLUMN `dagl_info`  varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '档案管理信息' AFTER `gxby_info`;

ALTER TABLE `zh_ledger_extra_0`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_ledger_extra_1`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_ledger_extra_2`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_ledger_extra_3`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_ledger_extra_4`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_ledger_extra_5`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_ledger_extra_6`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_ledger_extra_7`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_ledger_extra_8`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_ledger_extra_9`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;

ALTER TABLE `zh_pos_extra_0`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_1`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_2`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_3`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_4`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_5`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_6`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_7`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_8`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_9`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_10`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_11`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_12`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_13`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_14`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_15`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_16`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_17`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_18`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;
ALTER TABLE `zh_pos_extra_19`
ADD COLUMN `dagl_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '档案管理id' AFTER `dagl_url`,
ADD COLUMN `gxby_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '工序报验id' AFTER `dagl_id`;



