INSERT INTO `calculation`.`zh_permission` (`id`, `name`, `controller`, `action`, `pid`, `icon_class`, `create_time`, `isshow`) VALUES ('66', '合同支付', 'project', 'dealpay', '38', '', NULL, '1');

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for zh_stage_jgcl
-- ----------------------------
DROP TABLE IF EXISTS `zh_stage_jgcl`;
CREATE TABLE `zh_stage_jgcl` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `uuid` varchar(50) CHARACTER SET ascii NOT NULL COMMENT '材料id(uuid)',
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `unit` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '单位',
  `unit_price` decimal(24,8) DEFAULT NULL COMMENT '单价',
  `arrive_qty` decimal(24,8) DEFAULT NULL COMMENT '本期 - 到场 - 数量',
  `arrive_tp` decimal(24,8) DEFAULT NULL COMMENT '本期 - 到场 - 金额',
  `deduct_qty` decimal(24,8) DEFAULT NULL COMMENT '本期 - 扣回 - 数量',
  `deduct_tp` decimal(24,8) DEFAULT NULL COMMENT '本期 - 扣回 - 金额',
  `source` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '材料来源',
  `bills_code` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '单据号',
  `check_code` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '检验单编号',
  `memo` text CHARACTER SET utf8 COMMENT '备注',
  `add_uid` int(11) NOT NULL COMMENT '新增人id',
  `add_sid` int(11) NOT NULL COMMENT '新增期id',
  `sid` int(11) NOT NULL COMMENT '所属期id',
  `shistory` text COLLATE utf8_unicode_ci COMMENT '所属期-第几轮',
  `order` int(11) NOT NULL COMMENT '排序字段',
  `pre_used` tinyint(1) DEFAULT NULL COMMENT '是否计量过',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=132 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Table structure for zh_stage_bonus
-- ----------------------------
DROP TABLE IF EXISTS `zh_stage_bonus`;
CREATE TABLE `zh_stage_bonus` (
  `id` varchar(50) CHARACTER SET ascii COLLATE ascii_bin NOT NULL COMMENT '主键id（uuid）',
  `tid` int(11) NOT NULL COMMENT '标段id',
  `sid` int(11) NOT NULL COMMENT '期id',
  `sorder` tinyint(4) NOT NULL COMMENT '第几期',
  `uid` int(11) NOT NULL COMMENT '新增人',
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '名称',
  `tp` decimal(24,8) DEFAULT NULL COMMENT '金额',
  `code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `proof` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '依据材料证明',
  `create_time` datetime(4) DEFAULT NULL COMMENT '创建时间',
  `real_time` datetime(4) DEFAULT NULL COMMENT '实际时间-用户可修改',
  `memo` text CHARACTER SET utf8 COMMENT '备注',
  `shistory` text CHARACTER SET utf8 COMMENT '历史记录',
  `order` int(4) DEFAULT NULL COMMENT '排序字段',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Table structure for zh_stage_other
-- ----------------------------
DROP TABLE IF EXISTS `zh_stage_other`;
CREATE TABLE `zh_stage_other` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `uuid` varchar(50) CHARACTER SET ascii NOT NULL COMMENT 'uuid',
  `tid` int(11) NOT NULL COMMENT '标段id',
  `sid` int(11) NOT NULL COMMENT '所属期id',
  `sorder` tinyint(4) NOT NULL COMMENT '所属第几期',
  `add_sid` int(11) NOT NULL COMMENT '新增期',
  `add_uid` int(11) NOT NULL COMMENT '新增人',
  `add_time` datetime(4) NOT NULL COMMENT '新建时间',
  `name` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '名称',
  `total_price` decimal(24,8) DEFAULT NULL COMMENT '金额',
  `tp` decimal(24,8) DEFAULT NULL COMMENT '本期 - 金额',
  `real_time` datetime(4) DEFAULT NULL COMMENT '时间',
  `memo` text CHARACTER SET utf8 COMMENT '备注',
  `order` int(11) DEFAULT NULL COMMENT '排序',
  `shistory` text COLLATE utf8_unicode_ci COMMENT '本期记录',
  `pre_used` tinyint(1) DEFAULT NULL COMMENT '是否往期已用',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Table structure for zh_rpt_custom_define
-- ----------------------------
DROP TABLE IF EXISTS `zh_rpt_custom_define`;
CREATE TABLE `zh_rpt_custom_define` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tid` int(11) NOT NULL COMMENT '标段id',
  `sid` int(11) NOT NULL COMMENT '期id',
  `rid` int(11) NOT NULL COMMENT '报表id',
  `audit_select` text COLLATE utf8_unicode_ci COMMENT '用户定制信息',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;