|  | @ -45,6 +45,7 @@ import com.yihu.jw.util.common.FileUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.common.IdCardUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.date.DateUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.utils.StringUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.utils.hibernate.HibenateUtils;
 | 
	
		
			
				|  |  | import com.yihu.jw.wechat.service.WxAccessTokenService;
 | 
	
		
			
				|  |  | import org.apache.http.NameValuePair;
 | 
	
		
			
				|  |  | import org.apache.http.message.BasicNameValuePair;
 | 
	
	
		
			
				|  | @ -157,6 +158,9 @@ public class ImService {
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	@Autowired
 | 
	
		
			
				|  |  | 	private StringRedisTemplate redisTemplate;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 	@Autowired
 | 
	
		
			
				|  |  | 	private HibenateUtils hibenateUtils;
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	
 | 
	
	
		
			
				|  | @ -170,35 +174,36 @@ public class ImService {
 | 
	
		
			
				|  |  | 	 * @param status 状态
 | 
	
		
			
				|  |  | 	 * @return
 | 
	
		
			
				|  |  | 	 */
 | 
	
		
			
				|  |  | 	public List<ConsultVO>  findConsultRecordByPatient(String patient, String id,String type, int page,int pagesize, String title,Integer status) {
 | 
	
		
			
				|  |  | 	public List<Map<String,Object>>  findConsultRecordByPatient(String patient, String id,String type, int page,int pagesize, String title,Integer status,Integer payStatus) {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 		if(page >=1){
 | 
	
		
			
				|  |  | 	/*	if(page >=1){
 | 
	
		
			
				|  |  | 			page --;
 | 
	
		
			
				|  |  | 		}
 | 
	
		
			
				|  |  | 		
 | 
	
		
			
				|  |  | 		if (pagesize <= 0) {
 | 
	
		
			
				|  |  | 			pagesize = 10;
 | 
	
		
			
				|  |  | 		}
 | 
	
		
			
				|  |  | 		}*/
 | 
	
		
			
				|  |  | 		
 | 
	
		
			
				|  |  | 		String  sql = "SELECT " +
 | 
	
		
			
				|  |  | 				"a.id AS id," +
 | 
	
		
			
				|  |  | 				"a.type AS type," +
 | 
	
		
			
				|  |  | 				"a.title AS title," +
 | 
	
		
			
				|  |  | 				"a.symptoms AS symptoms," +
 | 
	
		
			
				|  |  | 				"a.czrq AS czrq," +
 | 
	
		
			
				|  |  | 				"b.status AS status," +
 | 
	
		
			
				|  |  | 				"b.evaluate AS evaluate," +
 | 
	
		
			
				|  |  | 				"d.name AS doctorName," +
 | 
	
		
			
				|  |  | 				"d.photo AS doctorphoto," +
 | 
	
		
			
				|  |  | 				"d.job_title_name AS jobTitleName, " +
 | 
	
		
			
				|  |  | 				"h.dept_name AS deptName " +
 | 
	
		
			
				|  |  | 				"a.id AS \"id\"," +
 | 
	
		
			
				|  |  | 				"a.type AS \"type\"," +
 | 
	
		
			
				|  |  | 				"a.title AS \"title\"," +
 | 
	
		
			
				|  |  | 				"a.symptoms AS \"symptoms\"," +
 | 
	
		
			
				|  |  | 				"a.czrq AS \"czrq\"," +
 | 
	
		
			
				|  |  | 				"b.status AS \"status\"," +
 | 
	
		
			
				|  |  | 				"b.evaluate AS \"evaluate\"," +
 | 
	
		
			
				|  |  | 				"d.name AS \"doctorName\"," +
 | 
	
		
			
				|  |  | 				"d.photo AS \"doctorphoto\"," +
 | 
	
		
			
				|  |  | 				"d.job_title_name AS \"jobTitleName\", " +
 | 
	
		
			
				|  |  | 				"h.dept_name AS \"deptName\" " +
 | 
	
		
			
				|  |  | 				"a.pay_status AS \"payStatus\","+
 | 
	
		
			
				|  |  | 				"FROM wlyy_consult a," +
 | 
	
		
			
				|  |  | 				"wlyy_consult_team b," +
 | 
	
		
			
				|  |  | 				"base_doctor d, " +
 | 
	
		
			
				|  |  | 				"base_doctor_hospital h " +
 | 
	
		
			
				|  |  | 				"WHERE a.id=b.consult and d.id = h.doctor_code " +
 | 
	
		
			
				|  |  | 				"AND b.doctor=d.id AND a.patient='"+patient+"' AND a.type in ("+type+")";
 | 
	
		
			
				|  |  | 		List<ConsultVO> result = new ArrayList<>();
 | 
	
		
			
				|  |  | 		/*List<ConsultVO> result = new ArrayList<>();*/
 | 
	
		
			
				|  |  | 		
 | 
	
		
			
				|  |  | 		if(!StringUtils.isEmpty(title)){
 | 
	
		
			
				|  |  | 			title="%"+title+"%";
 | 
	
	
		
			
				|  | @ -219,10 +224,13 @@ public class ImService {
 | 
	
		
			
				|  |  | 		if (!StringUtils.isEmpty(id)) {
 | 
	
		
			
				|  |  | 			sql += " and a.id = '" + id + "'";
 | 
	
		
			
				|  |  | 		}
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 		if (!StringUtils.isEmpty(payStatus)) {
 | 
	
		
			
				|  |  | 			sql += " and a.pay_status = " + payStatus + "";
 | 
	
		
			
				|  |  | 		}
 | 
	
		
			
				|  |  | 		sql += " ORDER BY a.czrq desc limit "+page * pagesize+","+pagesize+"";
 | 
	
		
			
				|  |  | 		
 | 
	
		
			
				|  |  | 		result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));
 | 
	
		
			
				|  |  | 		
 | 
	
		
			
				|  |  | 		List<Map<String,Object>> result = hibenateUtils.createSQLQuery(sql,page,pagesize);
 | 
	
		
			
				|  |  | 		/*result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));*/
 | 
	
		
			
				|  |  | 		return result;
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 | 
	
	
		
			
				|  | @ -960,6 +968,7 @@ public class ImService {
 | 
	
		
			
				|  |  | 		consult.setSymptoms(symptoms);
 | 
	
		
			
				|  |  | 		consult.setImages(images);
 | 
	
		
			
				|  |  | 		consult.setType(type);
 | 
	
		
			
				|  |  | 		consult.setPayStatus(0);
 | 
	
		
			
				|  |  | 		return consultDao.save(consult);
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 |