CREATE TABLE `zh_notice` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` int(11) NOT NULL COMMENT '推送的类型',
  `uid` int(11) NOT NULL COMMENT '接收者id',
  `status` int(11) NOT NULL COMMENT '状态',
  `is_read` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已读，0：未读，1：已读',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `pid` int(11) NOT NULL COMMENT '项目id',
  `content` text COLLATE utf8_unicode_ci NOT NULL COMMENT '推送必要的查询字段，如 ''{tid, mid}''',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='关注推送表';
SELECT * FROM calculation.zh_notice;

-- ----------------------------
-- 以上于2020-7-29 18:00 因更新至prod，尚未更新uat，如需增加sql，请一定在其后添加
-- ----------------------------

ALTER TABLE `zh_ledger`
ADD COLUMN `gxby_status`  tinyint(4) NULL DEFAULT -1 COMMENT '工序报验-状态' AFTER `qtcl_expr`,
ADD COLUMN `dagl_status`  tinyint(4) NULL DEFAULT -1 COMMENT '档案管理-状态' AFTER `gxby_status`;

ALTER TABLE `zh_revise_bills`
ADD COLUMN `gxby_status`  tinyint(4) NULL DEFAULT -1 COMMENT '工序报验状态' AFTER `sjcl_expr`,
ADD COLUMN `dagl_status`  tinyint(4) NULL DEFAULT -1 COMMENT '档案管理状态' AFTER `gxby_status`;

ALTER TABLE `zh_pos`
ADD COLUMN `gxby_status`  tinyint(4) NULL DEFAULT -1 COMMENT '工序报验-状态' AFTER `real_qty`,
ADD COLUMN `dagl_status`  tinyint(4) NULL DEFAULT -1 COMMENT '档案管理-状态' AFTER `gxby_status`;

ALTER TABLE `zh_revise_pos`
ADD COLUMN `gxby_status`  tinyint(4) NULL DEFAULT -1 COMMENT '工序报验-状态' AFTER `real_qty`,
ADD COLUMN `dagl_status`  tinyint(4) NULL DEFAULT -1 COMMENT '档案管理-状态' AFTER `gxby_status`;

ALTER TABLE `zh_tender`
ADD COLUMN `uuid`  varchar(50) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT NULL COMMENT 'uuid' AFTER `deal_tp`;

CREATE TABLE `zh_s2b_log` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `pid` int(11) NOT NULL COMMENT '项目id',
  `tid` int(11) NOT NULL COMMENT '标段id',
  `url` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '请求url',
  `post_data` text CHARACTER SET utf8 COMMENT '请求数据',
  `post_data_file` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '请求数据文件(部分请求可能数据量比较大，以文件形式存储)',
  `result_data` text COLLATE utf8_unicode_ci,
  `result_data_file` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '结果数据文件(部分请求结果可能数据量比较大，以文件形式存储)',
  `post_time` datetime DEFAULT NULL COMMENT '请求时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE `zh_advance_pay` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL COMMENT '创建者id',
  `times` int(11) DEFAULT '1' COMMENT '审批次数',
  `status` int(11) DEFAULT NULL COMMENT '审核状态',
  `tid` int(11) NOT NULL COMMENT '标段id',
  `order` int(11) DEFAULT NULL COMMENT '期数索引',
  `type` int(1) NOT NULL DEFAULT '0' COMMENT '预付款类型，0为开工预付款，1为材料预付款',
  `pay_ratio` decimal(5,2) DEFAULT NULL COMMENT '支付比例',
  `cur_amount` decimal(24,8) DEFAULT NULL COMMENT '本期金额',
  `prev_amount` decimal(24,8) DEFAULT NULL COMMENT '截止上期金额',
  `prev_total_amount` decimal(24,8) DEFAULT NULL COMMENT '截止本期金额',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `remark` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=257 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='预付款记录';

CREATE TABLE `zh_advance_audit` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vid` int(11) NOT NULL COMMENT '预付款记录id',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '预付款类型，0为开工预付款，1为材料预付款',
  `times` tinyint(4) DEFAULT NULL COMMENT '审批次数',
  `order` tinyint(4) DEFAULT NULL COMMENT '审核顺序',
  `audit_id` int(11) DEFAULT NULL COMMENT '审核人id',
  `status` tinyint(1) DEFAULT NULL COMMENT '审核状态',
  `create_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `opinion` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '审核意见',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='预付款审核表';

CREATE TABLE `zh_advance_file` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vid` int(11) NOT NULL COMMENT '预付款记录id',
  `uid` int(11) NOT NULL COMMENT '上传者id',
  `create_time` datetime NOT NULL COMMENT '上传时间',
  `filepath` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '附件路径',
  `filesize` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '附件大小',
  `filename` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '附件名字',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='预付款附件';


