ALTER TABLE `zh_budget_std`
ADD COLUMN `zb_chapter_id`  varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '' COMMENT '招标-项目节-id列表(\',\'分隔)' AFTER `in_time`,
ADD COLUMN `zb_template_id`  varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '' COMMENT '招标-新建模板-id列表(\',\'分隔)' AFTER `zb_chapter_id`,
ADD COLUMN `zb_bills_id`  varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '' COMMENT '招标-工程量清单-id列表(\',\'分隔)' AFTER `zb_template_id`;

CREATE TABLE `zh_budget_zb` (
  `id` varchar(36) NOT NULL COMMENT 'uuid',
  `bid` int(10) NOT NULL COMMENT '概算投资项目id',
  `tree_id` int(10) NOT NULL COMMENT '节点id',
  `tree_pid` int(10) NOT NULL COMMENT '父节点id',
  `level` tinyint(4) NOT NULL COMMENT '层级',
  `order` mediumint(4) NOT NULL DEFAULT '0' COMMENT '同级排序',
  `full_path` varchar(255) DEFAULT '' COMMENT '层级定位辅助字段parent.full_path-tree_id',
  `is_leaf` tinyint(1) NOT NULL COMMENT '是否叶子节点，界面显示辅助字段',
  `code` varchar(50) DEFAULT '' COMMENT '节点编号',
  `b_code` varchar(50) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL COMMENT '名称',
  `unit` varchar(15) DEFAULT '' COMMENT '单位',
  `unit_price` decimal(24,8) NOT NULL DEFAULT '0.00000000' COMMENT '单价',
  `quantity` decimal(24,8) NOT NULL DEFAULT '0.00000000' COMMENT '数量',
  `total_price` decimal(24,8) DEFAULT '0.00000000' COMMENT '金额',
  `dgn_qty1` decimal(24,8) NOT NULL DEFAULT '0.00000000' COMMENT '设计数量1',
  `dgn_qty2` decimal(24,8) NOT NULL DEFAULT '0.00000000' COMMENT '设计数量2',
  `drawing_code` varchar(255) DEFAULT NULL COMMENT '图册号',
  `memo` varchar(1000) DEFAULT '' COMMENT '备注',
  `node_type` int(4) unsigned DEFAULT '0' COMMENT '节点类别',
  `source` varchar(30) DEFAULT '' COMMENT '添加源',
  `remark` varchar(60) DEFAULT '' COMMENT '备注',
  PRIMARY KEY (`id`),
  KEY `idx_bid` (`bid`),
  KEY `idx_tree_pid` (`tree_pid`),
  KEY `idx_level` (`level`),
  KEY `idx_full_path` (`bid`,`full_path`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='招标预算数据';

ALTER TABLE `zh_budget_final`
ADD COLUMN `zb_dgn_qty1`  decimal(24,8) NOT NULL DEFAULT 0.00000000 COMMENT '预算-设计数量1' AFTER `yu_tp`,
ADD COLUMN `zb_dgn_qty2`  decimal(24,8) NOT NULL DEFAULT 0.00000000 COMMENT '预算-设计数量1' AFTER `zb_dgn_qty1`,
ADD COLUMN `zb_dgn_qty`  varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '预算-设计数量1/设计数量2' AFTER `zb_dgn_qty2`,
ADD COLUMN `zb_dgn_price`  decimal(24,8) NOT NULL DEFAULT 0.00000000 COMMENT '预算-经济指标' AFTER `zb_dgn_qty`,
ADD COLUMN `zb_tp`  decimal(24,8) NOT NULL DEFAULT 0.00000000 COMMENT '预算-金额' AFTER `zb_dgn_price`;

CREATE TABLE `zh_control_price` (
  `id` varchar(36) NOT NULL COMMENT 'uuid',
  `tid` int(10) NOT NULL COMMENT '标段id',
  `tree_id` int(10) NOT NULL COMMENT '节点id',
  `tree_pid` int(10) NOT NULL COMMENT '父节点id',
  `level` tinyint(4) NOT NULL COMMENT '层级',
  `order` mediumint(4) NOT NULL DEFAULT '0' COMMENT '同级排序',
  `full_path` varchar(255) DEFAULT '' COMMENT '层级定位辅助字段parent.full_path-tree_id',
  `is_leaf` tinyint(1) NOT NULL COMMENT '是否叶子节点，界面显示辅助字段',
  `code` varchar(50) DEFAULT '' COMMENT '节点编号',
  `b_code` varchar(50) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL COMMENT '名称',
  `unit` varchar(15) DEFAULT '' COMMENT '单位',
  `unit_price` decimal(24,8) NOT NULL DEFAULT '0.00000000' COMMENT '单价',
  `quantity` decimal(24,8) NOT NULL DEFAULT '0.00000000' COMMENT '数量',
  `total_price` decimal(24,8) DEFAULT '0.00000000' COMMENT '金额',
  `dgn_qty1` decimal(24,8) NOT NULL DEFAULT '0.00000000' COMMENT '设计数量1',
  `dgn_qty2` decimal(24,8) NOT NULL DEFAULT '0.00000000' COMMENT '设计数量2',
  `drawing_code` varchar(255) DEFAULT NULL COMMENT '图册号',
  `memo` varchar(1000) DEFAULT '' COMMENT '备注',
  `node_type` int(4) unsigned DEFAULT '0' COMMENT '节点类别',
  `source` varchar(30) DEFAULT '' COMMENT '添加源',
  `remark` varchar(60) DEFAULT '' COMMENT '备注',
  PRIMARY KEY (`id`),
  KEY `idx_tid` (`tid`),
  KEY `idx_tree_pid` (`tree_pid`),
  KEY `idx_level` (`level`),
  KEY `idx_full_path` (`tid`,`full_path`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='招标控制价';

ALTER TABLE `zh_material_list_notjoin`
ADD COLUMN `type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1为本期不参与调差，2为数量变更不参与调差' AFTER `mx_id`;

ALTER TABLE `zh_stage_bills_pc`
MODIFY COLUMN `lid` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '项目节id' AFTER `sorder`;

CREATE TABLE `calculation`.`zh_project_stopmsg`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `pid` int NOT NULL COMMENT '项目id',
  `msg` varchar(255) NULL COMMENT '停用信息',
  `is_checked` tinyint(1) NULL DEFAULT 0 COMMENT '是否选中',
  `in_time` datetime NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE = InnoDB CHARACTER SET = utf8 COMMENT = '用户账号停用提示表';
