|  | @ -2,6 +2,7 @@ package com.yihu.jw.es.service.yqfk;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.date.DateUtil;
 | 
	
		
			
				|  |  | import org.slf4j.Logger;
 | 
	
		
			
				|  |  | import org.slf4j.LoggerFactory;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
	
		
			
				|  | @ -34,34 +35,123 @@ public class YqfkService {
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public JSONObject yqfkStatisticsHead(String startTime,String endTime){
 | 
	
		
			
				|  |  |         JSONObject object = new JSONObject();
 | 
	
		
			
				|  |  |         String sql = "select COUNT(1) as confirmedTotal from MID_CDC_CASE_INFO where ";
 | 
	
		
			
				|  |  |         object.put("confirmed","");//现有确诊
 | 
	
		
			
				|  |  |         object.put("newHome","");//新增本土
 | 
	
		
			
				|  |  |         object.put("newAsymptomatic","");//新增无症状;
 | 
	
		
			
				|  |  |         object.put("confirmedTotal","");//累计确诊
 | 
	
		
			
				|  |  |         object.put("cureTotal","");//累计治愈
 | 
	
		
			
				|  |  |         object.put("deathTotal","");//累计死亡
 | 
	
		
			
				|  |  |         //现有确诊
 | 
	
		
			
				|  |  |         String nowConfirmedSql = "select COUNT(1) as confirmedTotal from MID_CDC_CASE_INFO where dim_cond not in('出院','死亡')";
 | 
	
		
			
				|  |  |         Map<String,Object> confirmedMap = jdbcTemplate.queryForMap(nowConfirmedSql);
 | 
	
		
			
				|  |  |         Integer newConfirmedTotal = 0;
 | 
	
		
			
				|  |  |         if (confirmedMap!=null){
 | 
	
		
			
				|  |  |             newConfirmedTotal=Integer.parseInt(confirmedMap.get("confirmedTotal").toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         //新增本土
 | 
	
		
			
				|  |  |         String newHomeSql = "select COUNT(1) as newHomeTotal from MID_CDC_CASE_INFO where dim_cond not in('出院','死亡') and diag_time >='"+ DateUtil.getStringDateShort()+" 00:00:00"+"'"+" and diag_time >='"+ DateUtil.getStringDateShort()+" 23:59:59"+"'";
 | 
	
		
			
				|  |  |         Map<String,Object> newHomeMap = jdbcTemplate.queryForMap(newHomeSql);
 | 
	
		
			
				|  |  |         Integer newHomeTotal = 0;
 | 
	
		
			
				|  |  |         if (newHomeMap!=null){
 | 
	
		
			
				|  |  |             newHomeTotal=Integer.parseInt(newHomeMap.get("newHomeTotal").toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         //新增无症状
 | 
	
		
			
				|  |  |         String newAsymptomaticSql = "select COUNT(1) as newAsymptomaticTotal from MID_CDC_CASE_INFO where dim_cond in('无症状') and diag_time >='"+ DateUtil.getStringDateShort()+" 00:00:00"+"'"+" and diag_time >='"+ DateUtil.getStringDateShort()+" 23:59:59"+"'";
 | 
	
		
			
				|  |  |         Map<String,Object> newAsymptomaticeMap = jdbcTemplate.queryForMap(newAsymptomaticSql);
 | 
	
		
			
				|  |  |         Integer newAsymptomaticTotal = 0;
 | 
	
		
			
				|  |  |         if (newAsymptomaticeMap!=null){
 | 
	
		
			
				|  |  |             newAsymptomaticTotal=Integer.parseInt(newAsymptomaticeMap.get("newAsymptomaticTotal").toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         //累计确诊
 | 
	
		
			
				|  |  |         String confirmedTotalSql = "select COUNT(1) as confirmedTotal from MID_CDC_CASE_INFO ";
 | 
	
		
			
				|  |  |         Map<String,Object> confirmedTotalMap = jdbcTemplate.queryForMap(confirmedTotalSql);
 | 
	
		
			
				|  |  |         Integer confirmedTotalTotal = 0;
 | 
	
		
			
				|  |  |         if (confirmedTotalMap!=null){
 | 
	
		
			
				|  |  |             confirmedTotalTotal=Integer.parseInt(confirmedTotalMap.get("confirmedTotal").toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         //累计治愈
 | 
	
		
			
				|  |  |         String cureTotalSql = "select COUNT(1) as cureTotal from MID_CDC_CASE_INFO where dim_cond in('出院') ";
 | 
	
		
			
				|  |  |         Map<String,Object> cureTotalMap = jdbcTemplate.queryForMap(cureTotalSql);
 | 
	
		
			
				|  |  |         Integer cureTotalTotal = 0;
 | 
	
		
			
				|  |  |         if (cureTotalMap!=null){
 | 
	
		
			
				|  |  |             cureTotalTotal=Integer.parseInt(cureTotalMap.get("cureTotal").toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         //累计治愈
 | 
	
		
			
				|  |  |         String deathTotalSql = "select COUNT(1) as deathTotal from MID_CDC_CASE_INFO where dim_cond in('死亡') ";
 | 
	
		
			
				|  |  |         Map<String,Object> deathTotalMap = jdbcTemplate.queryForMap(deathTotalSql);
 | 
	
		
			
				|  |  |         Integer deathTotalTotal = 0;
 | 
	
		
			
				|  |  |         if (deathTotalMap!=null){
 | 
	
		
			
				|  |  |             deathTotalTotal=Integer.parseInt(deathTotalMap.get("deathTotal").toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         object.put("confirmed",newConfirmedTotal);//现有确诊
 | 
	
		
			
				|  |  |         object.put("newHome",newHomeTotal);//新增本土
 | 
	
		
			
				|  |  |         object.put("newAsymptomatic",newAsymptomaticTotal);//新增无症状;
 | 
	
		
			
				|  |  |         object.put("confirmedTotal",confirmedTotalTotal);//累计确诊
 | 
	
		
			
				|  |  |         object.put("cureTotal",cureTotalTotal);//累计治愈
 | 
	
		
			
				|  |  |         object.put("deathTotal",deathTotalTotal);//累计死亡
 | 
	
		
			
				|  |  |         return object;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 疫情防控底部-密接次接数据统计
 | 
	
		
			
				|  |  |      * @param startTime
 | 
	
		
			
				|  |  |      * @param endTime
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public JSONObject yqfkStatisticsTail(String startTime,String endTime){
 | 
	
		
			
				|  |  |         JSONObject object = new JSONObject();
 | 
	
		
			
				|  |  |         JSONObject MjObject = new JSONObject();//在厦密接
 | 
	
		
			
				|  |  |         MjObject.put("zyTotal","");//正转运
 | 
	
		
			
				|  |  |         MjObject.put("jdTotal","");//在酒店/已采核酸
 | 
	
		
			
				|  |  |         MjObject.put("dlsTotal","");//待落实
 | 
	
		
			
				|  |  |         MjObject.put("total","");//总计
 | 
	
		
			
				|  |  |         //密接已隔离
 | 
	
		
			
				|  |  |         String mjGlSql = "select count(1) as \"glTotal\" from MID_CDC_CCC_INFO where start_ios_time is not null  ";
 | 
	
		
			
				|  |  |         Map<String,Object> mjglMap= jdbcTemplate.queryForMap(mjGlSql);
 | 
	
		
			
				|  |  |         Integer mjglTotal = 0;
 | 
	
		
			
				|  |  |         if (mjglMap!=null){
 | 
	
		
			
				|  |  |             mjglTotal = Integer.parseInt(mjglMap.get("glTotal").toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         //密接待落实
 | 
	
		
			
				|  |  |         String mjDlsSql = "select count(1) as \"dlsTotal\" from MID_CDC_CCC_INFO where dim_imp_stat NOT IN('落实')  ";
 | 
	
		
			
				|  |  |         Map<String,Object> mjdlsMap= jdbcTemplate.queryForMap(mjDlsSql);
 | 
	
		
			
				|  |  |         Integer mjDlsTotal = 0;
 | 
	
		
			
				|  |  |         if (mjdlsMap!=null){
 | 
	
		
			
				|  |  |             mjDlsTotal = Integer.parseInt(mjdlsMap.get("dlsTotal").toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         /*   MjObject.put("zyTotal","");//正转运*/
 | 
	
		
			
				|  |  |         MjObject.put("glTotal",mjglTotal);//已隔离
 | 
	
		
			
				|  |  |         MjObject.put("dlsTotal",mjDlsTotal);//待落实
 | 
	
		
			
				|  |  |         MjObject.put("total",mjglTotal+mjDlsTotal);//总计
 | 
	
		
			
				|  |  |         //次密接已隔离
 | 
	
		
			
				|  |  |         String cmglSql = "select count(1) as \"glTotal\" from MID_CDC_CCC_SED_INFO where start_ios_time is not null  ";
 | 
	
		
			
				|  |  |         Map<String,Object> cmglMap= jdbcTemplate.queryForMap(cmglSql);
 | 
	
		
			
				|  |  |         Integer cmglTotal = 0;
 | 
	
		
			
				|  |  |         if (cmglMap!=null){
 | 
	
		
			
				|  |  |             cmglTotal = Integer.parseInt(cmglMap.get("glTotal").toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         //次密接待落实
 | 
	
		
			
				|  |  |         String cmDlsSql = "select count(1) as \"dlsTotal\" from MID_CDC_CCC_INFO where dim_imp_stat NOT IN('落实')  ";
 | 
	
		
			
				|  |  |         Map<String,Object> cmdlsMap= jdbcTemplate.queryForMap(cmDlsSql);
 | 
	
		
			
				|  |  |         Integer cmDlsTotal = 0;
 | 
	
		
			
				|  |  |         if (cmdlsMap!=null){
 | 
	
		
			
				|  |  |             cmDlsTotal = Integer.parseInt(cmdlsMap.get("dlsTotal").toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         JSONObject CmObject = new JSONObject();//在厦次密
 | 
	
		
			
				|  |  |         CmObject.put("zyTotal","");//正转运
 | 
	
		
			
				|  |  |         CmObject.put("jdTotal","");//在酒店/已采核酸
 | 
	
		
			
				|  |  |         CmObject.put("dlsTotal","");//待落实
 | 
	
		
			
				|  |  |         CmObject.put("total","");//总计
 | 
	
		
			
				|  |  |       /*  CmObject.put("zyTotal","");//正转运*/
 | 
	
		
			
				|  |  |         CmObject.put("glTotal",cmglTotal);//已隔离
 | 
	
		
			
				|  |  |         CmObject.put("dlsTotal",cmDlsTotal);//待落实
 | 
	
		
			
				|  |  |         CmObject.put("total",cmglTotal+cmDlsTotal);//总计
 | 
	
		
			
				|  |  |         //一般密接已隔离
 | 
	
		
			
				|  |  |         String ybglSql = "select count(1) as \"glTotal\" from MID_KEYNOTE_CROWD_INFO where start_ios_time is not null  ";
 | 
	
		
			
				|  |  |         Map<String,Object> ybglMap= jdbcTemplate.queryForMap(ybglSql);
 | 
	
		
			
				|  |  |         Integer ybglTotal = 0;
 | 
	
		
			
				|  |  |         if (ybglMap!=null){
 | 
	
		
			
				|  |  |             ybglTotal = Integer.parseInt(ybglMap.get("glTotal").toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         //一般密接待落实
 | 
	
		
			
				|  |  |         String ybDlsSql = "select count(1) as \"dlsTotal\" from MID_CDC_CCC_INFO where dim_imp_stat NOT IN('落实')  ";
 | 
	
		
			
				|  |  |         Map<String,Object> ybdlsMap= jdbcTemplate.queryForMap(ybDlsSql);
 | 
	
		
			
				|  |  |         Integer ybDlsTotal = 0;
 | 
	
		
			
				|  |  |         if (ybdlsMap!=null){
 | 
	
		
			
				|  |  |             ybDlsTotal = Integer.parseInt(ybdlsMap.get("dlsTotal").toString());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         JSONObject ybObject = new JSONObject();//在厦一般接触者
 | 
	
		
			
				|  |  |         ybObject.put("zyTotal","");//正转运
 | 
	
		
			
				|  |  |         ybObject.put("jdTotal","");//在酒店/已采核酸
 | 
	
		
			
				|  |  |         ybObject.put("dlsTotal","");//待落实
 | 
	
		
			
				|  |  |         ybObject.put("total","");//总计
 | 
	
		
			
				|  |  | /*        ybObject.put("zyTotal","");//正转运*/
 | 
	
		
			
				|  |  |         ybObject.put("jdTotal",ybglTotal);//已隔离
 | 
	
		
			
				|  |  |         ybObject.put("dlsTotal",ybDlsTotal);//待落实
 | 
	
		
			
				|  |  |         ybObject.put("total",ybDlsTotal+ybglTotal);//总计
 | 
	
		
			
				|  |  |         object.put("MjObject",MjObject);
 | 
	
		
			
				|  |  |         object.put("CmObject", CmObject);
 | 
	
		
			
				|  |  |         object.put("ybObject",ybObject);
 | 
	
	
		
			
				|  | @ -69,8 +159,24 @@ public class YqfkService {
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 确诊人数详情
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public  List<Map<String, Object>> confirmedList(){
 | 
	
		
			
				|  |  |         String confirmedListSql = "select PATIENT_ID as \"patientId\",PATIENT_NAME as \"patientName\",PATIENT_SEX as \"patientSex\",PATIENT_AGE as \"patientAge\",DIAG_TIME as \"diagTime\" from MID_CDC_CASE_INFO ";
 | 
	
		
			
				|  |  |         String confirmedListSql = "SELECT\n" +
 | 
	
		
			
				|  |  |                 "\tmd.PATIENT_ID AS \"patientId\",\n" +
 | 
	
		
			
				|  |  |                 "\tmd.PATIENT_NAME AS \"patientName\",\n" +
 | 
	
		
			
				|  |  |                 "\tmd.PATIENT_SEX AS \"patientSex\",\n" +
 | 
	
		
			
				|  |  |                 "\tmd.PATIENT_AGE AS \"patientAge\",\n" +
 | 
	
		
			
				|  |  |                 "\tmd.DIAG_TIME AS \"diagTime\",\n" +
 | 
	
		
			
				|  |  |                 "\tmd.DIM_COND As \"dimCond\",\n" +
 | 
	
		
			
				|  |  |                 "\tp.DIM_PROV_NAME as \"dimProvName\",\n" +
 | 
	
		
			
				|  |  |                 "\ta.DIM_AREA_NAME as \"dimAreaName\"\n" +
 | 
	
		
			
				|  |  |                 "FROM\n" +
 | 
	
		
			
				|  |  |                 "\tMID_CDC_CASE_INFO md\n" +
 | 
	
		
			
				|  |  |                 "LEFT JOIN DIM_PROV_DICT p ON p.DIM_PROV = md.DIM_CS_PROV\n" +
 | 
	
		
			
				|  |  |                 "LEFT JOIN DIM_AREA_DICT a ON a.DIM_AREA = md.DIM_CS_AREA ";
 | 
	
		
			
				|  |  |         List<Map<String, Object>> confirmedList = jdbcTemplate.queryForList(confirmedListSql);
 | 
	
		
			
				|  |  |         if (confirmedList!=null&&confirmedList.size()!=0){
 | 
	
		
			
				|  |  |             for (Map<String,Object> map:confirmedList){
 |