|
@ -3,9 +3,11 @@ package com.yihu.wlyy.statistics.etl.mycache;
|
|
|
import com.yihu.wlyy.statistics.dao.SignPatientLabelInfoDao;
|
|
|
import com.yihu.wlyy.statistics.etl.extract.DBExtract;
|
|
|
import com.yihu.wlyy.statistics.etl.model.CacheModel;
|
|
|
import com.yihu.wlyy.statistics.etl.model.RenewCacheModel;
|
|
|
import com.yihu.wlyy.statistics.job.business.Constant;
|
|
|
import com.yihu.wlyy.statistics.model.label.SignPatientLabelInfo;
|
|
|
import com.yihu.wlyy.statistics.model.signfamily.SignFamily;
|
|
|
import com.yihu.wlyy.statistics.model.signfamily.SignFamilyRenew;
|
|
|
import com.yihu.wlyy.statistics.model.signfamily.SignFamilyServer;
|
|
|
import com.yihu.wlyy.statistics.util.SpringUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -29,6 +31,26 @@ public class CachePool {
|
|
|
*/
|
|
|
private static Map<String, CacheModel> arriveSignFamilyExpenseStatus1Map = new HashMap<String, CacheModel>();
|
|
|
|
|
|
/**
|
|
|
* 续签城市达量的缓存 key 是时间yyyy-MM-dd
|
|
|
*/
|
|
|
private static Map<String, RenewCacheModel> arriveRenewTotalCityMap = new HashMap<String, RenewCacheModel>();
|
|
|
|
|
|
/**
|
|
|
* 续签城镇达量的缓存 key 是时间yyyy-MM-dd
|
|
|
*/
|
|
|
private static Map<String, RenewCacheModel> arriveRenewTotalTownMap = new HashMap<String, RenewCacheModel>();
|
|
|
|
|
|
/**
|
|
|
* 续签机构达量的缓存 key 是时间yyyy-MM-dd
|
|
|
*/
|
|
|
private static Map<String, RenewCacheModel> arriveRenewTotalOrgMap = new HashMap<String, RenewCacheModel>();
|
|
|
|
|
|
/**
|
|
|
* 续签团队达量的缓存 key 是时间yyyy-MM-dd
|
|
|
*/
|
|
|
private static Map<String, RenewCacheModel> arriveRenewTotalTeamMap = new HashMap<String, RenewCacheModel>();
|
|
|
|
|
|
/**
|
|
|
* 分组标签的缓存 key 是患者code
|
|
|
*/
|
|
@ -256,4 +278,122 @@ public class CachePool {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取续签城市达量的缓存
|
|
|
*
|
|
|
* @param date
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public synchronized RenewCacheModel getArriveRenewTotalCityMapByDate(String date) throws Exception {
|
|
|
RenewCacheModel model = arriveRenewTotalCityMap.get(date);
|
|
|
if (model == null) {
|
|
|
model = new RenewCacheModel();
|
|
|
|
|
|
String sql=" select fr.sign_code code,fr.hospital ,fr.admin_team_id from wlyy_sign_family_renew_log fr where " +
|
|
|
" fr.apply_date<'"+ date + Constant.quota_date_last+"' " +
|
|
|
" and fr.sign_year ='"+Constant.getNowYearByDate(date)+"' " +
|
|
|
" and LENGTH(fr.hospital)=10 " +
|
|
|
" and LENGTH(fr.old_hospital)=10 ";
|
|
|
|
|
|
//抽取數據
|
|
|
List<SignFamilyRenew> signFamilies = SpringUtil.getBean(DBExtract.class).extract(SignFamilyRenew.class,sql);
|
|
|
model.setSql(sql);
|
|
|
model.setSignFamilies(signFamilies);
|
|
|
arriveRenewTotalCityMap.put(date, model);
|
|
|
return model;
|
|
|
} else {
|
|
|
return model;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取续签城镇达量的缓存
|
|
|
*
|
|
|
* @param date
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public synchronized RenewCacheModel getArriveRenewTotalTownMapByDate(String date) throws Exception {
|
|
|
RenewCacheModel model = arriveRenewTotalTownMap.get(date);
|
|
|
if (model == null) {
|
|
|
model = new RenewCacheModel();
|
|
|
|
|
|
String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_id from wlyy_sign_family_renew_log fr where " +
|
|
|
" fr.apply_date<'"+ date + Constant.quota_date_last+"' " +
|
|
|
" and fr.sign_year ='"+Constant.getNowYearByDate(date)+"' " +
|
|
|
" and LEFT(fr.hospital,6)=LEFT(fr.old_hospital,6) " +
|
|
|
" and LENGTH(fr.hospital)=10 " +
|
|
|
" and LENGTH(fr.old_hospital)=10 ";
|
|
|
//抽取數據
|
|
|
List<SignFamilyRenew> signFamilies= SpringUtil.getBean(DBExtract.class).extract(SignFamilyRenew.class,sql);
|
|
|
model.setSql(sql);
|
|
|
model.setSignFamilies(signFamilies);
|
|
|
arriveRenewTotalTownMap.put(date, model);
|
|
|
return model;
|
|
|
} else {
|
|
|
return model;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取续签机构达量的缓存
|
|
|
*
|
|
|
* @param date
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public synchronized RenewCacheModel getArriveRenewTotalOrgMapByDate(String date) throws Exception {
|
|
|
RenewCacheModel model = arriveRenewTotalOrgMap.get(date);
|
|
|
if (model == null) {
|
|
|
model = new RenewCacheModel();
|
|
|
|
|
|
String sql="select fr.sign_code code,fr.hospital,fr.admin_team_id from wlyy_sign_family_renew_log fr where " +
|
|
|
" fr.apply_date<'"+date+ Constant.quota_date_last+"' " +
|
|
|
" and fr.sign_year ='"+Constant.getNowYearByDate(date)+"' " +
|
|
|
" and fr.hospital=fr.old_hospital " +
|
|
|
" and LENGTH(fr.hospital)=10 " +
|
|
|
" and LENGTH(fr.old_hospital)=10";
|
|
|
//抽取數據
|
|
|
List<SignFamilyRenew> signFamilies= SpringUtil.getBean(DBExtract.class).extract(SignFamilyRenew.class,sql);
|
|
|
model.setSql(sql);
|
|
|
model.setSignFamilies(signFamilies);
|
|
|
arriveRenewTotalOrgMap.put(date, model);
|
|
|
return model;
|
|
|
} else {
|
|
|
return model;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取续签团队达量的缓存
|
|
|
*
|
|
|
* @param date
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public synchronized RenewCacheModel getArriveRenewTotalTeamMapByDate(String date) throws Exception {
|
|
|
RenewCacheModel model = arriveRenewTotalTeamMap.get(date);
|
|
|
if (model == null) {
|
|
|
model = new RenewCacheModel();
|
|
|
|
|
|
String sql=" select fr.sign_code code,fr.hospital ,fr.admin_team_id from wlyy_sign_family_renew_log fr where " +
|
|
|
" fr.apply_date<'"+ date + Constant.quota_date_last+"' " +
|
|
|
" and fr.sign_year ='"+Constant.getNowYearByDate(date)+"' " +
|
|
|
" and fr.admin_team_id=fr.old_admin_team_id " +
|
|
|
" and LENGTH(fr.hospital)=10 " +
|
|
|
" and LENGTH(fr.old_hospital)=10 ";
|
|
|
//抽取數據
|
|
|
List<SignFamilyRenew> signFamilies= SpringUtil.getBean(DBExtract.class).extract(SignFamilyRenew.class,sql);
|
|
|
model.setSql(sql);
|
|
|
model.setSignFamilies(signFamilies);
|
|
|
arriveRenewTotalTeamMap.put(date, model);
|
|
|
return model;
|
|
|
} else {
|
|
|
return model;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|