| 
					
				 | 
			
			
				@ -279,9 +279,8 @@ public class MessageService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "select a.sender,a.tz_type,count(1) count,max(date_format(a.create_time,'%Y-%c-%d %H:%i:%s')) last_time from wlyy_Message a where a.receiver='" + doctor + "' and a.has_read='1' and a.type='2' group by a.sender,a.tz_type order by last_time desc"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String,Map<String, Object>> map = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (Map<String, Object> item : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Map<String, Object> obj = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Map<String, Object> obj = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String patientCode = String.valueOf(item.get("sender")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //获取患者信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Patient patient = patientDao.findByCode(patientCode); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -309,36 +308,6 @@ public class MessageService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (Map<String, Object> item : map.values()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Map<String, Object> obj = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String type = String.valueOf(item.get("type")); //1血糖,2血压,3体重,4腰 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String count1 = item.get("count1")==null?"0":item.get("count1").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String count0 = item.get("count0")==null?"0":item.get("count0").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            obj.put("patient", item.get("patient")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            obj.put("type", type); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            obj.put("time", item.get("time")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            obj.put("name", item.get("name")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            obj.put("sex", item.get("sex")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            obj.put("birthday", item.get("birthday")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            obj.put("photo", item.get("photo")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("1".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                obj.put("message", "有" + count1 + "条血糖异常未读消息"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else if ("2".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                obj.put("message", "有" + item.get("count") + "条血压异常未读消息"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("1".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                obj.put("message", "有血糖异常未读消息"+count1+"条,已读消息"+count0+"条"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else if ("2".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                obj.put("message", "有血压异常未读消息"+count1+"条,已读消息"+count0+"条"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            re.add(obj); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return re; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |