-- 请按如下分类提交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 = '调差指数分项价格指数表';

CREATE TABLE `zh_material_exponent_shard` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tid` int(11) NOT NULL COMMENT '标段id',
  `mid` int(11) NOT NULL COMMENT '调差期id',
  `ms_id` int(11) DEFAULT NULL COMMENT '调差多期单独计价期id(可以为空)',
  `mn_id` int(11) DEFAULT NULL COMMENT '调差分项指数id（可以为空）',
  `me_id` int(11) NOT NULL COMMENT '指数工料id',
  `type` tinyint(1) NOT NULL DEFAULT '2' COMMENT '类型（1定值或2变值）',
  `weight_num` decimal(30,8) DEFAULT NULL COMMENT '加权系数',
  `m_price` decimal(30,8) DEFAULT NULL COMMENT '现行价格指数',
  `remark` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB CHARSET=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`;

ALTER TABLE `zh_tender_permission`
ADD COLUMN `schedule` varchar(255) NOT NULL DEFAULT '' COMMENT '标段进度权限(,分隔，具体见代码定义)' AFTER `safe_payment`;

ALTER TABLE `zh_ledger_extra_0`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_1`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_2`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_3`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_4`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_5`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_6`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_7`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_8`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_9`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_10`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_11`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_12`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_13`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_14`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_15`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_16`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_17`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_18`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_19`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_20`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_21`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_22`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_23`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_24`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_25`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_26`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_27`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_28`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_29`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_30`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_31`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_32`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_33`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_34`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_35`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_36`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_37`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_38`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_39`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_40`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_41`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_42`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_43`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_44`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_45`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_46`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_47`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_48`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_49`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_50`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_51`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_52`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_53`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_54`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_55`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_56`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_57`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_58`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_59`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_60`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_61`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_62`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_63`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_64`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_65`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_66`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_67`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_68`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_69`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_70`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_71`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_72`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_73`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_74`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_75`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_76`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_77`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_78`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_79`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_80`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_81`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_82`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_83`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_84`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_85`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_86`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_87`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_88`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_89`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_90`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_91`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_92`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_93`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_94`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_95`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_96`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_97`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_98`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;
ALTER TABLE `zh_ledger_extra_99`
ADD COLUMN `calc_template` varchar(36) NOT NULL DEFAULT '' COMMENT '计算模板' AFTER `multi_limit`;

CREATE TABLE `zh_pos_calc_detail`  (
  `id` varchar(36) NOT NULL COMMENT 'uuid',
  `tid` int(11) NOT NULL COMMENT '标段id(zh_tender.id)',
  `lid` varchar(36) NOT NULL COMMENT '台账id(zh_ledger.id)',
  `pid` varchar(36) NOT NULL COMMENT '计量单元id(zh_pos.id)',
  `pcd_order` int(11) NOT NULL COMMENT '排序',
  `create_user_id` int(11) NOT NULL COMMENT '新增用户id(zh_project_account.id)',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
  `update_user_id` int(11) NOT NULL COMMENT '最后修改用户id(zh_project_account.id)',
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  `qty` decimal(24, 8) NOT NULL DEFAULT 0 COMMENT '数量',
  `expr` varchar(255) NOT NULL DEFAULT '' COMMENT '数量计算式',
  `str1` varchar(255) NOT NULL DEFAULT '' COMMENT '文本1',
  `str2` varchar(255) NOT NULL DEFAULT '' COMMENT '文本2',
  `str3` varchar(255) NOT NULL DEFAULT '' COMMENT '文本3',
  `str4` varchar(255) NOT NULL DEFAULT '' COMMENT '文本4',
  `spec` varchar(50) NOT NULL DEFAULT '' COMMENT '规格',
  `num_a` decimal(24, 8) NOT NULL DEFAULT 0 COMMENT '数值a',
  `num_b` decimal(24, 8) NOT NULL DEFAULT 0 COMMENT '数值b',
  `num_c` decimal(24, 8) NOT NULL DEFAULT 0 COMMENT '数值c',
  `num_d` decimal(24, 8) NOT NULL DEFAULT 0 COMMENT '数值d',
  `num_e` decimal(24, 8) NOT NULL DEFAULT 0 COMMENT '数值e',
  `num_f` decimal(24, 8) NOT NULL DEFAULT 0 COMMENT '数值f',
  `num_g` decimal(24, 8) NOT NULL DEFAULT 0 COMMENT '数值g',
  `num_h` decimal(24, 8) NOT NULL DEFAULT 0 COMMENT '数值h',
  `num_i` decimal(24, 8) NOT NULL DEFAULT 0 COMMENT '数值i',
  PRIMARY KEY (`id`)
);

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

INSERT INTO `zh_permission` (`id`, `name`, `controller`, `action`, `pid`, `icon_class`, `create_time`, `isshow`) VALUES (78, '附加数据', 'std-extra', 'all', 44, '', 14, 1);




