CREATE TABLE `zh_construction_attachment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tid` int(11) NOT NULL COMMENT '标段id',
  `log_id` int(11) NOT NULL COMMENT '日志id',
  `uid` int(11) NOT NULL COMMENT '上传者id',
  `filename` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件名称',
  `fileext` varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件后缀',
  `filesize` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件大小',
  `filepath` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件存储路径',
  `upload_time` datetime NOT NULL COMMENT '上传时间',
  `extra_upload` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否为审核通过后再次上传的文件，0为否',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci COMMENT='施工日志附件表';

CREATE TABLE `zh_construction_audit` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tid` int(11) NOT NULL COMMENT '标段id',
  `uid` int(11) NOT NULL COMMENT '用户id',
  `is_report` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否上报人',
  `in_time` datetime NOT NULL COMMENT '新增时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci COMMENT='施工日志管理人员表';

CREATE TABLE `zh_construction_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tid` int(11) NOT NULL COMMENT '标段id',
  `code` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '编号',
  `date_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '日期，用于code的编号生成',
  `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态',
  `type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '日志类型',
  `period` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '时间/周期',
  `report_uid` int(11) NOT NULL COMMENT '上报人id',
  `shenpi_uid` int(11) DEFAULT NULL COMMENT '签审人id',
  `log_json` json DEFAULT NULL COMMENT '日志内容',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `start_time` datetime DEFAULT NULL COMMENT '提交时间',
  `checked_time` datetime DEFAULT NULL COMMENT '审签时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci COMMENT='施工日志内容表';
