Commit e6800584 authored by 吴霞's avatar 吴霞

修改excel样式

parent 4f3b917f
......@@ -37,54 +37,36 @@ public class EarlyCancerHospitalDTO {
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) {
......
......@@ -59,16 +59,16 @@ public class myExcel {
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(9, "体检筛查排名-血检人数");
//门诊筛查排名-血检人数
ScreeningRankGecaExcel screeningRankGecaExcel = new ScreeningRankGecaExcel();
HSSFWorkbook getsheet10 = screeningRankGecaExcel.getsheet10(workbook);
workbook.setSheetName(10, "门诊筛查排名-血检人数");
// FileOutputStream outputStream = new FileOutputStream("E:/2019/excel/GICC+map+data.xls");
FileOutputStream outputStream = new FileOutputStream("/home/gcsvr/excel/GICC+map+data.xls");
FileOutputStream outputStream = new FileOutputStream("E:/2019/excel/GICC+map+data.xls");
// FileOutputStream outputStream = new FileOutputStream("/home/gcsvr/excel/GICC+map+data.xls");
workbook.write(outputStream);
outputStream.close();
}
......
......@@ -6,8 +6,13 @@ import java.util.ArrayList;
import java.util.List;
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.bo.AnalysisGraphicBO;
import com.sict.excel.dto.AnalysisGraphicDTO;
......@@ -25,38 +30,91 @@ public class AnalysisGraphicExcel {
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 = workbook.createSheet("运营分析-图例数据");
sheet.setDefaultColumnWidth(20);
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) 12);
font.setColor(IndexedColors.AUTOMATIC.getIndex());
font.setFontName("宋体");
style.setFont(font);// 把字体 应用到当前样式
HSSFCellStyle style2 = workbook.createCellStyle();
// 设置这些样式
style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 垂直居中
// 背景色黄色
style2.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style2.setFillBackgroundColor(IndexedColors.YELLOW.getIndex());
// 设置边框
style2.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style2.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style2.setBorderRight(HSSFCellStyle.BORDER_THIN);
style2.setBorderTop(HSSFCellStyle.BORDER_THIN);
HSSFCellStyle style3 = workbook.createCellStyle();
// 设置这些样式
// 设置边框
style3.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style3.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style3.setBorderRight(HSSFCellStyle.BORDER_THIN);
style3.setBorderTop(HSSFCellStyle.BORDER_THIN);
//HSSFSheet sheet = util.exportExcel(workbook,"运营分析-图例数据", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
HSSFRow row1 = sheet.createRow(0);
for (int i = 0; i < columnNames.length; i++) {
HSSFCell createCell = row1.createCell(i);
createCell.setCellValue(columnNames[i]);
createCell.setCellStyle(style);
}
for (int i = 0; i < list.size(); i++) {
HSSFRow createRow = sheet.createRow(i+1);
HSSFCell createCell = createRow.createCell(0);
createCell.setCellStyle(style3);
createCell.setCellValue(list.get(i).getItem());
HSSFCell cell = createRow.createCell(1);
cell.setCellStyle(style2);
HSSFSheet sheet = util.exportExcel(workbook,"运营分析-图例数据", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
HSSFCell cell3 = createRow.createCell(2);
cell3.setCellStyle(style3);
}
// HSSFSheet sheet = util.exportExcel(workbook,"运营分析-图例数据", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
sqlSession.commit();
sqlSession.close();
......
......@@ -2,12 +2,18 @@ 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.hslf.model.Sheet;
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.EarlyCancerHospitalDTO;
import com.sict.excel.dto.ScreeningRankProvinceDTO;
......@@ -19,22 +25,167 @@ public class AnalysisHospitalEarlyCancerExcel {
public static HSSFSheet getsheet6(HSSFWorkbook workbook) throws IOException {
SqlSession sqlSession = SqlSessionUtil.getSession();
SqlSession sqlSession = SqlSessionUtil.getSession();
DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class);
ExportExcelUtil<EarlyCancerHospitalDTO> util = new ExportExcelUtil<EarlyCancerHospitalDTO>();
// ExportExcelUtil<EarlyCancerHospitalDTO> util = new
// ExportExcelUtil<EarlyCancerHospitalDTO>();
String[] columnNames = {"排名","医院名称","省份","合计","高级别食管粘膜上皮内瘤变","早期食管癌","进展期食管癌","高级别胃粘膜上皮内瘤病变","早期胃癌","进展期胃癌"};
String[] columnNames = { "排名", "医院名称", "省份", "合计", "高级别食管粘膜上皮内瘤变", "早期食管癌", "进展期食管癌", "高级别胃粘膜上皮内瘤病变", "早期胃癌",
"进展期胃癌" };
List<EarlyCancerHospitalDTO> list = mapper.geteaCancerHospitals();
HSSFSheet sheet = workbook.createSheet("运营分析-医院早癌 胃癌数");
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("宋体");
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);// 粗体显示
style.setFont(font);// 把字体 应用到当前样式
// String path = "E:/2019/excel/" + "运营分析-医院早癌 胃癌数.xls";
HSSFSheet sheet = util.exportExcel(workbook,"运营分析-医院早癌 胃癌数", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
sqlSession.commit();
HSSFCellStyle style2 = workbook.createCellStyle();
// 设置这些样式
style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_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();
font2.setFontHeightInPoints((short) 11);
font2.setColor(IndexedColors.AUTOMATIC.getIndex());
font2.setFontName("宋体");
style2.setFont(font2);// 把字体 应用到当前样式
HSSFRow row = sheet.createRow(0);
for (int i = 0; i < columnNames.length; i++) {
HSSFCell cell = row.createCell(i);
cell.setCellValue(columnNames[i]);
cell.setCellStyle(style);
}
sqlSession.close();
for (int i = 0; i < list.size(); i++) {
HSSFRow row2 = sheet.createRow(i+1);
HSSFCell cell = row2.createCell(0);
cell.setCellStyle(style2);
cell.setCellValue(list.get(i).getId()+"");
HSSFCell cell1 = row2.createCell(1);
cell1.setCellStyle(style2);
cell1.setCellValue(list.get(i).getHospname());
HSSFCell cell2 = row2.createCell(2);
cell2.setCellStyle(style2);
cell2.setCellValue(list.get(i).getProvince());
HSSFCell cell3 = row2.createCell(3);
cell3.setCellStyle(style2);
cell3.setCellValue(list.get(i).getTotal()+"");
HSSFCell cell4 = row2.createCell(4);
cell4.setCellStyle(style2);
cell4.setCellValue(list.get(i).getHighEsophagealNeoplasia()>0?list.get(i).getHighEsophagealNeoplasia()+"":"");
HSSFCell cell5 = row2.createCell(5);
cell5.setCellStyle(style2);
cell5.setCellValue(list.get(i).getEarlyEsophagealCancer()>0?list.get(i).getEarlyEsophagealCancer()+"":"");
HSSFCell cell6 = row2.createCell(6);
cell6.setCellStyle(style2);
cell6.setCellValue(list.get(i).getAdvancedEsophagealCancer()>0?list.get(i).getAdvancedEsophagealCancer()+"":"");
HSSFCell cell7 = row2.createCell(7);
cell7.setCellStyle(style2);
cell7.setCellValue(list.get(i).getHighGastricNeoplasia()>0?list.get(i).getHighGastricNeoplasia()+"":"");
HSSFCell cell8 = row2.createCell(8);
cell8.setCellStyle(style2);
cell8.setCellValue(list.get(i).getEarlyGastricCancer()>0?list.get(i).getEarlyGastricCancer()+"":"");
HSSFCell cell9 = row2.createCell(9);
cell9.setCellStyle(style2);
cell9.setCellValue(list.get(i).getAdvancedGastricCancer()>0?list.get(i).getAdvancedGastricCancer()+"":"");
}
HSSFRow row2 = sheet.createRow(list.size()+1);
int total1=0,total2=0,total3=0,total4=0,total5=0,total6=0,total7=0;
for (int i = 0; i < list.size(); i++) {
total1 += list.get(i).getTotal();
}
for (int i = 0; i < list.size(); i++) {
total2 += list.get(i).getHighEsophagealNeoplasia();
}
for (int i = 0; i < list.size(); i++) {
total3 += list.get(i).getEarlyEsophagealCancer();
}
for (int i = 0; i < list.size(); i++) {
total4 += list.get(i).getAdvancedEsophagealCancer();
}
for (int i = 0; i < list.size(); i++) {
total5 += list.get(i).getHighGastricNeoplasia();
}
for (int i = 0; i < list.size(); i++) {
total6 += list.get(i).getEarlyGastricCancer();
}
for (int i = 0; i < list.size(); i++) {
total7 += list.get(i).getAdvancedGastricCancer();
}
HSSFCell cell1 = row2.createCell(0);
cell1.setCellStyle(style2);
cell1.setCellValue("合计");
HSSFCell cell2 = row2.createCell(1);
cell2.setCellStyle(style2);
HSSFCell cell3= row2.createCell(2);
cell3.setCellStyle(style2);
HSSFCell cell4=row2.createCell(3);
cell4.setCellValue(total1+"");
cell4.setCellStyle(style2);
HSSFCell cell5 = row2.createCell(4);
cell5.setCellStyle(style2);
cell5.setCellValue(total2+"");
HSSFCell cell6=row2.createCell(5);
cell6.setCellStyle(style2);
cell6.setCellValue(total3+"");
HSSFCell cell7 = row2.createCell(6);
cell7.setCellStyle(style2);
cell7.setCellValue(""+total4);
HSSFCell cell8 = row2.createCell(7);
cell8.setCellStyle(style2);
cell8.setCellValue(""+total5);
HSSFCell cell9 = row2.createCell(8);
cell9.setCellStyle(style2);
cell9.setCellValue(total6+"");
HSSFCell cell10 =row2.createCell(9);
cell10.setCellStyle(style2);
cell10.setCellValue(""+total7);
sheet.setColumnWidth(0, 10*256);
sheet.setColumnWidth(1, 30*256);
sheet.setColumnWidth(2, 10*256);
sheet.setColumnWidth(3, 10*256);
sheet.setColumnWidth(4, 30*256);
sheet.setColumnWidth(5, 10*256);
sheet.setColumnWidth(6, 10*256);
sheet.setColumnWidth(7, 30*256);
sheet.setColumnWidth(8, 10*256);
sheet.setColumnWidth(9, 10*256);
sqlSession.commit();
sqlSession.close();
return sheet;
}
......
......@@ -5,8 +5,13 @@ import java.io.IOException;
import java.util.List;
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.AnalysisProvinceDTO;
import com.sict.excel.mapper.DownloadMapper;
......@@ -21,14 +26,71 @@ public class AnalysisProvinceExcel {
DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class);
ExportExcelUtil<AnalysisProvinceDTO> util = new ExportExcelUtil<AnalysisProvinceDTO>();
HSSFSheet sheet = workbook.createSheet("运营分析-省份数据");
sheet.setDefaultColumnWidth(15);
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) 12);
font.setColor(IndexedColors.AUTOMATIC.getIndex());
font.setFontName("宋体");
style.setFont(font);// 把字体 应用到当前样式
HSSFCellStyle style2 = workbook.createCellStyle();
// 设置这些样式
style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 垂直居中
// 背景色
style2.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style2.setFillBackgroundColor(IndexedColors.YELLOW.getIndex());
// 设置边框
style2.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style2.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style2.setBorderRight(HSSFCellStyle.BORDER_THIN);
style2.setBorderTop(HSSFCellStyle.BORDER_THIN);
HSSFCellStyle style3 = workbook.createCellStyle();
// 设置这些样式
// 设置边框
style3.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style3.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style3.setBorderRight(HSSFCellStyle.BORDER_THIN);
style3.setBorderTop(HSSFCellStyle.BORDER_THIN);
HSSFRow row1 = sheet.createRow(0);
String[] columnNames = {"省份","申请医院总数 ","开通账号医院总数","申请账号中的医院总数","通过申请医院数","平台账号申请医院数","筛查人数","早癌数"};
for (int i = 0; i < columnNames.length; i++) {
HSSFCell createCell = row1.createCell(i);
createCell.setCellValue(columnNames[i]);
createCell.setCellStyle(style);
}
List<AnalysisProvinceDTO> list = mapper.getAnalysisProvinceDTOs();
AnalysisProvinceDTO l1 = new AnalysisProvinceDTO();
l1.setProvince("合计");
list.add(l1);
for (int i = 0; i < list.size(); i++) {
HSSFRow createRow = sheet.createRow(i+1);
HSSFCell createCell = createRow.createCell(0);
createCell.setCellValue(list.get(i).getProvince());
createCell.setCellStyle(style3);
HSSFCell cell = createRow.createCell(1);
cell.setCellStyle(style2);
for (int j = 2; j < columnNames.length; j++) {
HSSFCell cell2 = createRow.createCell(j);
cell2.setCellStyle(style3);
}
}
//String path = "E:/2019/excel/" + "运营分析-省份数据.xls";
HSSFSheet sheet = util.exportExcel(workbook,"运营分析-省份数据", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
sqlSession.commit();
sqlSession.close();
......
......@@ -4,8 +4,10 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.tools.ant.types.selectors.modifiedselector.EqualComparator;
import com.sict.excel.dto.EarlyCancerRankDTO;
import com.sict.excel.mapper.DownloadMapper;
......@@ -21,8 +23,17 @@ public class ProvinceEarlyCancerRankExcel {
ExportExcelUtil<EarlyCancerRankDTO> util = new ExportExcelUtil<EarlyCancerRankDTO>();
String[] columnNames = {"省份","早癌数"};
List<EarlyCancerRankDTO> list = mapper.getEarlyCancerRankDTOs();
//String path = "E:/2019/excel/" + "省份早癌排名.xls";
int total = 0;
for (int i = 0; i < list.size(); i++) {
total+=list.get(i).getECamount();
}
EarlyCancerRankDTO earlyCancerRankDTO = new EarlyCancerRankDTO();
earlyCancerRankDTO.setProvince("合计");
earlyCancerRankDTO.setECamount(total);
list.add(earlyCancerRankDTO);
HSSFSheet sheet = util.exportExcel(workbook,"省份早癌排名", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
sqlSession.commit();
sqlSession.close();
......
......@@ -4,6 +4,8 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
......@@ -22,8 +24,17 @@ public class ScreeningRankGecaExcel {
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);
int total =0;
for (int i = 0; i < list.size(); i++) {
total+=list.get(i).getActualserum();
}
HSSFSheet sheet = util.exportExcel(workbook,"门诊筛查排名-血检人数", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
HSSFRow row = sheet.createRow(list.size()+1);
HSSFCell cell = row.createCell(0);
cell.setCellValue("合计");
HSSFCell cell2 = row.createCell(2);
cell2.setCellValue(""+total);
sqlSession.commit();
sqlSession.close();
......
......@@ -5,6 +5,8 @@ import java.io.IOException;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
......@@ -26,9 +28,17 @@ public class ScreeningRankProvinceExcel {
String[] columnNames = {"排名","医院名称","省份","血检人数"};
List<ScreeningRankProvinceDTO> list = mapper.getScreeningRankProvinceDTOs();
int total =0;
for (int i = 0; i < list.size(); i++) {
total+=list.get(i).getActualserum();
}
//String path = "E:/2019/excel/" + "筛查排名-按血检人数排名.xls";
HSSFSheet sheet = util.exportExcel(workbook, "筛查排名-按血检人数排名", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
HSSFRow row = sheet.createRow(list.size()+1);
HSSFCell cell = row.createCell(0);
cell.setCellValue("合计");
HSSFCell cell2 = row.createCell(3);
cell2.setCellValue(""+total);
sqlSession.commit();
sqlSession.close();
......
......@@ -4,6 +4,8 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
......@@ -22,8 +24,16 @@ public class ScreeningRankQgExcel {
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);
int total =0;
for (int i = 0; i < list.size(); i++) {
total+=list.get(i).getActualserum();
}
HSSFSheet sheet = util.exportExcel(workbook,"体检筛查排名-血检人数", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
HSSFRow row = sheet.createRow(list.size()+1);
HSSFCell cell = row.createCell(0);
cell.setCellValue("合计");
HSSFCell cell2 = row.createCell(2);
cell2.setCellValue(""+total);
sqlSession.commit();
sqlSession.close();
......
......@@ -4,6 +4,8 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
......@@ -22,8 +24,16 @@ public class ScreeningRankShchyyExcel {
ExportExcelUtil<ScreeningRankDTO> util = new ExportExcelUtil<ScreeningRankDTO>();
String[] columnNames = {"排名","医联体名称","血检人数"};
List<ScreeningRankDTO> list = mapper.getScreeningRankDTOs();
String path = "E:/2019/excel/" + "社区筛查排名-血检人数.xls";
int total =0;
for (int i = 0; i < list.size(); i++) {
total+=list.get(i).getActualserum();
}
HSSFSheet sheet = util.exportExcel(workbook,"社区筛查排名-血检人数", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007);
HSSFRow row = sheet.createRow(list.size()+1);
HSSFCell cell = row.createCell(0);
cell.setCellValue("合计");
HSSFCell cell2 = row.createCell(2);
cell2.setCellValue(""+total);
sqlSession.commit();
sqlSession.close();
return sheet;
......
......@@ -135,7 +135,7 @@ public class SerumTest {
cell91.setCellStyle(style3);
HSSFCell cell92 = row9.createCell(1);
cell92.setCellStyle(style3);
cell92.setCellValue(qgInteger+"");
cell92.setCellValue(gecaintInteger+"");
HSSFRow row10 = sheet.createRow(9);//9行
HSSFCell cell101 = row10.createCell(0);
......@@ -144,7 +144,7 @@ public class SerumTest {
cell101.setCellStyle(style3);
HSSFCell cell102 = row10.createCell(1);
cell102.setCellStyle(style3);
cell102.setCellValue(gecaintInteger+"");
cell102.setCellValue(qgInteger+"");
HSSFRow row11= sheet.createRow(10);//10行
HSSFCell cell111 = row11.createCell(0);
......
......@@ -163,68 +163,73 @@
<select id="geteaCancerHospitals"
resultType="com.sict.excel.dto.EarlyCancerHospitalDTO">
SELECT (@rowNO := @rowNo+1) AS id,a.*
FROM(
SELECT
hospName as
hospname,
(@rowNO := @rowNo + 1) AS id,
a.*
FROM
(
SELECT
hospName AS hospname,
area province,
(
count( gastroDetailInfo LIKE '%"a":1%' OR NULL
count(
gastroDetailInfo LIKE '%"a":1%'
OR NULL
) + count(
gastroDetailInfo LIKE '%"b":1%'
OR NULL
) + count(
gastroDetailInfo LIKE '%"b":1%' OR NULL ) + count(
gastroDetailInfo
LIKE '%"c":1%' OR NULL ) + count( gastroDetailInfo
LIKE '%"d":1%' OR
NULL ) + count( gastroDetailInfo LIKE '%"e":1%' OR
NULL ) + count(
gastroDetailInfo LIKE '%"f":1%' OR NULL ) + count(
gastroDetailInfo
LIKE '%"g":1%' OR NULL ) + count( gastroDetailInfo
LIKE '%"h":1%' OR
NULL ) + count( gastroDetailInfo LIKE '%"i":1%' OR
NULL ) + count(
gastroDetailInfo LIKE '%"j":1%' OR NULL ) + count(
gastroDetailInfo
LIKE '%"k":1%' OR NULL ) + count( gastroDetailInfo
LIKE '%"l":1%' OR
NULL ) + count( gastroDetailInfo LIKE '%"m":1%' OR
NULL ) + count(
gastroDetailInfo LIKE '%"n":%' OR NULL )
gastroDetailInfo LIKE '%"c":1%'
OR NULL
) + count(
gastroDetailInfo LIKE '%"f":1%'
OR NULL
) + count(
gastroDetailInfo LIKE '%"g":1%'
OR NULL
) + count(
gastroDetailInfo LIKE '%"h":1%'
OR NULL
)
) total,
count(
gastroDetailInfo LIKE '%"a":1%' OR NULL ) AS highEsophagealNeoplasia,
count( gastroDetailInfo LIKE '%"b":1%' OR NULL ) AS
earlyEsophagealCancer,
count( gastroDetailInfo LIKE '%"c":1%' OR NULL )
AS
advancedEsophagealCancer,
count( gastroDetailInfo LIKE '%"f":1%' OR
NULL ) AS highGastricNeoplasia,
count( gastroDetailInfo LIKE '%"g":1%'
OR NULL ) AS
earlyGastricCancer,
count( gastroDetailInfo LIKE '%"h":1%'
OR NULL ) AS advancedGastricCancer
gastroDetailInfo LIKE '%"a":1%'
OR NULL
) AS highEsophagealNeoplasia,
count(
gastroDetailInfo LIKE '%"b":1%'
OR NULL
) AS earlyEsophagealCancer,
count(
gastroDetailInfo LIKE '%"c":1%'
OR NULL
) AS advancedEsophagealCancer,
count(
gastroDetailInfo LIKE '%"f":1%'
OR NULL
) AS highGastricNeoplasia,
count(
gastroDetailInfo LIKE '%"g":1%'
OR NULL
) AS earlyGastricCancer,
count(
gastroDetailInfo LIKE '%"h":1%'
OR NULL
) AS advancedGastricCancer
FROM
(
SELECT
p.id patientId,
rel2.number hospNumber,
rel2.`name` hospName,
rel1.step
gastroStep,
rel1.step gastroStep,
rel1.is_inspect isGastro,
rel1.inspect_way gastroWay,
rel1.capsule
gastroResult,
rel1.capsule gastroResult,
rel1.precise_way gastroDetailWay,
rel1.diagnose_result
gastroDetailResult,
rel1.diagnose_info
gastroDetailInfo,
rel1.`status`
auditStatus,
rel1.diagnose_result gastroDetailResult,
rel1.diagnose_info gastroDetailInfo,
rel1.`status` auditStatus,
rel3.area
FROM
tb_patient p
......@@ -243,23 +248,25 @@
tb_gastro_inspect
WHERE
is_inspect = 1
AND
`status` NOT IN ( 0, 5 )
AND `status` NOT IN (0, 5)
AND diagnose_result = 1
) rel1 ON
rel1.patient_id = p.id
INNER JOIN ( SELECT `name`, number FROM
tb_hosp )
rel2 ON rel2.number = p.hosp_number
INNER JOIN tmp_tb_hosp_area rel3 ON
rel2.`name` = rel3.`name`
) rel1 ON rel1.patient_id = p.id
INNER JOIN (
SELECT
`name`,
number
FROM
tb_hosp
) rel2 ON rel2.number = p.hosp_number
INNER JOIN tmp_tb_hosp_area rel3 ON rel2.`name` = rel3.`name`
) rel
GROUP BY
hospName
ORDER BY
earlyGastricCancer DESC
) a,
(select @rowNO :=0) b
(SELECT @rowNO := 0) b
WHERE total >0
ORDER BY
total DESC
</select>
<!-- 运营分析-省份数据 -->
......@@ -594,7 +601,8 @@
COUNT(NULL) actual
FROM
tb_patient p1 INNER JOIN tb_risk_assess p2
ON p1.id = p2.patient_id RIGHT JOIN (SELECT `name`,number FROM tb_hosp
ON
p1.id = p2.patient_id RIGHT JOIN (SELECT `name`,number FROM tb_hosp
)rel2 ON rel2.number = p1.hosp_number
WHERE p2.grade > 1
AND p2.step = 0
......@@ -687,7 +695,8 @@
AND diagnose_result = 1
) rel1 ON
rel1.patient_id = p.id
INNER JOIN (SELECT `name`,number FROM tb_hosp )rel2 ON rel2.number =
INNER JOIN (SELECT `name`,number FROM tb_hosp
)rel2 ON rel2.number =
p.hosp_number
) rel
......@@ -718,7 +727,9 @@
patient_id, score,
grade FROM tb_risk_assess ) rel1 ON
rel1.patient_id = p.id
INNER JOIN (SELECT `name`,number FROM tb_hosp )rel2 ON rel2.number = p.hosp_number
INNER JOIN
(SELECT `name`,number FROM tb_hosp )rel2 ON rel2.number =
p.hosp_number
) rel
GROUP BY
胃癌患病风险等级
......
#Generated by Maven Integration for Eclipse
#Fri Nov 29 10:09:37 CST 2019
#Fri Nov 29 11:00:23 CST 2019
version=1.0-SNAPSHOT
groupId=download
m2e.projectName=download
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -163,68 +163,73 @@
<select id="geteaCancerHospitals"
resultType="com.sict.excel.dto.EarlyCancerHospitalDTO">
SELECT (@rowNO := @rowNo+1) AS id,a.*
FROM(
SELECT
hospName as
hospname,
(@rowNO := @rowNo + 1) AS id,
a.*
FROM
(
SELECT
hospName AS hospname,
area province,
(
count( gastroDetailInfo LIKE '%"a":1%' OR NULL
count(
gastroDetailInfo LIKE '%"a":1%'
OR NULL
) + count(
gastroDetailInfo LIKE '%"b":1%'
OR NULL
) + count(
gastroDetailInfo LIKE '%"b":1%' OR NULL ) + count(
gastroDetailInfo
LIKE '%"c":1%' OR NULL ) + count( gastroDetailInfo
LIKE '%"d":1%' OR
NULL ) + count( gastroDetailInfo LIKE '%"e":1%' OR
NULL ) + count(
gastroDetailInfo LIKE '%"f":1%' OR NULL ) + count(
gastroDetailInfo
LIKE '%"g":1%' OR NULL ) + count( gastroDetailInfo
LIKE '%"h":1%' OR
NULL ) + count( gastroDetailInfo LIKE '%"i":1%' OR
NULL ) + count(
gastroDetailInfo LIKE '%"j":1%' OR NULL ) + count(
gastroDetailInfo
LIKE '%"k":1%' OR NULL ) + count( gastroDetailInfo
LIKE '%"l":1%' OR
NULL ) + count( gastroDetailInfo LIKE '%"m":1%' OR
NULL ) + count(
gastroDetailInfo LIKE '%"n":%' OR NULL )
gastroDetailInfo LIKE '%"c":1%'
OR NULL
) + count(
gastroDetailInfo LIKE '%"f":1%'
OR NULL
) + count(
gastroDetailInfo LIKE '%"g":1%'
OR NULL
) + count(
gastroDetailInfo LIKE '%"h":1%'
OR NULL
)
) total,
count(
gastroDetailInfo LIKE '%"a":1%' OR NULL ) AS highEsophagealNeoplasia,
count( gastroDetailInfo LIKE '%"b":1%' OR NULL ) AS
earlyEsophagealCancer,
count( gastroDetailInfo LIKE '%"c":1%' OR NULL )
AS
advancedEsophagealCancer,
count( gastroDetailInfo LIKE '%"f":1%' OR
NULL ) AS highGastricNeoplasia,
count( gastroDetailInfo LIKE '%"g":1%'
OR NULL ) AS
earlyGastricCancer,
count( gastroDetailInfo LIKE '%"h":1%'
OR NULL ) AS advancedGastricCancer
gastroDetailInfo LIKE '%"a":1%'
OR NULL
) AS highEsophagealNeoplasia,
count(
gastroDetailInfo LIKE '%"b":1%'
OR NULL
) AS earlyEsophagealCancer,
count(
gastroDetailInfo LIKE '%"c":1%'
OR NULL
) AS advancedEsophagealCancer,
count(
gastroDetailInfo LIKE '%"f":1%'
OR NULL
) AS highGastricNeoplasia,
count(
gastroDetailInfo LIKE '%"g":1%'
OR NULL
) AS earlyGastricCancer,
count(
gastroDetailInfo LIKE '%"h":1%'
OR NULL
) AS advancedGastricCancer
FROM
(
SELECT
p.id patientId,
rel2.number hospNumber,
rel2.`name` hospName,
rel1.step
gastroStep,
rel1.step gastroStep,
rel1.is_inspect isGastro,
rel1.inspect_way gastroWay,
rel1.capsule
gastroResult,
rel1.capsule gastroResult,
rel1.precise_way gastroDetailWay,
rel1.diagnose_result
gastroDetailResult,
rel1.diagnose_info
gastroDetailInfo,
rel1.`status`
auditStatus,
rel1.diagnose_result gastroDetailResult,
rel1.diagnose_info gastroDetailInfo,
rel1.`status` auditStatus,
rel3.area
FROM
tb_patient p
......@@ -243,23 +248,25 @@
tb_gastro_inspect
WHERE
is_inspect = 1
AND
`status` NOT IN ( 0, 5 )
AND `status` NOT IN (0, 5)
AND diagnose_result = 1
) rel1 ON
rel1.patient_id = p.id
INNER JOIN ( SELECT `name`, number FROM
tb_hosp )
rel2 ON rel2.number = p.hosp_number
INNER JOIN tmp_tb_hosp_area rel3 ON
rel2.`name` = rel3.`name`
) rel1 ON rel1.patient_id = p.id
INNER JOIN (
SELECT
`name`,
number
FROM
tb_hosp
) rel2 ON rel2.number = p.hosp_number
INNER JOIN tmp_tb_hosp_area rel3 ON rel2.`name` = rel3.`name`
) rel
GROUP BY
hospName
ORDER BY
earlyGastricCancer DESC
) a,
(select @rowNO :=0) b
(SELECT @rowNO := 0) b
WHERE total >0
ORDER BY
total DESC
</select>
<!-- 运营分析-省份数据 -->
......@@ -594,7 +601,8 @@
COUNT(NULL) actual
FROM
tb_patient p1 INNER JOIN tb_risk_assess p2
ON p1.id = p2.patient_id RIGHT JOIN (SELECT `name`,number FROM tb_hosp
ON
p1.id = p2.patient_id RIGHT JOIN (SELECT `name`,number FROM tb_hosp
)rel2 ON rel2.number = p1.hosp_number
WHERE p2.grade > 1
AND p2.step = 0
......@@ -687,7 +695,8 @@
AND diagnose_result = 1
) rel1 ON
rel1.patient_id = p.id
INNER JOIN (SELECT `name`,number FROM tb_hosp )rel2 ON rel2.number =
INNER JOIN (SELECT `name`,number FROM tb_hosp
)rel2 ON rel2.number =
p.hosp_number
) rel
......@@ -718,7 +727,9 @@
patient_id, score,
grade FROM tb_risk_assess ) rel1 ON
rel1.patient_id = p.id
INNER JOIN (SELECT `name`,number FROM tb_hosp )rel2 ON rel2.number = p.hosp_number
INNER JOIN
(SELECT `name`,number FROM tb_hosp )rel2 ON rel2.number =
p.hosp_number
) rel
GROUP BY
胃癌患病风险等级
......
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