ALTER TABLE `zh_tender_info` ADD `pay_account` VARCHAR(5000) NULL DEFAULT NULL COMMENT '付款账号' AFTER `chapter`;

ALTER TABLE `zh_stage_bonus`
ADD COLUMN `b_type`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '类型' AFTER `name`;

ALTER TABLE `zh_stage_other`
ADD COLUMN `o_type`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '类型' AFTER `name`;


UPDATE zh_rpt_customize_cfg
SET cfg_content = '{"fonts":[{"ID":"ReportTitle_Main","Name":"宋体","FontBold":"T","FontHeight":32,"FontItalic":"F","CfgDispName":"表标题","FontUnderline":"F"},{"ID":"Column","Name":"宋体","FontBold":"F","FontHeight":12,"FontItalic":"F","CfgDispName":"列标题","FontUnderline":"F"},{"ID":"Content","Name":"宋体","FontBold":"F","FontHeight":12,"FontItalic":"F","CfgDispName":"正文内容","FontUnderline":"F"},{"ID":"Total","Name":"宋体","FontBold":"F","FontHeight":12,"FontItalic":"F","CfgDispName":"合计","FontUnderline":"F"},{"ID":"Header","Name":"宋体","FontBold":"F","FontHeight":12,"FontItalic":"F","CfgDispName":"表眉/表脚","FontUnderline":"F"}],"margins":{"Top":12,"Left":15,"Right":15,"Bottom":15},"fillZero":false,"isNarrow":false,"borderThick":2,"showVerticalLine":true}'
WHERE id = 1
;

ALTER TABLE `zh_material_bills_history` ADD `expr` VARCHAR(1000) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '表达式' AFTER `quantity`, ADD `msg_tp` DECIMAL(30,8) NULL COMMENT '本期信息价单价' AFTER `expr`, ADD `msg_times` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '本期信息价时间' AFTER `msg_tp`, ADD `msg_spread` DECIMAL(30,8) NULL COMMENT '本期信息价价差' AFTER `msg_times`, ADD `m_up_risk` TINYINT(3) NULL COMMENT '本期材料调差上涨风险幅度 ' AFTER `msg_spread`, ADD `m_down_risk` TINYINT(3) NULL COMMENT '本期材料调差下跌风险幅度' AFTER `m_up_risk`, ADD `m_spread` DECIMAL(30,8) NULL COMMENT '本期材料调差有效价差' AFTER `m_down_risk`;

ALTER TABLE `zh_material_bills` ADD `m_tp` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '本期金额' AFTER `m_spread`;

ALTER TABLE `zh_material_bills_history` ADD `m_tp` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '本期金额' AFTER `m_spread`;

UPDATE `zh_material_bills` SET `m_tp`=round(`quantity`*`m_spread`,2) WHERE `quantity` is not null and `m_spread` is not null;

UPDATE `zh_material_bills_history` SET `m_tp`=round(`quantity`*`m_spread`,2) WHERE `quantity` is not null and `m_spread` is not null;

--如果线上有数据请更新同步bills表部分数据到bills_history里
UPDATE `zh_material_bills_history` a,`zh_material_bills` b SET a.`expr`=b.`expr`,a.`msg_tp`=b.`msg_tp`,a.`msg_times`=b.`msg_times`,a.`msg_spread`=b.`msg_spread`,a.`m_up_risk`=b.`m_up_risk`,a.`m_down_risk`=b.`m_down_risk`,a.`m_spread`=b.`m_spread` WHERE a.mb_id = b.id;

ALTER TABLE `zh_s2b_log`
MODIFY COLUMN `sync_result`  text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '同步结果' AFTER `sync_time`;

ALTER TABLE `zh_rpt_tpl`
ADD COLUMN `rpt_c_type`  tinyint(1) NOT NULL DEFAULT 0 COMMENT '报表，交互类型' AFTER `rpt_type`;

ALTER TABLE `zh_rpt_tpl`
ADD COLUMN `cid`  int(11) NOT NULL DEFAULT -1 COMMENT '所属报表组' AFTER `rpt_type`;

ALTER TABLE `zh_rpt_tpl`
ADD COLUMN `rpt_d_type`  tinyint(1) NOT NULL DEFAULT 0 COMMENT '报表，数据类型' AFTER `rpt_c_type`;

ALTER TABLE `zh_stage_bonus`
ADD COLUMN `proof_file`  text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '材料依据证明，文件' AFTER `proof`;

-- 2020-05-11 更新uat
