|  | @ -178,6 +178,7 @@ public class ConsultService {
 | 
	
		
			
				|  |  |                 "d.job_title_name AS \"jobTitleName\", " +
 | 
	
		
			
				|  |  |                 "h.dept_name AS \"deptName\", " +
 | 
	
		
			
				|  |  |                 "h.org_name AS \"hospitalName\", " +
 | 
	
		
			
				|  |  |                 "h.org_code AS orgCode, " +
 | 
	
		
			
				|  |  |                 "a.pay_status AS \"payStatus\", "+
 | 
	
		
			
				|  |  |                 "a.source AS \"source\" "+
 | 
	
		
			
				|  |  |                 "FROM wlyy_consult a," +
 | 
	
	
		
			
				|  | @ -212,13 +213,20 @@ public class ConsultService {
 | 
	
		
			
				|  |  |         sql += " ORDER BY a.czrq desc ";
 | 
	
		
			
				|  |  |         logger.info("sql="+sql);
 | 
	
		
			
				|  |  |         List<Map<String,Object>> result = hibenateUtils.createSQLQuery(sql,page,pagesize);
 | 
	
		
			
				|  |  |         Map<String,Integer> unreadNum = new HashedMap();
 | 
	
		
			
				|  |  |         for (Map<String,Object> map:result){
 | 
	
		
			
				|  |  |             if(type.equals(ImUtil.SESSION_TYPE_ONLINE)){
 | 
	
		
			
				|  |  |                 String sessionId = patient+"_"+String.valueOf(map.get("doctorCode"))+"_23";
 | 
	
		
			
				|  |  |                 //新增未读消息数量
 | 
	
		
			
				|  |  |                 Integer count = imUtil.UserSessionsUnreadMessageCount(sessionId,patient);
 | 
	
		
			
				|  |  |                 if(unreadNum.containsKey(sessionId)){
 | 
	
		
			
				|  |  |                     map.put("count",0);
 | 
	
		
			
				|  |  |                 }else{
 | 
	
		
			
				|  |  |                     Integer count = imUtil.UserSessionsUnreadMessageCount(sessionId,patient);
 | 
	
		
			
				|  |  |                     map.put("count",count);
 | 
	
		
			
				|  |  |                     unreadNum.put(sessionId,count);
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 map.put("sessionId",sessionId);
 | 
	
		
			
				|  |  |                 map.put("count",count);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return result;
 |