Commit 0b292f0b authored by 吴霞's avatar 吴霞

exportExcel

parent a1c543b3
Pipeline #82 failed with stages
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>download</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.5
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>download</groupId>
<artifactId>download</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!--mybatis核心包 -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.3.0</version>
</dependency>
<!--MySQL的JDBC驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.29</version>
</dependency>
<!--junit单元测试包 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- excel -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-excelant</artifactId>
<version>3.11-beta2</version>
</dependency>
<!--<dependency> -->
<!--<groupId>com.huawei.paas.cse</groupId> -->
<!--<artifactId>cse-solution-service-engine</artifactId> -->
<!--<exclusions> -->
<!--<exclusion> -->
<!--<groupId>org.slf4j</groupId> -->
<!--<artifactId>slf4j-log4j12</artifactId> -->
<!--</exclusion> -->
<!--</exclusions> -->
<!--</dependency> -->
<!--<dependency> -->
<!--<groupId>org.apache.servicecomb</groupId> -->
<!--<artifactId>spring-boot-starter-provider</artifactId> -->
<!--</dependency> -->
</dependencies>
<!--<dependencyManagement> -->
<!--<dependencies> -->
<!--<dependency> -->
<!--<groupId>org.apache.servicecomb</groupId> -->
<!--<artifactId>java-chassis-dependencies-springboot2</artifactId> -->
<!--<version>1.1.0.B018</version> -->
<!--<type>pom</type> -->
<!--<scope>import</scope> -->
<!--</dependency> -->
<!--<dependency> -->
<!--<groupId>com.huawei.paas.cse</groupId> -->
<!--<artifactId>cse-dependency</artifactId> -->
<!--<version>2.3.46</version> -->
<!--<type>pom</type> -->
<!--<scope>import</scope> -->
<!--</dependency> -->
<!--</dependencies> -->
<!--</dependencyManagement> -->
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
</build>
</project>
\ No newline at end of file
package com.sict.excel.bo;
public class AnalysisGraphicBO {
private String item;
private Integer number;
private String remark;
public String getItem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public String toString() {
return "AnalysisGraphic [item=" + item + ", number=" + number + ", remark=" + remark + "]";
}
}
package com.sict.excel.dto;
public class AnalysisGraphicDTO {
private Integer applyGastricCancerScreeningHosp;
private Integer passApplyHosp;
private Integer platAccountApplyHosp;
private Integer openAccountHosp;
public Integer getApplyGastricCancerScreeningHosp() {
return null;
}
public void setApplyGastricCancerScreeningHosp(Integer applyGastricCancerScreeningHosp) {
this.applyGastricCancerScreeningHosp = applyGastricCancerScreeningHosp;
}
public Integer getPassApplyHosp() {
return passApplyHosp;
}
public void setPassApplyHosp(Integer passApplyHosp) {
this.passApplyHosp = passApplyHosp;
}
public Integer getPlatAccountApplyHosp() {
return null;
}
public void setPlatAccountApplyHosp(Integer platAccountApplyHosp) {
this.platAccountApplyHosp = platAccountApplyHosp;
}
public Integer getOpenAccountHosp() {
return openAccountHosp;
}
public void setOpenAccountHosp(Integer openAccountHosp) {
this.openAccountHosp = openAccountHosp;
}
@Override
public String toString() {
return "AnalysisGraphicDTO [applyGastricCancerScreeningHosp=" + applyGastricCancerScreeningHosp
+ ", passApplyHosp=" + passApplyHosp + ", platAccountApplyHosp=" + platAccountApplyHosp
+ ", openAccountHosp=" + openAccountHosp + "]";
}
}
package com.sict.excel.dto;
public class AnalysisProvinceDTO {
private String province;
private String applyHosp;
private String openAccountHosp;
private String applyAccountHosp;
private String passApplyHosp;
private String platAccountApplyHosp;
private String provinceScreeningTotal;
private String earlyCancer;
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getApplyHosp() {
return null;
}
public void setApplyHosp(String applyHosp) {
this.applyHosp = applyHosp;
}
public String getOpenAccountHosp() {
return openAccountHosp;
}
public void setOpenAccountHosp(String openAccountHosp) {
this.openAccountHosp = openAccountHosp;
}
public String getApplyAccountHosp() {
return null;
}
public void setApplyAccountHosp(String applyAccountHosp) {
this.applyAccountHosp = applyAccountHosp;
}
public String getPassApplyHosp() {
return passApplyHosp;
}
public void setPassApplyHosp(String passApplyHosp) {
this.passApplyHosp = passApplyHosp;
}
public String getPlatAccountApplyHosp() {
return null;
}
public void setPlatAccountApplyHosp(String platAccountApplyHosp) {
this.platAccountApplyHosp = platAccountApplyHosp;
}
public String getProvinceScreeningTotal() {
return provinceScreeningTotal;
}
public void setProvinceScreeningTotal(String provinceScreeningTotal) {
this.provinceScreeningTotal = provinceScreeningTotal;
}
public String getEarlyCancer() {
return earlyCancer;
}
public void setEarlyCancer(String earlyCancer) {
this.earlyCancer = earlyCancer;
}
@Override
public String toString() {
return "AnalysisProvinceDTO [province=" + province + ", applyHosp=" + applyHosp + ", openAccountHosp="
+ openAccountHosp + ", applyAccountHosp=" + applyAccountHosp + ", passApplyHosp=" + passApplyHosp
+ ", platAccountApplyHosp=" + platAccountApplyHosp + ", provinceScreeningTotal="
+ provinceScreeningTotal + ", earlyCancer=" + earlyCancer + "]";
}
}
package com.sict.excel.dto;
public class DiagnosisDTO {
private Integer higeLevel;
private Integer highEsophageal;
private Integer highStomach;
private Integer lowLevel;
private Integer lowEsophageal;
private Integer lowStomach;
private Integer earlyGastricCancer;
private Integer advancedGastricCancer;
private Integer earlyEsophagealCancer;
private Integer advancedEsophagealCancer;
private Integer atrophicGastritis;
private Integer gastricUlcer;
private Integer gastricPolyps;
public Integer getHigeLevel() {
return higeLevel;
}
public void setHigeLevel(Integer higeLevel) {
this.higeLevel = higeLevel;
}
public Integer getHighEsophageal() {
return highEsophageal;
}
public void setHighEsophageal(Integer highEsophageal) {
this.highEsophageal = highEsophageal;
}
public Integer getHighStomach() {
return highStomach;
}
public void setHighStomach(Integer highStomach) {
this.highStomach = highStomach;
}
public Integer getLowLevel() {
return lowLevel;
}
public void setLowLevel(Integer lowLevel) {
this.lowLevel = lowLevel;
}
public Integer getLowEsophageal() {
return lowEsophageal;
}
public void setLowEsophageal(Integer lowEsophageal) {
this.lowEsophageal = lowEsophageal;
}
public Integer getLowStomach() {
return lowStomach;
}
public void setLowStomach(Integer lowStomach) {
this.lowStomach = lowStomach;
}
public Integer getEarlyGastricCancer() {
return earlyGastricCancer;
}
public void setEarlyGastricCancer(Integer earlyGastricCancer) {
this.earlyGastricCancer = earlyGastricCancer;
}
public Integer getAdvancedGastricCancer() {
return advancedGastricCancer;
}
public void setAdvancedGastricCancer(Integer advancedGastricCancer) {
this.advancedGastricCancer = advancedGastricCancer;
}
public Integer getEarlyEsophagealCancer() {
return earlyEsophagealCancer;
}
public void setEarlyEsophagealCancer(Integer earlyEsophagealCancer) {
this.earlyEsophagealCancer = earlyEsophagealCancer;
}
public Integer getAdvancedEsophagealCancer() {
return advancedEsophagealCancer;
}
public void setAdvancedEsophagealCancer(Integer advancedEsophagealCancer) {
this.advancedEsophagealCancer = advancedEsophagealCancer;
}
public Integer getAtrophicGastritis() {
return atrophicGastritis;
}
public void setAtrophicGastritis(Integer atrophicGastritis) {
this.atrophicGastritis = atrophicGastritis;
}
public Integer getGastricUlcer() {
return gastricUlcer;
}
public void setGastricUlcer(Integer gastricUlcer) {
this.gastricUlcer = gastricUlcer;
}
public Integer getGastricPolyps() {
return gastricPolyps;
}
public void setGastricPolyps(Integer gastricPolyps) {
this.gastricPolyps = gastricPolyps;
}
@Override
public String toString() {
return "DiagnosisDTO [higeLevel=" + higeLevel + ", highEsophageal=" + highEsophageal + ", highStomach="
+ highStomach + ", lowLevel=" + lowLevel + ", lowEsophageal=" + lowEsophageal + ", lowStomach="
+ lowStomach + ", earlyGastricCancer=" + earlyGastricCancer + ", advancedGastricCancer="
+ advancedGastricCancer + ", earlyEsophagealCancer=" + earlyEsophagealCancer
+ ", advancedEsophagealCancer=" + advancedEsophagealCancer + ", atrophicGastritis=" + atrophicGastritis
+ ", gastricUlcer=" + gastricUlcer + ", gastricPolyps=" + gastricPolyps + "]";
}
}
package com.sict.excel.dto;
public class EarlyCancerHospitalDTO {
private Integer id;
private String hospname;
private String province;
private Integer total;
private Integer highEsophagealNeoplasia;
private Integer earlyEsophagealCancer;
private Integer advancedEsophagealCancer;
private Integer highGastricNeoplasia;
private Integer earlyGastricCancer;
private Integer advancedGastricCancer;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getHospname() {
return hospname;
}
public void setHospname(String hospname) {
this.hospname = hospname;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
public Integer getHighEsophagealNeoplasia() {
if (highEsophagealNeoplasia==0) {
return null;
}
return highEsophagealNeoplasia;
}
public void setHighEsophagealNeoplasia(Integer highEsophagealNeoplasia) {
this.highEsophagealNeoplasia = highEsophagealNeoplasia;
}
public Integer getEarlyEsophagealCancer() {
if (earlyEsophagealCancer==0) {
return null;
}
return earlyEsophagealCancer;
}
public void setEarlyEsophagealCancer(Integer earlyEsophagealCancer) {
this.earlyEsophagealCancer = earlyEsophagealCancer;
}
public Integer getAdvancedEsophagealCancer() {
if (advancedEsophagealCancer==0) {
return null;
}
return advancedEsophagealCancer;
}
public void setAdvancedEsophagealCancer(Integer advancedEsophagealCancer) {
this.advancedEsophagealCancer = advancedEsophagealCancer;
}
public Integer getHighGastricNeoplasia() {
if (highGastricNeoplasia==0) {
return null;
}
return highGastricNeoplasia;
}
public void setHighGastricNeoplasia(Integer highGastricNeoplasia) {
this.highGastricNeoplasia = highGastricNeoplasia;
}
public Integer getEarlyGastricCancer() {
if (earlyGastricCancer==0) {
return null;
}
return earlyGastricCancer;
}
public void setEarlyGastricCancer(Integer earlyGastricCancer) {
this.earlyGastricCancer = earlyGastricCancer;
}
public Integer getAdvancedGastricCancer() {
if (advancedGastricCancer==0) {
return null;
}
return advancedGastricCancer;
}
public void setAdvancedGastricCancer(Integer advancedGastricCancer) {
this.advancedGastricCancer = advancedGastricCancer;
}
@Override
public String toString() {
return "EarlyCancerHospital [id=" + id + ", hospname=" + hospname + ", province=" + province + ", total="
+ total + ", highEsophagealNeoplasia=" + highEsophagealNeoplasia + ", earlyEsophagealCancer="
+ earlyEsophagealCancer + ", advancedEsophagealCancer=" + advancedEsophagealCancer
+ ", highGastricNeoplasia=" + highGastricNeoplasia + ", earlyGastricCancer=" + earlyGastricCancer
+ ", advancedGastricCancer=" + advancedGastricCancer + "]";
}
}
package com.sict.excel.dto;
public class EarlyCancerRankDTO {
private String province;
private Integer ECamount;
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public Integer getECamount() {
return ECamount;
}
public void setECamount(Integer eCamount) {
ECamount = eCamount;
}
@Override
public String toString() {
return "EarlyCancerRankDTO [province=" + province + ", ECamount=" + ECamount + "]";
}
}
package com.sict.excel.dto;
public class GastroscopeTestDTO {
private Integer actualGastroscope;
private Integer planGastroscope;
public Integer getActualGastroscope() {
return actualGastroscope;
}
public void setActualGastroscope(Integer actualGastroscope) {
this.actualGastroscope = actualGastroscope;
}
public Integer getPlanGastroscope() {
return planGastroscope;
}
public void setPlanGastroscope(Integer planGastroscope) {
this.planGastroscope = planGastroscope;
}
@Override
public String toString() {
return "GastroscopeTestDTO [actualGastroscope=" + actualGastroscope + ", planGastroscopel=" + planGastroscope
+ "]";
}
}
package com.sict.excel.dto;
public class HpPositiveDTO {
private Integer HpPositive;
public Integer getHpPositive() {
return HpPositive;
}
public void setHpPositive(Integer hpPositive) {
HpPositive = hpPositive;
}
@Override
public String toString() {
return "HpPositiveDTO [HpPositive=" + HpPositive + "]";
}
}
package com.sict.excel.dto;
public class RiskDTO {
private String grade;
private Integer total;
public String getGrade() {
return grade;
}
public void setGrade(String grade) {
this.grade = grade;
}
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
@Override
public String toString() {
return "RiskDTO [grade=" + grade + ", total=" + total + "]";
}
}
package com.sict.excel.dto;
public class ScreeningRankDTO {
private Integer id;
private String hospname;
private Integer actualserum;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getHospname() {
return hospname;
}
public void setHospname(String hospname) {
this.hospname = hospname;
}
public Integer getActualserum() {
return actualserum;
}
public void setActualserum(Integer actualserum) {
this.actualserum = actualserum;
}
@Override
public String toString() {
return "ScreeningRankDTO [id=" + id + ", hospname=" + hospname + ", actualserum="
+ actualserum + "]";
}
}
package com.sict.excel.dto;
public class ScreeningRankProvinceDTO {
private Integer id;
private String hospname;
private String province;
private Integer actualserum;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getHospname() {
return hospname;
}
public void setHospname(String hospname) {
this.hospname = hospname;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public Integer getActualserum() {
return actualserum;
}
public void setActualserum(Integer actualserum) {
this.actualserum = actualserum;
}
@Override
public String toString() {
return "ScreeningRankDTO [id=" + id + ", hospname=" + hospname + ", province=" + province + ", actualserum="
+ actualserum + "]";
}
}
package com.sict.excel.dto;
public class SerumStatisticsDTO {
/**
* 省份血检总人次
*/
private Integer serumTestTotal;
/**
* 省份HP抗体(IGG)检测阳性总人次
*/
private Integer iggPositive;
public Integer getSerumTestTotal() {
return serumTestTotal;
}
public void setSerumTestTotal(Integer serumTestTotal) {
this.serumTestTotal = serumTestTotal;
}
public Integer getIggPositive() {
return iggPositive;
}
public void setIggPositive(Integer iggPositive) {
this.iggPositive = iggPositive;
}
@Override
public String toString() {
return "SerumStatisticsDTO [serumTestTotal=" + serumTestTotal + ", iggPositive=" + iggPositive + "]";
}
}
package com.sict.excel.dto;
/**
* 例子JavaBean
* @author liuyazhuang
*
*/
public class Student {
private int id;
private String name;
private String sex;
public Student(int id, String name, String sex) {
this.id = id;
this.name = name;
this.sex = sex;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
}
\ No newline at end of file
package com.sict.excel.mapper;
import java.util.List;
import com.sict.excel.dto.AnalysisGraphicDTO;
import com.sict.excel.dto.AnalysisProvinceDTO;
import com.sict.excel.dto.DiagnosisDTO;
import com.sict.excel.dto.EarlyCancerHospitalDTO;
import com.sict.excel.dto.EarlyCancerRankDTO;
import com.sict.excel.dto.GastroscopeTestDTO;
import com.sict.excel.dto.HpPositiveDTO;
import com.sict.excel.dto.RiskDTO;
import com.sict.excel.dto.ScreeningRankDTO;
import com.sict.excel.dto.ScreeningRankProvinceDTO;
import com.sict.excel.dto.SerumStatisticsDTO;
public interface DownloadMapper{
/**
* 筛查监控-血清学检查
* @return
*/
SerumStatisticsDTO getSerumStatistics();
/***
* 筛查排名-按血检人数排名
* @return
*/
List<ScreeningRankProvinceDTO> getScreeningRankProvinceDTOs();
/**
* 省份早癌排名
* @return
*/
List<EarlyCancerRankDTO> getEarlyCancerRankDTOs();
/**
* 运营分析-医院早癌 胃癌数
*/
List<EarlyCancerHospitalDTO> geteaCancerHospitals();
/**
* 运营分析-省份数据
* @return
*/
List<AnalysisProvinceDTO> getAnalysisProvinceDTOs();
/***
* 社区筛查排名-血检人数/体检筛查排名-血检人数/门诊筛查排名-血检人数
* @return
*/
List<ScreeningRankDTO> getScreeningRankDTOs();
/**
* 运营分析-图例数据
* @return
*/
AnalysisGraphicDTO getAnalysisGraphicDTOs();
/**
* 筛查监控-胃镜检查
* @return
*/
GastroscopeTestDTO getGastroscopeTestDTOs();
/**
* Hp抗体阳性人数
* @return
*/
HpPositiveDTO getHpPositiveDTO();
/***
* 诊断结果
* @return
*/
DiagnosisDTO getDiagnosisDTO();
/**
* 风险等级
* @return
*/
List<RiskDTO> getRiskDTOs();
}
package com.sict.excel;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import com.sict.excel.test.AnalysisGraphicExcel;
import com.sict.excel.test.AnalysisHospitalEarlyCancerExcel;
import com.sict.excel.test.AnalysisProvinceExcel;
import com.sict.excel.test.Diagnosis;
import com.sict.excel.test.GastroscopeTest;
import com.sict.excel.test.ProvinceEarlyCancerRankExcel;
import com.sict.excel.test.ScreeningRankGecaExcel;
import com.sict.excel.test.ScreeningRankProvinceExcel;
import com.sict.excel.test.ScreeningRankQgExcel;
import com.sict.excel.test.ScreeningRankShchyyExcel;
import com.sict.excel.test.SerumTest;
public class myExcel {
public static void main(String[] args) throws Exception {
HSSFWorkbook workbook = new HSSFWorkbook();
//筛查监控-血清学检查
SerumTest serumTest = new SerumTest();
HSSFSheet sheet1 = serumTest.getsheet1(workbook);
workbook.setSheetName(0, "筛查监控-血清学检查");
//筛查监控-胃镜检查
GastroscopeTest gastroscopeTest = new GastroscopeTest();
HSSFSheet sheet2 = gastroscopeTest.getSheet2(workbook);
workbook.setSheetName(1, "筛查监控-胃镜检查");
//筛查监控-诊断结果
Diagnosis diagnosis = new Diagnosis();
HSSFSheet sheet3 = diagnosis.getSheet3(workbook);
workbook.setSheetName(2, "筛查监控-诊断结果");
//运营分析-图例数据
AnalysisGraphicExcel analysisGraphicExcel = new AnalysisGraphicExcel();
HSSFSheet sheet4 = analysisGraphicExcel.getsheet4(workbook);
workbook.setSheetName(3, "运营分析-图例数据");
//运营分析-省份数据
AnalysisProvinceExcel analysisProvinceExcel = new AnalysisProvinceExcel();
HSSFSheet sheet5 = analysisProvinceExcel.getSheet5(workbook);
workbook.setSheetName(4, "运营分析-省份数据");
//运营分析-医院早癌 胃癌数
AnalysisHospitalEarlyCancerExcel analysisHospitalEarlyCancerExcel = new AnalysisHospitalEarlyCancerExcel();
HSSFSheet sheet6 = analysisHospitalEarlyCancerExcel.getsheet6(workbook);
workbook.setSheetName(5, "运营分析-医院早癌 胃癌数");
//省份早癌排名
ProvinceEarlyCancerRankExcel provinceEarlyCancerRankExcel = new ProvinceEarlyCancerRankExcel();
HSSFSheet sheet7 = provinceEarlyCancerRankExcel.getSheet7(workbook);
workbook.setSheetName(6, "省份早癌排名");
//筛查排名-按血检人数排名
ScreeningRankProvinceExcel screeningRankProvinceExcel = new ScreeningRankProvinceExcel();
HSSFSheet sheet8 = screeningRankProvinceExcel.getSheet8(workbook);
workbook.setSheetName(7, "筛查排名-按血检人数排名");
//社区筛查排名-血检人数
ScreeningRankShchyyExcel screeningRankShchyyExcel = new ScreeningRankShchyyExcel();
HSSFSheet sheet9 = screeningRankShchyyExcel.getSheet9(workbook);
workbook.setSheetName(8, "社区筛查排名-血检人数");
//体检筛查排名-血检人数
ScreeningRankGecaExcel screeningRankGecaExcel = new ScreeningRankGecaExcel();
HSSFWorkbook getsheet10 = screeningRankGecaExcel.getsheet10(workbook);
workbook.setSheetName(9, "体检筛查排名-血检人数");
//门诊筛查排名-血检人数
ScreeningRankQgExcel screeningRankQgExcel = new ScreeningRankQgExcel();
HSSFSheet sheet11 = screeningRankQgExcel.getSheet11(workbook);
workbook.setSheetName(10, "门诊筛查排名-血检人数");
FileOutputStream outputStream = new FileOutputStream("E:/2019/excel/GICC+map+data.xls");
workbook.write(outputStream);
outputStream.close();
}
}
package com.sict.excel.test;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import com.sict.excel.bo.AnalysisGraphicBO;
import com.sict.excel.dto.AnalysisGraphicDTO;
import com.sict.excel.dto.EarlyCancerHospitalDTO;
import com.sict.excel.dto.ScreeningRankProvinceDTO;
import com.sict.excel.mapper.DownloadMapper;
import com.sict.excel.utils.ExportExcelUtil;
import com.sict.excel.utils.SqlSessionUtil;
public class AnalysisGraphicExcel {
public static HSSFSheet getsheet4(HSSFWorkbook workbook) throws IOException {
SqlSession sqlSession = SqlSessionUtil.getSession();
DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class);
ExportExcelUtil<AnalysisGraphicBO> util = new ExportExcelUtil<AnalysisGraphicBO>();
String[] columnNames = {"收集项","数值","备注"};
AnalysisGraphicDTO graphicDTO = mapper.getAnalysisGraphicDTOs();
List<AnalysisGraphicBO> list = new ArrayList<AnalysisGraphicBO>();
AnalysisGraphicBO analysisGraphicBO = new AnalysisGraphicBO();
analysisGraphicBO.setItem("申请胃癌筛查的医院总数");
analysisGraphicBO.setNumber(graphicDTO.getApplyGastricCancerScreeningHosp());
list.add(analysisGraphicBO);
AnalysisGraphicBO analysisGraphicBO2 = new AnalysisGraphicBO();
analysisGraphicBO2.setItem("通过申请医院数 ");
analysisGraphicBO2.setNumber(graphicDTO.getPassApplyHosp());
list.add(analysisGraphicBO2);
AnalysisGraphicBO analysisGraphicBO3 = new AnalysisGraphicBO();
analysisGraphicBO3.setItem("平台账号申请医院数");
analysisGraphicBO3.setNumber(graphicDTO.getPlatAccountApplyHosp());
list.add(analysisGraphicBO3);
AnalysisGraphicBO analysisGraphicBO4 = new AnalysisGraphicBO();
analysisGraphicBO4.setItem("账号已开通的医院数");
analysisGraphicBO4.setNumber(graphicDTO.getOpenAccountHosp());
list.add(analysisGraphicBO4);
// String path = "E:/2019/excel/" + "运营分析-图例数据.xls";
HSSFSheet sheet = util.exportExcel(workbook,"运营分析-图例数据", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
sqlSession.commit();
sqlSession.close();
return sheet;
}
}
package com.sict.excel.test;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hslf.model.Sheet;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import com.sict.excel.dto.EarlyCancerHospitalDTO;
import com.sict.excel.dto.ScreeningRankProvinceDTO;
import com.sict.excel.mapper.DownloadMapper;
import com.sict.excel.utils.ExportExcelUtil;
import com.sict.excel.utils.SqlSessionUtil;
public class AnalysisHospitalEarlyCancerExcel {
public static HSSFSheet getsheet6(HSSFWorkbook workbook) throws IOException {
SqlSession sqlSession = SqlSessionUtil.getSession();
DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class);
ExportExcelUtil<EarlyCancerHospitalDTO> util = new ExportExcelUtil<EarlyCancerHospitalDTO>();
String[] columnNames = {"排名","医院名称","省份","合计","高级别食管粘膜上皮内瘤变","早期食管癌","进展期食管癌","高级别胃粘膜上皮内瘤病变","早期胃癌","进展期胃癌"};
List<EarlyCancerHospitalDTO> list = mapper.geteaCancerHospitals();
// String path = "E:/2019/excel/" + "运营分析-医院早癌 胃癌数.xls";
HSSFSheet sheet = util.exportExcel(workbook,"运营分析-医院早癌 胃癌数", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
sqlSession.commit();
sqlSession.close();
return sheet;
}
}
package com.sict.excel.test;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import com.sict.excel.dto.AnalysisProvinceDTO;
import com.sict.excel.mapper.DownloadMapper;
import com.sict.excel.utils.ExportExcelUtil;
import com.sict.excel.utils.SqlSessionUtil;
public class AnalysisProvinceExcel {
public static HSSFSheet getSheet5(HSSFWorkbook workbook) throws IOException {
SqlSession sqlSession = SqlSessionUtil.getSession();
DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class);
ExportExcelUtil<AnalysisProvinceDTO> util = new ExportExcelUtil<AnalysisProvinceDTO>();
String[] columnNames = {"省份","申请医院总数 ","开通账号医院总数","申请账号中的医院总数","通过申请医院数","平台账号申请医院数","筛查人数","早癌数"};
List<AnalysisProvinceDTO> list = mapper.getAnalysisProvinceDTOs();
//String path = "E:/2019/excel/" + "运营分析-省份数据.xls";
HSSFSheet sheet = util.exportExcel(workbook,"运营分析-省份数据", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
sqlSession.commit();
sqlSession.close();
return sheet;
}
}
package com.sict.excel.test;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.log4j.DailyRollingFileAppender;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.RegionUtil;
import com.sict.excel.dto.DiagnosisDTO;
import com.sict.excel.dto.RiskDTO;
import com.sict.excel.mapper.DownloadMapper;
import com.sict.excel.utils.SqlSessionUtil;
public class Diagnosis {
public static HSSFSheet getSheet3(HSSFWorkbook workbook) throws IOException {
HSSFSheet sheet = workbook.createSheet("筛查监控-诊断结果");
sheet.setDefaultColumnWidth(15);
// 设置这些样式
HSSFCellStyle style = workbook.createCellStyle();
style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 垂直居中
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
// 背景色
// 设置边框
style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style.setBorderRight(HSSFCellStyle.BORDER_THIN);
style.setBorderTop(HSSFCellStyle.BORDER_THIN);
style.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style.setFillBackgroundColor(IndexedColors.PALE_BLUE.getIndex());
// 生成一个字体
HSSFFont font = workbook.createFont();
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
font.setFontName("宋体");
style.setFont(font);
HSSFRow row = sheet.createRow(0);
// 合并行
HSSFCell cell = row.createCell(0);
cell.setCellValue("收集项");
cell.setCellStyle(style);
CellRangeAddress region = new CellRangeAddress(0, 0, 0, 1);
sheet.addMergedRegion(region);
RegionUtil.setBorderBottom(1, region, sheet, workbook); // 下边框
RegionUtil.setBorderLeft(1, region, sheet, workbook); // 左边框
RegionUtil.setBorderRight(1, region, sheet, workbook); // 有边框
RegionUtil.setBorderTop(1, region, sheet, workbook); // 上边框
// 数量
HSSFCell cell12 = row.createCell(2);
cell12.setCellStyle(style);
cell12.setCellValue("数量");
HSSFCellStyle style2 = workbook.createCellStyle();
style2.setAlignment(HSSFCellStyle.ALIGN_CENTER);
// 背景色
// 设置边框
style2.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style2.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style2.setBorderRight(HSSFCellStyle.BORDER_THIN);
style2.setBorderTop(HSSFCellStyle.BORDER_THIN);
// 生成一个字体
HSSFFont font2 = workbook.createFont();
font.setFontHeightInPoints((short) 11);
font.setColor(IndexedColors.AUTOMATIC.getIndex());
font.setFontName("宋体");
style2.setFont(font2);// 把字体 应用到当前样式
HSSFRow row4 ;
HSSFCell cell41,cell42,cell43,cell44;
SqlSession sqlSession = SqlSessionUtil.getSession();
DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class);
DiagnosisDTO diagnosis = mapper.getDiagnosisDTO();
String[] str1 = {"诊断结果","","","","其他","",""};
String[] str2 = {"高级别上皮内瘤变","低级别上皮内瘤变","早期胃癌","早期食管癌","萎缩性胃炎","胃溃疡","胃息肉"};
Integer[] number = {diagnosis.getHigeLevel(),diagnosis.getLowLevel(),diagnosis.getEarlyGastricCancer(),diagnosis.getEarlyEsophagealCancer(),diagnosis.getAtrophicGastritis(),diagnosis.getGastricUlcer(),diagnosis.getGastricPolyps()};
String[] str3 = {"食管"+diagnosis.getHighEsophageal()+"+胃"+diagnosis.getHighStomach(),"食管"+diagnosis.getLowEsophageal()+"+胃"+diagnosis.getLowStomach(),"进展期胃癌"+diagnosis.getAdvancedGastricCancer(),"进展期食管癌"+diagnosis.getAdvancedEsophagealCancer(),"","",""};
for (int i = 1; i < 8; i++) {
row4 = sheet.createRow(i);
cell41 = row4.createCell(0);
cell41.setCellStyle(style2);
cell41.setCellValue(str1[i-1]);
cell42 = row4.createCell(1);
cell42.setCellStyle(style2);
cell42.setCellValue(str2[i-1]);
cell43 = row4.createCell(2);
cell43.setCellStyle(style2);
cell43.setCellValue(number[i-1]);
cell44 = row4.createCell(3);
cell44.setCellValue(str3[i-1]);
}
CellRangeAddress region2 = new CellRangeAddress(1, 4, 0, 0);
sheet.addMergedRegion(region2);
RegionUtil.setBorderBottom(1, region2, sheet, workbook); // 下边框
RegionUtil.setBorderLeft(1, region2, sheet, workbook); // 左边框
RegionUtil.setBorderRight(1, region2, sheet, workbook); // 有边框
RegionUtil.setBorderTop(1, region2, sheet, workbook); // 上边框
CellRangeAddress region3 = new CellRangeAddress(5, 7, 0, 0);
sheet.addMergedRegion(region3);
RegionUtil.setBorderBottom(1, region3, sheet, workbook); // 下边框
RegionUtil.setBorderLeft(1, region3, sheet, workbook); // 左边框
RegionUtil.setBorderRight(1, region3, sheet, workbook); // 有边框
RegionUtil.setBorderTop(1, region3, sheet, workbook); // 上边框
HSSFRow row5 ;
HSSFCell cell51,cell52,cell53;
List<RiskDTO> riskDTOs = mapper.getRiskDTOs();
String[] str4 = {"","高危","中危","低危","总数"};
Integer highInteger=riskDTOs.get(0).getTotal();
Integer lowString = riskDTOs.get(1).getTotal();
Integer mediuString = riskDTOs.get(2).getTotal();
Integer totalInteger = highInteger.intValue()+lowString.intValue()+mediuString.intValue();
double highdouble = Double.parseDouble(highInteger.toString());
double mediumdouble = Double.parseDouble(mediuString.toString());
double lowdouble = Double.parseDouble(lowString.toString());
double totaldouble = Double.parseDouble(totalInteger.toString());
String[] str5 = {"总数",highInteger.toString(),mediuString.toString(),lowString.toString(),totalInteger+""};
String[] str6 = {"比例",String.format("%.1f", highdouble/totaldouble*100)+"%",String.format("%.1f", mediumdouble/totaldouble*100)+"%",String.format("%.1f", lowdouble/totaldouble*100)+"%","100%"};
for (int i = 11; i < 16; i++) {
row5 = sheet.createRow(i);
cell51 = row5.createCell(0);
cell51.setCellValue(str4[i-11]);
cell52 = row5.createCell(1);
cell52.setCellValue(str5[i-11]);
HSSFCellStyle style3 = workbook.createCellStyle();
HSSFFont font3 = workbook.createFont();
font3.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
font3.setFontName("宋体");
style3.setFont(font);
cell53 = row5.createCell(2);
cell53.setCellValue(str6[i-11]);
cell53.setCellStyle(style3);
}
return sheet;
}
}
package com.sict.excel.test;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.IndexedColors;
import com.sict.excel.dto.GastroscopeTestDTO;
import com.sict.excel.mapper.DownloadMapper;
import com.sict.excel.utils.SqlSessionUtil;
public class GastroscopeTest {
public static HSSFSheet getSheet2(HSSFWorkbook workbook) throws IOException {
SqlSession sqlSession = SqlSessionUtil.getSession();
DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class);
GastroscopeTestDTO gastroscopeTestDTO = mapper.getGastroscopeTestDTOs();
HSSFSheet sheet = workbook.createSheet("筛查监控-胃镜检查");
sheet.setDefaultColumnWidth(15);
HSSFRow row = sheet.createRow(0);
HSSFCellStyle style = workbook.createCellStyle();
// 设置这些样式
style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 垂直居中
// 背景色
style.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style.setFillBackgroundColor(IndexedColors.PALE_BLUE.getIndex());
// 设置边框
style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style.setBorderRight(HSSFCellStyle.BORDER_THIN);
style.setBorderTop(HSSFCellStyle.BORDER_THIN);
// 生成一个字体
HSSFFont font = workbook.createFont();
font.setFontHeightInPoints((short) 11);
font.setColor(IndexedColors.AUTOMATIC.getIndex());
font.setFontName("宋体");
style.setFont(font);// 把字体 应用到当前样式
HSSFCell cell = row.createCell(0);
cell.setCellValue("收集项");
cell.setCellStyle(style);
HSSFCell cell2 = row.createCell(1);
cell2.setCellValue("数量");
cell2.setCellStyle(style);
HSSFCellStyle style2 = workbook.createCellStyle();
// 设置这些样式
style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 垂直居中
// 背景色
style2.setFillForegroundColor(IndexedColors.WHITE.getIndex());
style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style2.setFillBackgroundColor(IndexedColors.WHITE.getIndex());
// 设置边框
style2.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style2.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style2.setBorderRight(HSSFCellStyle.BORDER_THIN);
style2.setBorderTop(HSSFCellStyle.BORDER_THIN);
style2.setFont(font);// 把字体 应用到当前样式
HSSFRow row2 = sheet.createRow(1);// 第2行
HSSFCell cell3 = row2.createCell(0);
cell3.setCellStyle(style2);
cell3.setCellValue("实际精查人数");
HSSFCell cell4 = row2.createCell(1);
cell4.setCellStyle(style2);
cell4.setCellValue(gastroscopeTestDTO.getActualGastroscope()+"");
HSSFCell cell7 = row2.createCell(2);
double actual = Double.parseDouble(gastroscopeTestDTO.getActualGastroscope().toString());
double plan = Double.parseDouble(gastroscopeTestDTO.getPlanGastroscope().toString());
cell7.setCellValue(String.format("%.2f", actual/plan*100)+"%");
HSSFRow row3 = sheet.createRow(2);// 第三行
HSSFCell cell5 = row3.createCell(0);
cell5.setCellStyle(style2);
cell5.setCellValue("应精查人数");
HSSFCell cell6 = row3.createCell(1);
cell6.setCellStyle(style2);
cell6.setCellValue(gastroscopeTestDTO.getPlanGastroscope()+"");
//FileOutputStream outputStream = new FileOutputStream("E:/2019/excel/筛查监控-胃镜检查.xls");
sqlSession.commit();
sqlSession.close();
return sheet;
}
}
package com.sict.excel.test;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import com.sict.excel.dto.EarlyCancerRankDTO;
import com.sict.excel.mapper.DownloadMapper;
import com.sict.excel.utils.ExportExcelUtil;
import com.sict.excel.utils.SqlSessionUtil;
public class ProvinceEarlyCancerRankExcel {
public static HSSFSheet getSheet7(HSSFWorkbook workbook) throws IOException {
SqlSession sqlSession = SqlSessionUtil.getSession();
DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class);
ExportExcelUtil<EarlyCancerRankDTO> util = new ExportExcelUtil<EarlyCancerRankDTO>();
String[] columnNames = {"省份","早癌数"};
List<EarlyCancerRankDTO> list = mapper.getEarlyCancerRankDTOs();
//String path = "E:/2019/excel/" + "省份早癌排名.xls";
HSSFSheet sheet = util.exportExcel(workbook,"省份早癌排名", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
sqlSession.commit();
sqlSession.close();
return sheet;
}
}
package com.sict.excel.test;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import com.sict.excel.dto.EarlyCancerRankDTO;
import com.sict.excel.dto.ScreeningRankDTO;
import com.sict.excel.mapper.DownloadMapper;
import com.sict.excel.utils.ExportExcelUtil;
import com.sict.excel.utils.SqlSessionUtil;
public class ScreeningRankGecaExcel {
public static HSSFWorkbook getsheet10(HSSFWorkbook workbook) throws IOException {
SqlSession sqlSession = SqlSessionUtil.getGecaSession();
DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class);
ExportExcelUtil<ScreeningRankDTO> util = new ExportExcelUtil<ScreeningRankDTO>();
String[] columnNames = {"排名","医联体名称","血检人数"};
List<ScreeningRankDTO> list = mapper.getScreeningRankDTOs();
String path = "E:/2019/excel/" + "体检筛查排名-血检人数.xls";
HSSFSheet sheet = util.exportExcel(workbook,"体检筛查排名-血检人数", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
sqlSession.commit();
sqlSession.close();
return workbook;
}
}
package com.sict.excel.test;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import com.sict.excel.dto.ScreeningRankProvinceDTO;
import com.sict.excel.mapper.DownloadMapper;
import com.sict.excel.utils.ExportExcelUtil;
import com.sict.excel.utils.SqlSessionUtil;
public class ScreeningRankProvinceExcel {
public static HSSFSheet getSheet8(HSSFWorkbook workbook) throws IOException {
SqlSession sqlSession = SqlSessionUtil.getSession();
DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class);
ExportExcelUtil<ScreeningRankProvinceDTO> util = new ExportExcelUtil<ScreeningRankProvinceDTO>();
String[] columnNames = {"排名","医院名称","省份","血检人数"};
List<ScreeningRankProvinceDTO> list = mapper.getScreeningRankProvinceDTOs();
//String path = "E:/2019/excel/" + "筛查排名-按血检人数排名.xls";
HSSFSheet sheet = util.exportExcel(workbook, "筛查排名-按血检人数排名", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
sqlSession.commit();
sqlSession.close();
return sheet;
}
}
package com.sict.excel.test;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import com.sict.excel.dto.EarlyCancerRankDTO;
import com.sict.excel.dto.ScreeningRankDTO;
import com.sict.excel.mapper.DownloadMapper;
import com.sict.excel.utils.ExportExcelUtil;
import com.sict.excel.utils.SqlSessionUtil;
public class ScreeningRankQgExcel {
public static HSSFSheet getSheet11(HSSFWorkbook workbook) throws IOException {
SqlSession sqlSession = SqlSessionUtil.getQgSession();
DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class);
ExportExcelUtil<ScreeningRankDTO> util = new ExportExcelUtil<ScreeningRankDTO>();
String[] columnNames = {"排名","医联体名称","血检人数"};
List<ScreeningRankDTO> list = mapper.getScreeningRankDTOs();
String path = "E:/2019/excel/" + "门诊筛查排名-血检人数.xls";
HSSFSheet sheet = util.exportExcel(workbook,"门诊筛查排名-血检人", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
sqlSession.commit();
sqlSession.close();
return sheet;
}
}
package com.sict.excel.test;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import com.sict.excel.dto.EarlyCancerRankDTO;
import com.sict.excel.dto.ScreeningRankDTO;
import com.sict.excel.mapper.DownloadMapper;
import com.sict.excel.utils.ExportExcelUtil;
import com.sict.excel.utils.SqlSessionUtil;
public class ScreeningRankShchyyExcel {
public static HSSFSheet getSheet9(HSSFWorkbook workbook) throws IOException {
SqlSession sqlSession = SqlSessionUtil.getShchyySession();
DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class);
ExportExcelUtil<ScreeningRankDTO> util = new ExportExcelUtil<ScreeningRankDTO>();
String[] columnNames = {"排名","医联体名称","血检人数"};
List<ScreeningRankDTO> list = mapper.getScreeningRankDTOs();
String path = "E:/2019/excel/" + "社区筛查排名-血检人数.xls";
HSSFSheet sheet = util.exportExcel(workbook,"社区筛查排名-血检人数", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
sqlSession.commit();
sqlSession.close();
return sheet;
}
}
package com.sict.excel.test;
import java.io.FileOutputStream;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.IndexedColors;
import com.sict.excel.dto.HpPositiveDTO;
import com.sict.excel.dto.ScreeningRankDTO;
import com.sict.excel.dto.ScreeningRankProvinceDTO;
import com.sict.excel.dto.SerumStatisticsDTO;
import com.sict.excel.mapper.DownloadMapper;
import com.sict.excel.utils.ExportExcelUtil;
import com.sict.excel.utils.SqlSessionUtil;
public class SerumTest {
public static HSSFSheet getsheet1(HSSFWorkbook workbook) throws Exception {
SqlSession sqlSession = SqlSessionUtil.getSession();// 血检总人数
SqlSession shchyy = SqlSessionUtil.getShchyySession();// 社区血检人数
SqlSession geca = SqlSessionUtil.getGecaSession();// 体检
SqlSession qg = SqlSessionUtil.getQgSession();// 门诊
DownloadMapper sqlSessionmapper = sqlSession.getMapper(DownloadMapper.class);
DownloadMapper shchyyMapper = shchyy.getMapper(DownloadMapper.class);
DownloadMapper gecaMapper = geca.getMapper(DownloadMapper.class);
DownloadMapper qgMapper = qg.getMapper(DownloadMapper.class);
SerumStatisticsDTO serumall = sqlSessionmapper.getSerumStatistics();
List<ScreeningRankDTO> listshchyy = shchyyMapper.getScreeningRankDTOs();
List<ScreeningRankDTO> listgeca = gecaMapper.getScreeningRankDTOs();
List<ScreeningRankDTO> listqg = qgMapper.getScreeningRankDTOs();
Integer serumInteger = serumall.getSerumTestTotal();
Integer shchyyinInteger = 0;
Integer gecaintInteger = 0;
Integer qgInteger = 0;
Integer hpInteger = serumall.getIggPositive();
for (ScreeningRankDTO screeningRankDTO : listshchyy) {
shchyyinInteger += screeningRankDTO.getActualserum();
}
for (ScreeningRankDTO screeningRankDTO : listgeca) {
gecaintInteger += screeningRankDTO.getActualserum();
}
for (ScreeningRankDTO screeningRankDTO : listqg) {
qgInteger += screeningRankDTO.getActualserum();
}
HSSFSheet sheet = workbook.createSheet("筛查监控-血清学检查");
sheet.setDefaultColumnWidth(15);
HSSFRow row = sheet.createRow(0);
HSSFCellStyle style = workbook.createCellStyle();
// 设置这些样式
style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 垂直居中
// 背景色
style.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style.setFillBackgroundColor(IndexedColors.PALE_BLUE.getIndex());
// 设置边框
style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style.setBorderRight(HSSFCellStyle.BORDER_THIN);
style.setBorderTop(HSSFCellStyle.BORDER_THIN);
// 生成一个字体
HSSFFont font = workbook.createFont();
font.setFontHeightInPoints((short) 11);
font.setColor(IndexedColors.AUTOMATIC.getIndex());
font.setFontName("宋体");
style.setFont(font);// 把字体 应用到当前样式
HSSFCell cell = row.createCell(0);
cell.setCellValue("收集项");
cell.setCellStyle(style);
HSSFCell cell2 = row.createCell(1);
cell2.setCellValue("数量");
cell2.setCellStyle(style);
HSSFCellStyle style2 = workbook.createCellStyle();
// 设置这些样式
style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 垂直居中
// 背景色
style2.setFillForegroundColor(IndexedColors.WHITE.getIndex());
style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style2.setFillBackgroundColor(IndexedColors.WHITE.getIndex());
// 设置边框
style2.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style2.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style2.setBorderRight(HSSFCellStyle.BORDER_THIN);
style2.setBorderTop(HSSFCellStyle.BORDER_THIN);
style2.setFont(font);// 把字体 应用到当前样式
HSSFRow row2 = sheet.createRow(1);// 第2行
HSSFCell cell3 = row2.createCell(0);
cell3.setCellStyle(style2);
cell3.setCellValue("血检总人数");
HSSFCell cell4 = row2.createCell(1);
cell4.setCellStyle(style2);
cell4.setCellValue(serumInteger + "");
HSSFRow row3 = sheet.createRow(2);// 第三行
HSSFCell cell5 = row3.createCell(0);
cell5.setCellStyle(style2);
cell5.setCellValue("Hp抗体阳性人数 ");
HSSFCell cell6 = row3.createCell(1);
cell6.setCellStyle(style2);
cell6.setCellValue(hpInteger + "");
HSSFCell cell7 = row3.createCell(2);
double all = Double.parseDouble(serumInteger.toString());
double hp2 = Double.parseDouble(hpInteger.toString());
cell7.setCellValue(String.format("%.2f", hp2 / all * 100) + "%");
HSSFCellStyle style3 = workbook.createCellStyle();
HSSFRow row8 = sheet.createRow(7);//7行
HSSFCell cell71 = row8.createCell(0);
cell71.setCellValue("社区血检人数");
style3.setFont(font);
cell71.setCellStyle(style3);
HSSFCell cell72 = row8.createCell(1);
cell72.setCellStyle(style3);
cell72.setCellValue(shchyyinInteger+"");
HSSFRow row9 = sheet.createRow(8);//8行
HSSFCell cell91 = row9.createCell(0);
cell91.setCellValue("门诊血检人数");
style3.setFont(font);
cell91.setCellStyle(style3);
HSSFCell cell92 = row9.createCell(1);
cell92.setCellStyle(style3);
cell92.setCellValue(qgInteger+"");
HSSFRow row10 = sheet.createRow(9);//9行
HSSFCell cell101 = row10.createCell(0);
cell101.setCellValue("体检血检人数");
style3.setFont(font);
cell101.setCellStyle(style3);
HSSFCell cell102 = row10.createCell(1);
cell102.setCellStyle(style3);
cell102.setCellValue(gecaintInteger+"");
HSSFRow row11= sheet.createRow(10);//10行
HSSFCell cell111 = row11.createCell(0);
cell111.setCellValue("合计");
style3.setFont(font);
cell111.setCellStyle(style3);
HSSFCell cell112 = row11.createCell(1);
cell112.setCellStyle(style3);
cell112.setCellValue(String.valueOf(shchyyinInteger.intValue()+gecaintInteger.intValue()+qgInteger.intValue()));
FileOutputStream outputStream = new FileOutputStream("E:/2019/excel/筛查监控-血清学检查.xls");
sqlSession.commit();
shchyy.commit();
geca.commit();
qg.commit();
qg.close();
geca.close();
qg.close();
sqlSession.close();
return sheet;
}
}
package com.sict.excel.test;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import com.sict.excel.dto.Student;
import com.sict.excel.utils.ExportExcelUtil;
/**
* 测试文件导出
* @author liuyazhuang
*
*/
public class TestExportExcel {
public static void main(String[] args) throws Exception{
ExportExcelUtil<Student> util = new ExportExcelUtil<Student>();
// 准备数据
List<Student> list = new ArrayList<Student>();
for (int i = 0; i < 10; i++) {
list.add(new Student(i,"张三asdf"+i,"男"));
}
String[] columnNames = { "ID", "姓名", "性别" };
// Date date = new Date();
// System.out.println(date.getYear()+"/"+date.getMonth()+"/"+date.getDay()+"/"+date.getHours()+"/"+date.getMinutes()+"/"+date.getSeconds());
Calendar calendar = Calendar.getInstance();
Date date = new Date();
calendar.setTime(date);
calendar.getTime();//2019-08-13
//System.out.println(calendar.get(Calendar.YEAR)+"/"+calendar.get(Calendar.MONTH)+"/"+calendar.get(Calendar.DATE)+"/"+calendar.get(Calendar.HOUR)+"/"+calendar.get(Calendar.MINUTE)+"/"+calendar.get(Calendar.SECOND));
String path = "E:/2019/excel/"+date.getTime()+"学生表.xls";
// util.exportExcel("用户导出", columnNames, list, new FileOutputStream(path), ExportExcelUtil.EXCEL_FILE_2003);
System.out.println("已导出excel表");
}
}
\ No newline at end of file
This diff is collapsed.
package com.sict.excel.utils;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFColor;
import org.apache.poi.xssf.usermodel.XSSFFont;
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
/**
* 导出Excel
*
* @author liuyazhuang
*
* @param <T>
*/
public class ExportExcelUtil<T> {
// 2007 版本以上 最大支持1048576行
public final static String EXCEl_FILE_2007 = "2007";
// 2003 版本 最大支持65536 行
public final static String EXCEL_FILE_2003 = "2003";
/**
* <p>
* 导出无头部标题行Excel <br>
* 时间格式默认:yyyy-MM-dd hh:mm:ss <br>
* </p>
*
* @param title 表格标题
* @param dataset 数据集合
* @param out 输出流
* @param version 2003 或者 2007,不传时默认生成2003版本
*/
public HSSFSheet exportExcel(HSSFWorkbook workbook,String title, Collection<T> dataset, String version) {
return exportExcel2007(workbook,title, null, dataset, "yyyy-MM-dd HH:mm:ss");
}
/**
* <p>
* 导出带有头部标题行的Excel <br>
* 时间格式默认:yyyy-MM-dd hh:mm:ss <br>
* </p>
*
* @param title 表格标题
* @param headers 头部标题集合
* @param dataset 数据集合
* @param out 输出流
* @param version 2003 或者 2007,不传时默认生成2003版本
*/
public HSSFSheet exportExcel(HSSFWorkbook workbook,String title, String[] headers, Collection<T> dataset, String version) {
return exportExcel2007(workbook,title, headers, dataset, "yyyy-MM-dd HH:mm:ss");
}
/**
* <p>
* 通用Excel导出方法,利用反射机制遍历对象的所有字段,将数据写入Excel文件中 <br>
* 此版本生成2007以上版本的文件 (文件后缀:xlsx)
* </p>
*
* @param title 表格标题名
* @param headers 表格头部标题集合
* @param dataset 需要显示的数据集合,集合中一定要放置符合JavaBean风格的类的对象。此方法支持的
* JavaBean属性的数据类型有基本数据类型及String,Date
* @param out 与输出设备关联的流对象,可以将EXCEL文档导出到本地文件或者网络中
* @param pattern 如果有时间数据,设定输出格式。默认为"yyyy-MM-dd hh:mm:ss"
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public HSSFSheet exportExcel2007(HSSFWorkbook workbook,String title, String[] headers, Collection<T> dataset,
String pattern) {
// 声明一个工作薄
//HSSFWorkbook workbook = new HSSFWorkbook();
// 生成一个表格
HSSFSheet sheet = workbook.createSheet(title);
// 设置表格默认列宽度为15个字节
sheet.setDefaultColumnWidth(20);
// 生成一个样式
HSSFCellStyle style = workbook.createCellStyle();
// 设置这些样式
// 背景色
style.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style.setFillBackgroundColor(IndexedColors.PALE_BLUE.getIndex());
style.setBorderBottom(XSSFCellStyle.BORDER_THIN);
style.setBorderLeft(XSSFCellStyle.BORDER_THIN);
style.setBorderRight(XSSFCellStyle.BORDER_THIN);
style.setBorderTop(XSSFCellStyle.BORDER_THIN);
style.setAlignment(XSSFCellStyle.ALIGN_LEFT);
// 生成一个字体
HSSFFont font = workbook.createFont();
// font.setBoldweight(XSSFFont.BOLDWEIGHT_BOLD);
font.setFontName("宋体");
font.setColor(IndexedColors.AUTOMATIC.getIndex());
font.setFontHeightInPoints((short) 11);
// 把字体应用到当前的样式
style.setFont(font);
// 生成并设置另一个样式
HSSFCellStyle style2 = workbook.createCellStyle();
style2.setFillForegroundColor(IndexedColors.WHITE.getIndex());
style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style2.setFillBackgroundColor(IndexedColors.WHITE.getIndex());
style2.setBorderBottom(XSSFCellStyle.BORDER_THIN);
style2.setBorderLeft(XSSFCellStyle.BORDER_THIN);
style2.setBorderRight(XSSFCellStyle.BORDER_THIN);
style2.setBorderTop(XSSFCellStyle.BORDER_THIN);
style2.setAlignment(XSSFCellStyle.ALIGN_LEFT);
style2.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
// 生成另一个字体
HSSFFont font2 = workbook.createFont();
font2.setFontName("宋体");
// font2.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL);
// 把字体应用到当前的样式
style2.setFont(font2);
// 产生表格标题行
HSSFRow row = sheet.createRow(0);
HSSFCell cellHeader;
for (int i = 0; i < headers.length; i++) {
cellHeader = row.createCell(i);
cellHeader.setCellStyle(style);
cellHeader.setCellValue(new HSSFRichTextString(headers[i]));
}
// 遍历集合数据,产生数据行
Iterator<T> it = dataset.iterator();
int index = 0;
T t;
Field[] fields;
Field field;
HSSFRichTextString richString;
Pattern p = Pattern.compile("^//d+(//.//d+)?$");
Matcher matcher;
String fieldName;
String getMethodName;
HSSFCell cell;
Class tCls;
Method getMethod;
Object value;
String textValue;
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
while (it.hasNext()) {
index++;
row = sheet.createRow(index);
t = (T) it.next();
// 利用反射,根据JavaBean属性的先后顺序,动态调用getXxx()方法得到属性值
fields = t.getClass().getDeclaredFields();
for (int i = 0; i < fields.length; i++) {
cell = row.createCell(i);
cell.setCellStyle(style2);
field = fields[i];
fieldName = field.getName();
getMethodName = "get" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
try {
tCls = t.getClass();
getMethod = tCls.getMethod(getMethodName, new Class[] {});
value = getMethod.invoke(t, new Object[] {});
// 判断值的类型后进行强制类型转换
textValue = null;
if (value instanceof Integer) {
cell.setCellValue((Integer) value);
} else if (value instanceof Float) {
textValue = String.valueOf((Float) value);
cell.setCellValue(textValue);
} else if (value instanceof Double) {
textValue = String.valueOf((Double) value);
cell.setCellValue(textValue);
} else if (value instanceof Long) {
cell.setCellValue((Long) value);
}
if (value instanceof Boolean) {
textValue = "是";
if (!(Boolean) value) {
textValue = "否";
}
} else if (value instanceof Date) {
textValue = sdf.format((Date) value);
} else {
// 其它数据类型都当作字符串简单处理
if (value != null) {
textValue = value.toString();
}
}
if (textValue != null) {
matcher = p.matcher(textValue);
if (matcher.matches()) {
// 是数字当作double处理
cell.setCellValue(Double.parseDouble(textValue));
} else {
richString = new HSSFRichTextString(textValue);
cell.setCellValue(richString);
}
}
} catch (SecurityException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} finally {
// 清理资源
}
}
}
return sheet;
}
}
\ No newline at end of file
package com.sict.excel.utils;
import java.io.IOException;
import java.io.InputStream;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
public class SqlSessionUtil {
// 获取mybatis全局配置文件
private static String resource = "mybatis-config.xml";
public static SqlSession getSession() throws IOException {
InputStream inputStream = Resources.getResourceAsStream(resource);
// 读取配置文件的配置信息,利用SqlSessionFactoryBuilder创建sqlSessionFactory
SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
// 利用sqlSessionFactory打开与数据库的会话
SqlSession sqlSession = sqlSessionFactory.openSession();
return sqlSession;
}
private static String resource2 = "mybatis-geca.xml";
public static SqlSession getGecaSession() throws IOException {
InputStream inputStream = Resources.getResourceAsStream(resource2);
// 读取配置文件的配置信息,利用SqlSessionFactoryBuilder创建sqlSessionFactory
SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
// 利用sqlSessionFactory打开与数据库的会话
SqlSession sqlSession = sqlSessionFactory.openSession();
return sqlSession;
}
private static String resource3 = "mybatis-qg.xml";
public static SqlSession getQgSession() throws IOException {
InputStream inputStream = Resources.getResourceAsStream(resource3);
// 读取配置文件的配置信息,利用SqlSessionFactoryBuilder创建sqlSessionFactory
SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
// 利用sqlSessionFactory打开与数据库的会话
SqlSession sqlSession = sqlSessionFactory.openSession();
return sqlSession;
}
private static String resource4 = "mybatis-shchyy.xml";
public static SqlSession getShchyySession() throws IOException {
InputStream inputStream = Resources.getResourceAsStream(resource4);
// 读取配置文件的配置信息,利用SqlSessionFactoryBuilder创建sqlSessionFactory
SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
// 利用sqlSessionFactory打开与数据库的会话
SqlSession sqlSession = sqlSessionFactory.openSession();
return sqlSession;
}
}
log4j.rootLogger=DEBUG,A1
log4j.logger.org.apache=DEBUG
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss,SSS} [%t] [%c]-[%p] %m%n
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://gicc-db:3306/shchyy_dw?characterEncoding=utf8"/>
<property name="username" value="chyy_demo"/>
<property name="password" value="Waw8DXh3fJJ-"/>
</dataSource>
</environment>
</environments>
<mappers>
<mapper resource="mapper/DownloadMapper.xml"/>
</mappers>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://gicc-db:3306/shchyy_geca?characterEncoding=utf8"/>
<property name="username" value="chyy_demo"/>
<property name="password" value="Waw8DXh3fJJ-"/>
</dataSource>
</environment>
</environments>
<mappers>
<mapper resource="mapper/DownloadMapper.xml"/>
</mappers>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://gicc-db:3306/shchyy_qg?characterEncoding=utf8"/>
<property name="username" value="chyy_demo"/>
<property name="password" value="Waw8DXh3fJJ-"/>
</dataSource>
</environment>
</environments>
<mappers>
<mapper resource="mapper/DownloadMapper.xml"/>
</mappers>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://gicc-db:3306/shchyy?characterEncoding=utf8"/>
<property name="username" value="chyy_demo"/>
<property name="password" value="Waw8DXh3fJJ-"/>
</dataSource>
</environment>
</environments>
<mappers>
<mapper resource="mapper/DownloadMapper.xml"/>
</mappers>
</configuration>
\ No newline at end of file
Manifest-Version: 1.0
Built-By: Cathie
Build-Jdk: 1.8.0_181
Created-By: Maven Integration for Eclipse
#Generated by Maven Integration for Eclipse
#Fri Nov 22 09:15:51 CST 2019
version=1.0-SNAPSHOT
groupId=download
m2e.projectName=download
m2e.projectLocation=E\:\\BIGDATA\\HadoopSpace\\download
artifactId=download
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>download</groupId>
<artifactId>download</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!--mybatis核心包 -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.3.0</version>
</dependency>
<!--MySQL的JDBC驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.29</version>
</dependency>
<!--junit单元测试包 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- excel -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-excelant</artifactId>
<version>3.11-beta2</version>
</dependency>
<!--<dependency> -->
<!--<groupId>com.huawei.paas.cse</groupId> -->
<!--<artifactId>cse-solution-service-engine</artifactId> -->
<!--<exclusions> -->
<!--<exclusion> -->
<!--<groupId>org.slf4j</groupId> -->
<!--<artifactId>slf4j-log4j12</artifactId> -->
<!--</exclusion> -->
<!--</exclusions> -->
<!--</dependency> -->
<!--<dependency> -->
<!--<groupId>org.apache.servicecomb</groupId> -->
<!--<artifactId>spring-boot-starter-provider</artifactId> -->
<!--</dependency> -->
</dependencies>
<!--<dependencyManagement> -->
<!--<dependencies> -->
<!--<dependency> -->
<!--<groupId>org.apache.servicecomb</groupId> -->
<!--<artifactId>java-chassis-dependencies-springboot2</artifactId> -->
<!--<version>1.1.0.B018</version> -->
<!--<type>pom</type> -->
<!--<scope>import</scope> -->
<!--</dependency> -->
<!--<dependency> -->
<!--<groupId>com.huawei.paas.cse</groupId> -->
<!--<artifactId>cse-dependency</artifactId> -->
<!--<version>2.3.46</version> -->
<!--<type>pom</type> -->
<!--<scope>import</scope> -->
<!--</dependency> -->
<!--</dependencies> -->
<!--</dependencyManagement> -->
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
</build>
</project>
\ No newline at end of file
log4j.rootLogger=DEBUG,A1
log4j.logger.org.apache=DEBUG
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss,SSS} [%t] [%c]-[%p] %m%n
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://gicc-db:3306/shchyy_dw?characterEncoding=utf8"/>
<property name="username" value="chyy_demo"/>
<property name="password" value="Waw8DXh3fJJ-"/>
</dataSource>
</environment>
</environments>
<mappers>
<mapper resource="mapper/DownloadMapper.xml"/>
</mappers>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://gicc-db:3306/shchyy_geca?characterEncoding=utf8"/>
<property name="username" value="chyy_demo"/>
<property name="password" value="Waw8DXh3fJJ-"/>
</dataSource>
</environment>
</environments>
<mappers>
<mapper resource="mapper/DownloadMapper.xml"/>
</mappers>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://gicc-db:3306/shchyy_qg?characterEncoding=utf8"/>
<property name="username" value="chyy_demo"/>
<property name="password" value="Waw8DXh3fJJ-"/>
</dataSource>
</environment>
</environments>
<mappers>
<mapper resource="mapper/DownloadMapper.xml"/>
</mappers>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://gicc-db:3306/shchyy?characterEncoding=utf8"/>
<property name="username" value="chyy_demo"/>
<property name="password" value="Waw8DXh3fJJ-"/>
</dataSource>
</environment>
</environments>
<mappers>
<mapper resource="mapper/DownloadMapper.xml"/>
</mappers>
</configuration>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment