
DROP TABLE IF EXISTS `data_acquisition_time`;

CREATE TABLE `data_acquisition_time` (
  `TABLE_NAME` varchar(50) NOT NULL COMMENT '表名',
  `TABLE_COMMENT` varchar(50) DEFAULT NULL COMMENT '表信息',
  `month` varchar(50) DEFAULT NULL COMMENT '月份',
  `type` varchar(50) DEFAULT NULL COMMENT '类型:按年/按月/按季度',
  PRIMARY KEY (`TABLE_NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='数据采集时间表';



DROP TABLE IF EXISTS `data_job`;

CREATE TABLE `data_job` (
  `ID` varchar(50) NOT NULL COMMENT 'ID',
  `TABLE_NAME` varchar(50) NOT NULL COMMENT '表名',
  `TABLE_COMMENT` varchar(50) DEFAULT NULL COMMENT '表注释',
  `CREATE_TIME` datetime NOT NULL COMMENT '任务创建时间',
  `IS_JOB_SEND` varchar(10) NOT NULL COMMENT '下发状态',
  `JOB_SEND_TIME` datetime DEFAULT NULL COMMENT '任务下发时间',
  `IS_JOB_UPLOAD` varchar(10) NOT NULL COMMENT '上报状态',
  `JOB_UPLOAD_TIME` datetime DEFAULT NULL COMMENT '最后上传时间',
  `IS_JOB_CHECK` varchar(10) NOT NULL COMMENT '审核状态',
  `JOB_CHECK_TIME` datetime DEFAULT NULL COMMENT '审核时间',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='各部门任务表';


DROP TABLE IF EXISTS `idec_dkxx`;

CREATE TABLE `idec_dkxx` (
  `ID` int(255) DEFAULT NULL,
  `DKSYH` varchar(255) DEFAULT NULL,
  `TDZL` varchar(255) DEFAULT NULL,
  `XZQDM` varchar(255) DEFAULT NULL,
  `JDXZQDM` varchar(255) DEFAULT NULL,
  `MLDM` varchar(255) DEFAULT NULL,
  `KFQMC` varchar(255) DEFAULT NULL,
  `TDSYQR` varchar(255) DEFAULT NULL,
  `YDDWMC` varchar(255) DEFAULT NULL,
  `QSXZ` varchar(255) DEFAULT NULL,
  `SYQLX` varchar(255) DEFAULT NULL,
  `PZYT` varchar(255) DEFAULT NULL,
  `SJYT` varchar(255) DEFAULT NULL,
  `GHYT` varchar(255) DEFAULT NULL,
  `TJYT` varchar(255) DEFAULT NULL,
  `TDMJ` varchar(255) DEFAULT NULL,
  `PZMJ` varchar(255) DEFAULT NULL,
  `DJMJ` varchar(255) DEFAULT NULL,
  `YJCMJ` varchar(255) DEFAULT NULL,
  `LSYLWTSJMJ` varchar(255) DEFAULT NULL,
  `JSZK` varchar(255) DEFAULT NULL,
  `JZMJ` varchar(255) DEFAULT NULL,
  `JZJDMJ` varchar(255) DEFAULT NULL,
  `SFYDDQ` varchar(255) DEFAULT NULL,
  `DJXSSR` varchar(255) DEFAULT NULL,
  `DJYZSF` varchar(255) DEFAULT NULL,
  `DJCYRY` varchar(255) DEFAULT NULL,
  `YDLX` varchar(255) DEFAULT NULL,
  `YDXWFSSJ` varchar(255) DEFAULT NULL,
  `TDYTQ` varchar(255) DEFAULT NULL,
  `JSYDGZQ` varchar(255) DEFAULT NULL,
  `JCSSPTSP` varchar(255) DEFAULT NULL,
  `BZ` varchar(255) DEFAULT NULL,
  `NF` varchar(255) DEFAULT NULL,
  `SZX` varchar(255) DEFAULT NULL,
  `SZXZ` varchar(255) DEFAULT NULL,
  `SZC` varchar(255) DEFAULT NULL,
  `QXXZQDM` varchar(255) DEFAULT NULL,
  `QPBH` varchar(255) DEFAULT NULL,
  `DJGDZCTZ` varchar(255) DEFAULT NULL,
  `DJCZ` varchar(255) DEFAULT NULL,
  `DJSJSF` varchar(255) DEFAULT NULL,
  `DWYDL` varchar(255) DEFAULT NULL,
  `DWYSL` varchar(255) DEFAULT NULL,
  `DWYRQYL` varchar(255) DEFAULT NULL,
  `DWPFL` varchar(255) DEFAULT NULL,
  `GXLX` varchar(255) DEFAULT NULL,
  `BGYY` varchar(255) DEFAULT NULL,
  `RJL` varchar(255) DEFAULT NULL,
  `JZXS` varchar(255) DEFAULT NULL,
  `LDL` varchar(255) DEFAULT NULL,
  `XZBGBL` varchar(255) DEFAULT NULL,
  `SDQYDM` varchar(255) DEFAULT NULL,
  `FZBUDM` varchar(255) DEFAULT NULL,
  `GNQDM` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='地块信息';


DROP TABLE IF EXISTS `idec_gy`;

CREATE TABLE `idec_gy` (
  `ID` varchar(255) DEFAULT NULL,
  `DKSYH` varchar(255) DEFAULT NULL,
  `YDDWSYH` varchar(255) DEFAULT NULL,
  `FTTDMJ` varchar(255) DEFAULT NULL,
  `FTBL` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业地块关联表';

DROP TABLE IF EXISTS `idec_hyxfb`;

CREATE TABLE `idec_hyxfb` (
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(100) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(50) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(50) DEFAULT NULL COMMENT '街道乡镇名称',
  `HYDM` varchar(10) DEFAULT NULL COMMENT '行业代码',
  `ZYYWHD` varchar(255) DEFAULT NULL COMMENT '主要业务活动',
  `SFGMYSQY` varchar(10) DEFAULT NULL COMMENT '是否规模以上企业',
  `QYGM` varchar(50) DEFAULT NULL COMMENT '企业规模',
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `JYXX` varchar(100) DEFAULT NULL COMMENT '检验信息',
  PRIMARY KEY (`TYSHXYDM`,`YF`,`NF`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='行业细分表';


DROP TABLE IF EXISTS `idec_qycxnsxx`;

CREATE TABLE `idec_qycxnsxx` (
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(100) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(50) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(50) DEFAULT NULL COMMENT '街道乡镇名称',
  `HYDM` varchar(10) DEFAULT NULL COMMENT '行业代码',
  `CXNSDJ` varchar(50) DEFAULT NULL COMMENT '诚信纳税等级',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(50) DEFAULT NULL COMMENT '检验信息',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业诚信纳税信息';


DROP TABLE IF EXISTS `idec_qyhjxx`;

CREATE TABLE `idec_qyhjxx` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(10) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(50) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(50) DEFAULT NULL COMMENT '街道乡镇名称',
  `YBHBSG` int(11) DEFAULT NULL COMMENT '一般环保事故',
  `JDHBSG` int(11) DEFAULT NULL COMMENT '较大环保事故',
  `ZDHBSG` int(11) DEFAULT NULL COMMENT '重大环保事故',
  `HBCF` int(11) DEFAULT NULL COMMENT '环保惩罚',
  `CFJE` double DEFAULT NULL COMMENT '处罚金额',
  `HBXYPJDJ` varchar(20) DEFAULT NULL COMMENT '环保信用评价等级',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业环境信息';

/*Data for the table `idec_qyhjxx` */

/*Table structure for table `idec_qykjxx` */

DROP TABLE IF EXISTS `idec_qykjxx`;

CREATE TABLE `idec_qykjxx` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(50) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `SFGXJSQY` varchar(10) DEFAULT NULL COMMENT '是否高新技术企业',
  `JSNFMZLS` varchar(20) DEFAULT NULL COMMENT '近3年发明专利数',
  `YFJG` varchar(50) DEFAULT NULL COMMENT '研发机构',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业科技信息';

/*Data for the table `idec_qykjxx` */

/*Table structure for table `idec_qykpgssj` */

DROP TABLE IF EXISTS `idec_qykpgssj`;

CREATE TABLE `idec_qykpgssj` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(10) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `HYDM` varchar(10) DEFAULT NULL COMMENT '行业代码',
  `SBXS` decimal(10,2) DEFAULT NULL COMMENT '申报销售',
  `SJGS` decimal(10,2) DEFAULT NULL COMMENT '上缴国税',
  `CKTS` decimal(10,2) DEFAULT NULL COMMENT '出口退税',
  `SBDK` decimal(10,2) DEFAULT NULL COMMENT '设备抵扣',
  `YFFY` decimal(10,2) DEFAULT NULL COMMENT '研发费用',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业开票及国税信息';

DROP TABLE IF EXISTS `idec_qykpgssj_temp`;

CREATE TABLE `idec_qykpgssj_temp` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(10) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `HYDM` varchar(10) DEFAULT NULL COMMENT '行业代码',
  `SBXS` decimal(10,2) DEFAULT NULL COMMENT '申报销售',
  `SJGS` decimal(10,2) DEFAULT NULL COMMENT '上缴国税',
  `CKTS` decimal(10,2) DEFAULT NULL COMMENT '出口退税',
  `SBDK` decimal(10,2) DEFAULT NULL COMMENT '设备抵扣',
  `YFFY` decimal(10,2) DEFAULT NULL COMMENT '研发费用',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业开票及国税信息';


DROP TABLE IF EXISTS `idec_qynhsj`;

CREATE TABLE `idec_qynhsj` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(10) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `NYZL` decimal(10,2) DEFAULT NULL COMMENT '能源总量',
  `YML` decimal(10,2) DEFAULT NULL COMMENT '原煤量',
  `CYL` decimal(10,2) DEFAULT NULL COMMENT '柴油量',
  `QYL` decimal(10,2) DEFAULT NULL COMMENT '汽油量',
  `RLL` decimal(10,2) DEFAULT NULL COMMENT '热力量',
  `DLL` decimal(10,2) DEFAULT NULL COMMENT '电力量',
  `TRQL` decimal(10,2) DEFAULT NULL COMMENT '天然气量',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业能耗数据';

/*Data for the table `idec_qynhsj` */

/*Table structure for table `idec_qyppxx` */

DROP TABLE IF EXISTS `idec_qyppxx`;

CREATE TABLE `idec_qyppxx` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(50) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(30) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(30) DEFAULT NULL COMMENT '街道乡镇名称',
  `SB` varchar(20) DEFAULT NULL COMMENT '商标',
  `ZDBZ` varchar(20) DEFAULT NULL COMMENT '制定标准',
  `ZHTSXY` varchar(20) DEFAULT NULL COMMENT '重合同守信用',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业品牌信息';


DROP TABLE IF EXISTS `idec_qypwsj`;

CREATE TABLE `idec_qypwsj` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(50) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `HJRL` decimal(10,2) DEFAULT NULL COMMENT '环境容量',
  `WRWZDL` decimal(10,2) DEFAULT NULL COMMENT '污染物总当量',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业排污数据';

/*Data for the table `idec_qypwsj` */

/*Table structure for table `idec_qysbjnxx` */

DROP TABLE IF EXISTS `idec_qysbjnxx`;

CREATE TABLE `idec_qysbjnxx` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(50) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `CBZGS` decimal(10,2) DEFAULT NULL COMMENT '参保职工数',
  `LDHTQDS` decimal(10,2) DEFAULT NULL COMMENT '劳动合同签订数',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业社保缴纳信息';

/*Data for the table `idec_qysbjnxx` */

/*Table structure for table `idec_qyscaqxx` */

DROP TABLE IF EXISTS `idec_qyscaqxx`;

CREATE TABLE `idec_qyscaqxx` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(50) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信息代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `YBANSG` int(10) DEFAULT NULL COMMENT '一般安全事故',
  `JDANSG` int(10) DEFAULT NULL COMMENT '较大安全事故',
  `ZDANSG` int(10) DEFAULT NULL COMMENT '重大安全事故',
  `AQSCBZH` varchar(20) DEFAULT NULL COMMENT '安全生产标准化',
  `XZCF` varchar(20) DEFAULT NULL COMMENT '行政处罚',
  `CFJE` decimal(10,2) DEFAULT NULL COMMENT '处罚金额',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业生产安全信息';

/*Data for the table `idec_qyscaqxx` */

/*Table structure for table `idec_qysjdssj` */

DROP TABLE IF EXISTS `idec_qysjdssj`;

CREATE TABLE `idec_qysjdssj` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(50) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `SJDS` decimal(10,2) DEFAULT NULL COMMENT '上缴地税',
  `GRSDS` decimal(10,2) DEFAULT NULL COMMENT '个人所得税',
  `YFFY` decimal(10,2) DEFAULT NULL COMMENT '研发费用',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业上缴地税数据';

/*Data for the table `idec_qysjdssj` */

/*Table structure for table `idec_qyxfaqxx` */

DROP TABLE IF EXISTS `idec_qyxfaqxx`;

CREATE TABLE `idec_qyxfaqxx` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(50) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `YBXFSG` int(255) DEFAULT NULL COMMENT '一般消防事故',
  `JDXFSG` int(255) DEFAULT NULL COMMENT '较大消防事故',
  `ZDXFSG` int(255) DEFAULT NULL COMMENT '重大消防事故',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业消防安全信息';

/*Data for the table `idec_qyxfaqxx` */

/*Table structure for table `idec_qyydlsj` */

DROP TABLE IF EXISTS `idec_qyydlsj`;

CREATE TABLE `idec_qyydlsj` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(255) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `YDL` double(255,0) DEFAULT NULL COMMENT '用电量',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业用电数据';

/*Data for the table `idec_qyydlsj` */

/*Table structure for table `idec_qyydsj` */

DROP TABLE IF EXISTS `idec_qyydsj`;

CREATE TABLE `idec_qyydsj` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(50) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `TDZL` varchar(255) DEFAULT NULL COMMENT '土地坐落',
  `ZDMJ` double(255,0) DEFAULT NULL COMMENT '占地面积',
  `CZMJ` double(255,0) DEFAULT NULL COMMENT '持证面积',
  `QSXZ` varchar(20) DEFAULT NULL COMMENT '权属性质',
  `SYQLX` varchar(20) DEFAULT NULL COMMENT '使用权类型',
  `HTBH` varchar(20) DEFAULT NULL COMMENT '合同编号',
  `PZYT` varchar(20) DEFAULT NULL COMMENT '批准用途',
  `DLKJ` varchar(255) DEFAULT NULL COMMENT '地理空间',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业用地数据';

DROP TABLE IF EXISTS `idec_qyydsj_temp`;

CREATE TABLE `idec_qyydsj_temp` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(50) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `TDZL` varchar(255) DEFAULT NULL COMMENT '土地坐落',
  `ZDMJ` double(255,0) DEFAULT NULL COMMENT '占地面积',
  `CZMJ` double(255,0) DEFAULT NULL COMMENT '持证面积',
  `QSXZ` varchar(20) DEFAULT NULL COMMENT '权属性质',
  `SYQLX` varchar(20) DEFAULT NULL COMMENT '使用权类型',
  `HTBH` varchar(20) DEFAULT NULL COMMENT '合同编号',
  `PZYT` varchar(20) DEFAULT NULL COMMENT '批准用途',
  `DLKJ` varchar(255) DEFAULT NULL COMMENT '地理空间',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业用地数据';



DROP TABLE IF EXISTS `idec_qyyqlsj`;

CREATE TABLE `idec_qyyqlsj` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(50) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `RQ` double(255,0) DEFAULT NULL COMMENT '用气量',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业用气数据';


/*Table structure for table `idec_qyyslsj` */

DROP TABLE IF EXISTS `idec_qyyslsj`;

CREATE TABLE `idec_qyyslsj` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(255) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `YSZL` double(255,0) DEFAULT NULL COMMENT '用水总量',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业用水数据';



DROP TABLE IF EXISTS `idec_qyzljxx`;

CREATE TABLE `idec_qyzljxx` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(255) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `ZLJ` varchar(20) DEFAULT NULL COMMENT '质量奖',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业质量奖信息';


DROP TABLE IF EXISTS `idec_sjxzb`;

CREATE TABLE `idec_sjxzb` (
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `JYXX` varchar(255) DEFAULT NULL COMMENT '检验信息',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `GS` decimal(10,2) DEFAULT NULL COMMENT '国税',
  `DS` decimal(10,2) DEFAULT NULL COMMENT '地税',
  `KPXS` decimal(10,2) DEFAULT NULL COMMENT '开票销售',
  `ZDMJ` double(255,0) DEFAULT NULL COMMENT '占地面积',
  `ZDH` double(255,0) DEFAULT NULL COMMENT '总电耗',
  `ZNH` double(255,0) DEFAULT NULL COMMENT '总能耗',
  `WRWPFDL` double(255,0) DEFAULT NULL COMMENT '污染物排放当量',
  `GSYFFY` decimal(10,2) DEFAULT NULL COMMENT '国税研发费用',
  `DSYFFY` decimal(10,2) DEFAULT NULL COMMENT '地税研发费用',
  PRIMARY KEY (`NF`,`YF`,`TYSHXYDM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业数据修正表';

/*Data for the table `idec_sjxzb` */

/*Table structure for table `idec_yddw_z` */

DROP TABLE IF EXISTS `idec_yddw_z`;

CREATE TABLE `idec_yddw_z` (
  `YDDWSYH` varchar(50) NOT NULL COMMENT '用地单位索引号',
  `NF` varchar(10) NOT NULL COMMENT '年份',
  `YF` varchar(10) NOT NULL COMMENT '月份',
  `TYSHXYDM` varchar(50) NOT NULL COMMENT '统一社会信用代码',
  `QYMC` varchar(50) DEFAULT NULL COMMENT '企业名称',
  `XZQMC` varchar(20) DEFAULT NULL COMMENT '行政区名称',
  `JDXZMC` varchar(20) DEFAULT NULL COMMENT '街道乡镇名称',
  `HYDM` varchar(10) DEFAULT NULL COMMENT '行业代码',
  `ZYYWHD` varchar(255) DEFAULT NULL COMMENT '主营业务活动',
  `SFGMYSQY` varchar(10) DEFAULT NULL COMMENT '是否规模以上企业',
  `QYGM` varchar(50) DEFAULT NULL COMMENT '企业规模',
  `JYBS` varchar(10) DEFAULT NULL COMMENT '检验标识',
  `BZ` varchar(255) DEFAULT NULL COMMENT '备注',
  `JYXX` varchar(100) DEFAULT NULL COMMENT '检验信息',
  `CXNSDJ` varchar(20) DEFAULT NULL COMMENT '诚信纳税等级',
  `YBHBSG` int(255) DEFAULT NULL COMMENT '一般环保事故',
  `JDHBSG` int(255) DEFAULT NULL COMMENT '较大环保事故',
  `ZDHBSG` int(255) DEFAULT NULL COMMENT '重大环保事故',
  `HBCF` varchar(255) DEFAULT NULL COMMENT '环保惩罚',
  `HBCFJE` decimal(10,2) DEFAULT NULL COMMENT '环保惩罚金额',
  `HBXYPJDJ` varchar(10) DEFAULT NULL COMMENT '环保信用评价等级',
  `SFGXJSQY` varchar(10) DEFAULT NULL COMMENT '是否高新技术企业',
  `JSNFMZLS` int(255) DEFAULT NULL COMMENT '近3年发明专利数',
  `YFJG` varchar(50) DEFAULT NULL COMMENT '研发机构',
  `SBXS` decimal(10,2) DEFAULT NULL COMMENT '申报销售',
  `SJGS` decimal(10,2) DEFAULT NULL COMMENT '上缴国税',
  `CKTS` decimal(10,2) DEFAULT NULL COMMENT '出口退税',
  `SBDK` decimal(10,2) DEFAULT NULL COMMENT '设备抵扣',
  `YFFY` decimal(10,2) DEFAULT NULL COMMENT '研发费用',
  `NYZL` decimal(10,2) DEFAULT NULL COMMENT '能源总量',
  `YML` decimal(10,2) DEFAULT NULL COMMENT '用煤量',
  `CYL` decimal(10,2) DEFAULT NULL COMMENT '柴油量',
  `QYL` decimal(10,2) DEFAULT NULL COMMENT '汽油量',
  `RLL` decimal(10,2) DEFAULT NULL COMMENT '热力量',
  `DLL` decimal(10,2) DEFAULT NULL COMMENT '电力量',
  `TRQL` decimal(10,2) DEFAULT NULL COMMENT '天然气量',
  `SB` varchar(255) DEFAULT NULL COMMENT '商标',
  `ZDBZ` varchar(255) DEFAULT NULL COMMENT '制定标准',
  `ZHTSXY` varchar(255) DEFAULT NULL COMMENT '重合同守信用',
  `HJRL` decimal(10,2) DEFAULT NULL COMMENT '环境容量',
  `WRWZDL` decimal(10,2) DEFAULT NULL COMMENT '污染物总当量',
  `YBANSG` int(255) DEFAULT NULL COMMENT '一般安全事故',
  `JDANSG` int(255) DEFAULT NULL COMMENT '较大安全事故',
  `ZDANSG` int(255) DEFAULT NULL COMMENT '重大安全事故',
  `AQSCBZH` varchar(255) DEFAULT NULL COMMENT '安全生产标准化',
  `XZCF` varchar(255) DEFAULT NULL COMMENT '行政处罚',
  `XZCFJE` decimal(10,2) DEFAULT NULL COMMENT '行政处罚金额',
  `SJDS` decimal(10,2) DEFAULT NULL COMMENT '上缴地税',
  `GRSDS` decimal(10,2) DEFAULT NULL COMMENT '个人所得税',
  `DSYFFY` decimal(10,2) DEFAULT NULL COMMENT '地税研发费用',
  `YBXFSG` int(255) DEFAULT NULL COMMENT '一般消防事故',
  `JDXFSG` int(255) DEFAULT NULL COMMENT '较大消防事故',
  `ZDXFSG` int(255) DEFAULT NULL COMMENT '重大消防事故',
  `TDZL` varchar(255) DEFAULT NULL COMMENT '土地坐落',
  `FTTDMJ` decimal(10,2) DEFAULT NULL COMMENT '分摊土地面积',
  `DJMJ` decimal(10,2) DEFAULT NULL COMMENT '登记面积',
  `QSXZ` varchar(255) DEFAULT NULL COMMENT '权属性质',
  `SYQLX` varchar(255) DEFAULT NULL COMMENT '使用权类型',
  `HTBH` varchar(255) DEFAULT NULL COMMENT '合同编号',
  `PZYT` varchar(255) DEFAULT NULL COMMENT '批准用途',
  `DLKJ` varchar(255) DEFAULT NULL COMMENT '地理空间',
  `YDL` decimal(10,2) DEFAULT NULL COMMENT '用电量',
  `RQ` decimal(10,2) DEFAULT NULL COMMENT '燃气',
  `YSZL` decimal(10,2) DEFAULT NULL COMMENT '用水总量',
  `ZLJ` varchar(255) DEFAULT NULL COMMENT '质量奖',
  `CBZGS` int(255) DEFAULT NULL COMMENT '参保职工数',
  `LDHTQDS` int(255) DEFAULT NULL COMMENT '劳动合同签订数',
  `JDXZDM` varchar(20) DEFAULT NULL COMMENT '街道乡镇代码',
  `XZQDM` varchar(20) DEFAULT NULL COMMENT '行政区代码',
  `SJSJ` decimal(10,2) DEFAULT NULL COMMENT '上缴税金',
  PRIMARY KEY (`TYSHXYDM`,`YF`,`NF`,`YDDWSYH`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='企业综合信息表';




CREATE OR REPLACE VIEW DC_VIEW_BUS_QYNDHZ_EVALUATE AS
(SELECT
  EVALUATE_QYJBXX.NF AS NF,
  EVALUATE_QYJBXX.TYSHXYDM AS TYSHXYDM,
  EVALUATE_QYJBXX.QYMC AS QYMC,
  EVALUATE_QYJBXX.XZQMC AS XZQMC,
  EVALUATE_QYJBXX.JDXZMC AS JDXZMC,
  EVALUATE_QYSCJG.JYCS AS JYCS,
  EVALUATE_QYSCJG.JYFW AS JYFW,
  EVALUATE_QYSCJG.SLSJ AS SLSJ,
  EVALUATE_QYSCJG.QYLX AS QYLX,
  EVALUATE_QYSCJG.WSGB AS WSGB,
  EVALUATE_QYSCJG.ZCZB AS ZCZB,
  EVALUATE_QYSCJG.FDDBR AS FDDBR,
  EVALUATE_QYSCJG.FDDBRZW AS FDDBRZW,
  EVALUATE_QYSCJG.LXR AS LXR,
  EVALUATE_QYSCJG.LXRDH AS LXRDH,
  EVALUATE_QYSCJG.SSGQ AS SSGQ,
  EVALUATE_QYSCJG.SB AS SB,
  EVALUATE_QYSCJG.ZDBZ AS ZDBZ,
  EVALUATE_QYSCJG.ZHTSXY AS ZHTSXY,
  EVALUATE_QYSCJG.ZLJ AS ZLJ,
  EVALUATE_QYSCJG.XZCF AS XZCF,
  EVALUATE_QYSCJG.JE AS JE,
  EVALUATE_QYSCJG.JSNFMZLS AS JSNFMZLS,
  EVALUATE_QYYDSJ.ZDMJ AS ZDMJ,
  EVALUATE_QYYDSJ.SFGMYSQY AS SFGMYSQY,
  EVALUATE_QYSBJNXX.CBZGS AS CBZGS,
  EVALUATE_QYFGXX.GCYJZZ AS GCYJZZ,
  EVALUATE_QYFGXX.SFCZSXXW AS SFCZSXXW,
  EVALUATE_QYJRXX.SFWZBSS AS SFWZBSS,
  EVALUATE_QYJRXX.SFWXSBGP AS SFWXSBGP,
  EVALUATE_QYJRXX.SFWSSGG AS SFWSSGG,
  EVALUATE_QYXFAQXX.YBXFSG AS YBXFSG,
  EVALUATE_QYXFAQXX.JDXFSG AS JDXFSG,
  EVALUATE_QYXFAQXX.ZDXFSG AS ZDXFSG,
  EVALUATE_QYXFAQXX.XZCF AS XFXZCF,
  EVALUATE_QYXFAQXX.JE AS XFCFJE,
  EVALUATE_QYSCAQXX.YBANSG AS YBANSG,
  EVALUATE_QYSCAQXX.JDANSG AS JDANSG,
  EVALUATE_QYSCAQXX.ZDANSG AS ZDANSG,
  EVALUATE_QYSCAQXX.AQSCBZH AS AQSCBZH,
  EVALUATE_QYSCAQXX.XZCF AS AQXZCF,
  EVALUATE_QYSCAQXX.CFJE AS AQCFJE,
  EVALUATE_QYZJTX.SBTR SBTR,
  EVALUATE_QYZJTX.ZJTX ZJTX,
  EVALUATE_QYZJTX.KJXJR KJXJR,
  EVALUATE_QYZJTX.JSZX JSZX,
  IFNULL(YDL, 0) AS YDL,
  IFNULL(SBXS, 0) AS SBXS,
  IFNULL(SJSJ, 0) AS SJSJ,
  IFNULL(CKTS, 0) AS CKTS,
  IFNULL(SBDK, 0) AS SBDK,
  EVALUATE_QYSSXX.CXNSDJ AS CXNSDJ,
  IFNULL(XJCZ, 0) AS XJCZ,
  IFNULL(XSSR, 0) AS XSSR,
  IFNULL(LRZE, 0) AS LRZE,
  IFNULL(NYZL, 0) AS NYZL,
  IFNULL(YML, 0) AS YML,
  IFNULL(CYL, 0) AS CYL,
  IFNULL(QYL, 0) AS QYL,
  IFNULL(RLL, 0) AS RLL,
  IFNULL(DLL, 0) AS DLL,
  IFNULL(TRQL, 0) AS TRQL,
  EVALUATE_QYTJSJ.HYDM AS HYDM,

  IFNULL(YFFY, 0) AS YFFY,
  EVALUATE_QYKJXX.SFGXJSQY AS SFGXJSQY,
  EVALUATE_QYKJXX.GCJSYJZX AS GCJSYJZX,
  EVALUATE_QYKJXX.SFWKJLJQY AS SFWKJLJQY,
  IFNULL(YBHBSG, 0) AS YBHBSG,
  IFNULL(JDHBSG, 0) AS JDHBSG,
  IFNULL(ZDHBSG, 0) AS ZDHBSG,
  IFNULL(HBXZCF, 0) AS HBXZCF,
  IFNULL(HBCFJE, 0) AS HBCFJE,
  IFNULL(WRWZDL, 0) AS WRWZDL,
  EVALUATE_QYHJXX.HBXYPJDJ AS HBXYPJDJ
FROM
  EVALUATE_QYJBXX
  LEFT JOIN EVALUATE_QYSCJG
    ON EVALUATE_QYJBXX.NF=EVALUATE_QYSCJG.NF
    AND EVALUATE_QYJBXX.TYSHXYDM=EVALUATE_QYSCJG.TYSHXYDM
  LEFT JOIN EVALUATE_QYXFAQXX
    ON EVALUATE_QYJBXX.NF = EVALUATE_QYXFAQXX.NF
    AND EVALUATE_QYJBXX.TYSHXYDM = EVALUATE_QYXFAQXX.TYSHXYDM
  LEFT JOIN EVALUATE_QYYDSJ
    ON EVALUATE_QYJBXX.NF = EVALUATE_QYYDSJ.NF
    AND EVALUATE_QYJBXX.TYSHXYDM = EVALUATE_QYYDSJ.TYSHXYDM
  LEFT JOIN EVALUATE_QYFGXX
    ON EVALUATE_QYJBXX.NF = EVALUATE_QYFGXX.NF
    AND EVALUATE_QYJBXX.TYSHXYDM = EVALUATE_QYFGXX.TYSHXYDM
  LEFT JOIN EVALUATE_QYSCAQXX
    ON EVALUATE_QYJBXX.NF = EVALUATE_QYSCAQXX.NF
    AND EVALUATE_QYJBXX.TYSHXYDM = EVALUATE_QYSCAQXX.TYSHXYDM
  LEFT JOIN EVALUATE_QYJRXX
    ON EVALUATE_QYJBXX.NF = EVALUATE_QYJRXX.NF
    AND EVALUATE_QYJBXX.TYSHXYDM = EVALUATE_QYJRXX.TYSHXYDM
  LEFT JOIN EVALUATE_QYSBJNXX
    ON EVALUATE_QYJBXX.NF = EVALUATE_QYSBJNXX.NF
    AND EVALUATE_QYJBXX.TYSHXYDM = EVALUATE_QYSBJNXX.TYSHXYDM

  LEFT JOIN EVALUATE_QYZJTX
    ON EVALUATE_QYJBXX.NF = EVALUATE_QYZJTX.NF
    AND EVALUATE_QYJBXX.TYSHXYDM = EVALUATE_QYZJTX.TYSHXYDM


  LEFT JOIN
    (SELECT
      NF,
      TYSHXYDM,
      SUM(EVALUATE_QYYDLSJ.YDL) AS YDL
    FROM
      EVALUATE_QYYDLSJ
    GROUP BY NF,
      TYSHXYDM) EVALUATE_QYYDLSJ
    ON EVALUATE_QYJBXX.NF = EVALUATE_QYYDLSJ.NF
    AND EVALUATE_QYJBXX.TYSHXYDM = EVALUATE_QYYDLSJ.TYSHXYDM
  LEFT JOIN
    (SELECT
      NF,
      TYSHXYDM,
      SUM(EVALUATE_QYSSXX.SBXS) AS SBXS,
      SUM(EVALUATE_QYSSXX.SJSJ) AS SJSJ,
      SUM(EVALUATE_QYSSXX.CKTS) AS CKTS,
      SUM(EVALUATE_QYSSXX.SBDK) AS SBDK,
      CXNSDJ
    FROM
      EVALUATE_QYSSXX
    GROUP BY NF,
      TYSHXYDM) EVALUATE_QYSSXX
    ON EVALUATE_QYJBXX.NF = EVALUATE_QYSSXX.NF
    AND EVALUATE_QYJBXX.TYSHXYDM = EVALUATE_QYSSXX.TYSHXYDM
  LEFT JOIN
    (SELECT
      NF,
      TYSHXYDM,
      SUM(EVALUATE_QYTJSJ.XJCZ) AS XJCZ,
      SUM(EVALUATE_QYTJSJ.XSSR) AS XSSR,
      SUM(EVALUATE_QYTJSJ.LRZE) AS LRZE,
      SUM(EVALUATE_QYTJSJ.NYZL) AS NYZL,
      SUM(EVALUATE_QYTJSJ.YML) AS YML,
      SUM(EVALUATE_QYTJSJ.CYL) AS CYL,
      SUM(EVALUATE_QYTJSJ.QYL) AS QYL,
      SUM(EVALUATE_QYTJSJ.RLL) AS RLL,
      SUM(EVALUATE_QYTJSJ.DLL) AS DLL,
      SUM(EVALUATE_QYTJSJ.TRQL) AS TRQL,
      HYDM
    FROM
      EVALUATE_QYTJSJ
    GROUP BY NF,
      TYSHXYDM) EVALUATE_QYTJSJ
    ON EVALUATE_QYJBXX.NF = EVALUATE_QYTJSJ.NF
    AND EVALUATE_QYJBXX.TYSHXYDM = EVALUATE_QYTJSJ.TYSHXYDM
  LEFT JOIN
    (SELECT
      NF,
      TYSHXYDM,
      SUM(EVALUATE_QYKJXX.YFFY) AS YFFY,
      SFGXJSQY,
      GCJSYJZX,
      SFWKJLJQY
    FROM
      EVALUATE_QYKJXX
    GROUP BY NF,
      TYSHXYDM) EVALUATE_QYKJXX
    ON EVALUATE_QYJBXX.NF = EVALUATE_QYKJXX.NF
    AND EVALUATE_QYJBXX.TYSHXYDM = EVALUATE_QYKJXX.TYSHXYDM
  LEFT JOIN
    (SELECT
      NF,
      TYSHXYDM,
      SUM(EVALUATE_QYHJXX.YBHBSG) AS YBHBSG,
      SUM(EVALUATE_QYHJXX.JDHBSG) AS JDHBSG,
      SUM(EVALUATE_QYHJXX.ZDHBSG) AS ZDHBSG,
      SUM(EVALUATE_QYHJXX.XZCF) AS HBXZCF,
      SUM(EVALUATE_QYHJXX.CFJE) AS HBCFJE,
      SUM(EVALUATE_QYHJXX.WRWZDL) AS WRWZDL,
      HBXYPJDJ
    FROM
      EVALUATE_QYHJXX
    GROUP BY NF,
      TYSHXYDM) EVALUATE_QYHJXX
    ON EVALUATE_QYJBXX.NF = EVALUATE_QYHJXX.NF
    AND EVALUATE_QYJBXX.TYSHXYDM = EVALUATE_QYHJXX.TYSHXYDM)



create table bus_qyndhz_evaluate as ( select * from dc_view_bus_qyndhz_evaluate )
