|  | @ -437,7 +437,7 @@ public class StatisticsService extends BaseService {
 | 
	
		
			
				|  |  |             sql += " order by amount asc ";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql, new Object[]{(StringUtils.isEmpty(lowLevel)?(level - 1):lowLevel), endDate, area});
 | 
	
		
			
				|  |  |         List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql, new Object[]{low_level, endDate, area});
 | 
	
		
			
				|  |  |         // 结果为空时,自建结果集
 | 
	
		
			
				|  |  |         if (resultList == null || resultList.size() < 1) {
 | 
	
		
			
				|  |  |             resultList = new ArrayList<>();
 | 
	
	
		
			
				|  | @ -567,6 +567,8 @@ public class StatisticsService extends BaseService {
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String low_level = String.valueOf(StringUtils.isEmpty(lowLevel)?(level - 1):lowLevel);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         // 查询语句
 | 
	
		
			
				|  |  |         String sql = " select " +
 | 
	
		
			
				|  |  |                 "     ifnull(" + lowLevelField + ",'') code " +
 | 
	
	
		
			
				|  | @ -588,12 +590,12 @@ public class StatisticsService extends BaseService {
 | 
	
		
			
				|  |  |             sql += " order by amount asc ";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql, new Object[]{(StringUtils.isEmpty(lowLevel)?(level - 1):lowLevel), startDate, endDate, area});
 | 
	
		
			
				|  |  |         List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql, new Object[]{low_level, startDate, endDate, area});
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         // 结果为空时,自建结果集
 | 
	
		
			
				|  |  |         if (resultList == null || resultList.size() < 1) {
 | 
	
		
			
				|  |  |             resultList = new ArrayList<>();
 | 
	
		
			
				|  |  |             if (level == 4) {
 | 
	
		
			
				|  |  |             if (low_level.equals("3")) {
 | 
	
		
			
				|  |  |                 List<Town> towns = townDao.findByCityCode(area);
 | 
	
		
			
				|  |  |                 if (towns != null) {
 | 
	
		
			
				|  |  |                     for (Town town : towns) {
 | 
	
	
		
			
				|  | @ -604,7 +606,7 @@ public class StatisticsService extends BaseService {
 | 
	
		
			
				|  |  |                         resultList.add(obj);
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             } else if (level == 3) {
 | 
	
		
			
				|  |  |             } else if (low_level.equals("2")) {
 | 
	
		
			
				|  |  |                 List<Hospital> hospitals = hospitalDao.findByTownCode(area);
 | 
	
		
			
				|  |  |                 if (hospitals != null) {
 | 
	
		
			
				|  |  |                     for (Hospital hos : hospitals) {
 | 
	
	
		
			
				|  | @ -615,7 +617,7 @@ public class StatisticsService extends BaseService {
 | 
	
		
			
				|  |  |                         resultList.add(obj);
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             } else if (level == 2) {
 | 
	
		
			
				|  |  |             } else if (low_level.equals("1")) {
 | 
	
		
			
				|  |  |                 List<Doctor> doctors = doctorDao.findDoctorByLevelAndHospital(area, 2);
 | 
	
		
			
				|  |  |                 if (doctors != null) {
 | 
	
		
			
				|  |  |                     for (Doctor doc : doctors) {
 | 
	
	
		
			
				|  | @ -635,7 +637,7 @@ public class StatisticsService extends BaseService {
 | 
	
		
			
				|  |  |                 // 截止日期包含当天,则从redis查询当天统计数据
 | 
	
		
			
				|  |  |                 if (endDate.compareTo(new SimpleDateFormat("yyyy-MM-dd").format(new Date())) >= 0) {
 | 
	
		
			
				|  |  |                     String code = map.get("code") != null ? String.valueOf(map.get("code")) : "";
 | 
	
		
			
				|  |  |                     String val = redisTemplate.opsForValue().get("quota:" + index + ":" + (StringUtils.isEmpty(lowLevel)?(level - 1):lowLevel) + ":" + code);
 | 
	
		
			
				|  |  |                     String val = redisTemplate.opsForValue().get("quota:" + index + ":" + low_level + ":" + code);
 | 
	
		
			
				|  |  |                     if (!StringUtils.isEmpty(val)) {
 | 
	
		
			
				|  |  |                         JSONObject valJson = new JSONObject(val);
 | 
	
		
			
				|  |  |                         if (valJson.has("num") && valJson.getInt("num") > 0) {
 |