-- 请按如下分类提交sql！！！
-- Version V3.5.52.xxxx
-- uat 2026-xx-xx
-- prod 2026-xx-xx

------------------------------------
-- 表结构
------------------------------------
ALTER TABLE `zh_material`
ADD COLUMN `is_new_exponent` tinyint(1) NULL DEFAULT 0 COMMENT '是否是新建的调差期，用于区分新指数法调差规则' AFTER `is_stage_self`,
ADD COLUMN `ex_tax_tp` decimal(30, 8) NULL DEFAULT NULL COMMENT '指数本期建筑税金额' AFTER `ex_pre_tp`,
ADD COLUMN `ex_tax_pre_tp` decimal(30, 8) NULL DEFAULT NULL COMMENT '指数截止上期建筑税金额' AFTER `ex_tax_tp`,
ADD COLUMN `exponent_decimal` varchar(255) NULL DEFAULT NULL COMMENT '指数小数位数设置JSON' AFTER `decimal`,
ADD COLUMN `exponent_node` text NULL COMMENT '本期分项价格指数节点' AFTER `calc_tp`,
ADD COLUMN `pre_exponent_node` text NULL COMMENT '截止上期分项价格指数节点，用于禁止移除节点' AFTER `exponent_node`;

ALTER TABLE `zh_material_stage`
ADD COLUMN `ex_tp` decimal(30, 8) NULL DEFAULT NULL COMMENT '指数本期金额' AFTER `m_tax_tp`,
ADD COLUMN `ex_tax_tp` decimal(30, 8) NULL DEFAULT NULL COMMENT '指数本期建筑税金额' AFTER `ex_tp`,
ADD COLUMN `ex_expr` varchar(5000) NULL DEFAULT NULL COMMENT '指数调差公式' AFTER `ex_tax_tp`,
ADD COLUMN `ex_calc` varchar(1000) NULL DEFAULT NULL COMMENT '调差基数值json' AFTER `ex_expr`;

CREATE TABLE `zh_material_exponent_node`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `tid` int NOT NULL COMMENT '标段id',
  `mid` int NOT NULL COMMENT '调差id',
  `ms_id` int NULL DEFAULT NULL COMMENT '调差多期单独计价期id(可以为空)',
  `node` varchar(255) NOT NULL COMMENT '分项节点id',
  `code` varchar(255) NULL DEFAULT '' COMMENT '节点编号',
  `name` varchar(255) NULL DEFAULT '' COMMENT '节点名称',
  `ex_tp` decimal(30, 8) NULL DEFAULT NULL COMMENT '节点指数本期金额',
  `ex_pre_tp` decimal(30, 8) NULL DEFAULT NULL COMMENT '截止上期节点指数金额',
  `ex_tax_tp` decimal(30, 8) NULL DEFAULT NULL COMMENT '节点指数含税金额',
  `ex_tax_pre_tp` decimal(30, 8) NULL DEFAULT NULL COMMENT '截止上期节点指数含税金额',
  `ex_expr` varchar(5000) NULL DEFAULT NULL COMMENT '指数调差公式（非独立期时用）',
  `ex_calc` varchar(1000) NULL DEFAULT NULL COMMENT '调差基数值json（非独立期时用）',
  `contract_tp` decimal(30, 8) NULL DEFAULT NULL COMMENT '计量期该节点汇总合同计量金额（方便统计）',
  `qc_tp` decimal(30, 8) NULL DEFAULT NULL COMMENT '计量期该节点汇总变更计量金额（方便统计）',
  `gather_tp` decimal(30, 8) NULL DEFAULT NULL COMMENT '计量期该节点汇总完成计量金额（方便统计）',
  PRIMARY KEY (`id`)
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_unicode_ci COMMENT = '调差指数分项价格指数表';

ALTER TABLE `zh_sub_project_info`
ADD COLUMN `lx_tp_unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '元' COMMENT '立项-金额单位' AFTER `lx_tp`,
ADD COLUMN `cb_tp_unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '元' COMMENT '初步-金额单位' AFTER `cb_tp`,
ADD COLUMN `sg_tp_unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '元' COMMENT '施工许可批复-金额单位' AFTER `sg_tp`,
ADD COLUMN `jg_tp_unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '元' COMMENT '交工-金额单位' AFTER `jg_tp`,
ADD COLUMN `sgt_tp_unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '元' COMMENT '施工图-金额单位' AFTER `sgt_tp`,
ADD COLUMN `pf_tp_unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '元' COMMENT '财评/造价站批复-金额单位' AFTER `pf_tp`,
ADD COLUMN `zb_tp_unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '元' COMMENT '招标完成-金额单位' AFTER `zb_tp`;




------------------------------------
-- 表数据
------------------------------------



