|  | @ -5,10 +5,14 @@ import com.yihu.jw.entity.hospital.message.BaseUserMessageDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.message.dao.BaseBannerDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.message.dao.BaseBannerDoctorDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.message.dao.BaseUserMessageDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.Envelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.MixEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.date.DateUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.utils.hibernate.HibenateUtils;
 | 
	
		
			
				|  |  | import com.yihu.mysql.query.BaseJpaService;
 | 
	
		
			
				|  |  | import com.yihu.mysql.query.URLQueryParser;
 | 
	
		
			
				|  |  | import org.apache.commons.collections.map.HashedMap;
 | 
	
		
			
				|  |  | import org.apache.commons.lang.StringUtils;
 | 
	
		
			
				|  |  | import org.checkerframework.checker.units.qual.A;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
	
		
			
				|  | @ -101,8 +105,9 @@ public class BaseUserMsgService extends BaseJpaService<BaseUserMessageDO, BaseUs
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     //评论留言展示
 | 
	
		
			
				|  |  |     public List<Map<String,Object>> getMessage(String doctor, String showAll, String showAllType, String beginTime,String endTime) {
 | 
	
		
			
				|  |  |     public Envelop getMessage(String doctor, String showAll, String showAllType, String beginTime, String endTime, Integer page, Integer pageSize) {
 | 
	
		
			
				|  |  |         StringBuffer sql = new StringBuffer();
 | 
	
		
			
				|  |  |         Map<String,Object> params = new HashedMap();
 | 
	
		
			
				|  |  |         sql.append("select t.id as \"id\" ,t.content as \"content\"," +
 | 
	
		
			
				|  |  |                 "t.sender as \"sender\",t.sender_name as \"sender_name\",t.receiver as \"receiver\"," +
 | 
	
		
			
				|  |  |                 "t.receiver_name as \"receiver_name\",t.relation_type as \"relation_type\"," +
 | 
	
	
		
			
				|  | @ -134,9 +139,16 @@ public class BaseUserMsgService extends BaseJpaService<BaseUserMessageDO, BaseUs
 | 
	
		
			
				|  |  |         if (StringUtils.isNotEmpty(endTime)) {
 | 
	
		
			
				|  |  |             sql.append(" and t.update_time < '" + endTime+"'");//DateUtil.stringToDate(endTime,"yyyy-MM-dd HH:mm:ss")
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         String sqlcount = "SELECT COUNT(1) AS \"total\" FROM ("+sql.toString()+") t";
 | 
	
		
			
				|  |  |         Long count = 0L;
 | 
	
		
			
				|  |  |         List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlcount,params);
 | 
	
		
			
				|  |  |         if(total!=null){
 | 
	
		
			
				|  |  |             //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
 | 
	
		
			
				|  |  |             count = hibenateUtils.objTransformLong(total.get(0).get("total"));
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         sql.append(" GROUP BY t.relation_code ORDER BY t.update_time ASC");
 | 
	
		
			
				|  |  |         System.out.println(sql.toString());
 | 
	
		
			
				|  |  |         List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql.toString());
 | 
	
		
			
				|  |  |         List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql.toString(),params,page,pageSize);
 | 
	
		
			
				|  |  |         List<Map<String, Object>> returnList = new ArrayList<>();
 | 
	
		
			
				|  |  |         for (Map<String, Object> map : list) {
 | 
	
		
			
				|  |  |             String relationCode = map.get("relation_code").toString();
 | 
	
	
		
			
				|  | @ -148,7 +160,7 @@ public class BaseUserMsgService extends BaseJpaService<BaseUserMessageDO, BaseUs
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             returnList.add(map);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return returnList;
 | 
	
		
			
				|  |  |         return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, returnList, page, pageSize, count);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     public List<Map<String,Object>> getListByRelationCode(String relationCode){
 | 
	
		
			
				|  |  |         //查询评价明细
 |