| 
					
				 | 
			
			
				@ -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; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -237,7 +245,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Long countConsultRecordByPatient(String patient, String id,String type, String title) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String  sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								" COUNT(1) AS total " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								" COUNT(1) AS \"total\" " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"FROM wlyy_consult a," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"wlyy_consult_team b," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"base_doctor d " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -271,7 +279,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public String  getUnfinishedConsult(String patient, String doctor) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String totalSql = "SELECT a.consult as consultCode " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String totalSql = "SELECT a.consult as \"consultCode\" " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"FROM wlyy_consult_team a,wlyy_consult_team_doctor b " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"WHERE a.consult=b.consult " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND a.patient= '" +patient+"' "+ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -309,7 +317,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public JSONObject  getUnfinishedConsultByActualSender(String patient, String general_doctor) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						JSONObject result = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String totalSql = "SELECT a.consult as consultCode,a.doctor as specialDoctor " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String totalSql = "SELECT a.consult as \"consultCode\",a.doctor as \"specialDoctor\"  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"FROM wlyy_consult_team a,wlyy_consult_team_doctor b " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"WHERE a.consult=b.consult " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND a.patient= '" +patient+"' "+ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -938,6 +946,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						re.put("patient",patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						re.put("patientName",tempPatient.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						re.put("patient_idcard",tempPatient.getIdcard()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						re.put("consult",consult.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						return re; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -959,6 +968,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setSymptoms(symptoms); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setImages(images); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setType(type); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setPayStatus(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						return consultDao.save(consult); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1485,7 +1495,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public String getOutpatientidByConsoultCode(String consult) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String totalSql = "SELECT relation_code FROM wlyy_consult WHERE id='"+consult+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String totalSql = "SELECT relation_code as \"relation_code\" FROM wlyy_consult WHERE id='"+consult+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String id = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if (rstotal != null && rstotal.size() > 0) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1582,15 +1592,15 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public List<Map<String,Object>> getEvaluationByConsultCode(String consult) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//查询评价明细 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String sqlScoreList = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"a.score as score," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"a.score_type as score_type," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"a.content as content," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"b.create_time as create_time," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"c.type as type," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"c.name as patientname," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"b.id as id," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"c.photo as patientphoto," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"b.type as niming " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"a.score as \"score\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"a.score_type as \"score_type\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"a.content as \"content\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"b.create_time as \"create_time\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"c.type as \"type\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"c.name as \"patientname\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"b.id as \"id\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"c.photo as \"patientphoto\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"b.type as \"niming\" " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"base_evaluate a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"LEFT JOIN base_evaluate_score b ON b.id=a.relation_code " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1700,18 +1710,18 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//专家咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if("1".equals(type) || "15".equals(type) || type.contains(",")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							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 patientName," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.id as patientId," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.idcard as patientIdcard," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.sex as patientsex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.photo AS patientphoto " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"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 \"patientName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.id as \"patientId\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.idcard as \"patientIdcard\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.sex as \"patientsex\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.photo AS \"patientphoto\" " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"FROM wlyy_consult a," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"wlyy_consult_team b," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"base_patient d " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1720,22 +1730,22 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						}else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							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 patientName," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.id as patientId," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.idcard as patientIdcard," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.sex as patientsex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.id as outpatientid," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.type as consultType," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.general_doctor as generalDoctor," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.icd10_name as icd10Name," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.photo AS patientphoto " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"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 \"patientName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.id as \"patientId\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.idcard as \"patientIdcard\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.sex as \"patientsex\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.id as \"outpatientid\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.type as \"consultType\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.general_doctor as \"generalDoctor\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.icd10_name as \"icd10Name\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.photo AS \"patientphoto\" " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"FROM wlyy_consult a," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"wlyy_consult_team b," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"base_patient d, " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1802,7 +1812,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Long countConsultRecordByDoctor(String doctor, String id,String type, Integer status,String title,String start_time,String end_time) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String  sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								" COUNT(1) AS total " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								" COUNT(1) AS \"total\" " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"FROM wlyy_consult a," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"wlyy_consult_team b," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"base_patient d," + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2091,20 +2101,20 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						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 patientName," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"d.id as patientId," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"d.idcard as patientIdcard," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"d.sex as patientsex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"d.photo AS patientphoto, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"doctor.name AS doctorName, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"doctor.job_title_name AS jobTitleName " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"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 \"patientName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"d.id as \"patientId\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"d.idcard as \"patientIdcard\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"d.sex as \"patientsex\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"d.photo AS \"patientphoto\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"doctor.name AS \"doctorName\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"doctor.job_title_name AS \"jobTitleName\" " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"FROM wlyy_consult a," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"wlyy_consult_team b," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"base_doctor doctor," + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2170,7 +2180,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Long findexpertConsultRecordByDoctor(String doctor, String id,Integer type, Integer status,String title,String start_time,String end_time,String patient) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String  sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								" COUNT(1) AS total " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								" COUNT(1) AS \"total\" " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"FROM wlyy_consult a," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"wlyy_consult_team b," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"base_patient d " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2250,7 +2260,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String sql = "select id, session_id, sender_id, sender_name, content_type, content, timestamp from " + data_base_name + "." + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String sql = "id AS \"id\",session_id AS \"session_id\",sender_id AS \"sender_id\",sender_name AS \"sender_name\",content_type AS \"content_type\",content AS \"content\",timestamp AS \"timestamp\"  from " + data_base_name + "." + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								tableName + " where id in(" + content + ") order by timestamp desc "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						List<Map<String, Object>> list = jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						com.alibaba.fastjson.JSONArray ja = new com.alibaba.fastjson.JSONArray(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2388,28 +2398,26 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * 医生待办事项列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @param doctorCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @param type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @param page 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @param pagesize 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public List<ConsultVO> doctorUpcomingList(String doctorCode, String type) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String sql = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if("1,15".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							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," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"b.doctor AS doctorCode," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"b.actual_sender AS generalDoctor," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.name AS patientName," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.id as patientId," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.idcard as patientIdcard," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.sex as patientsex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.photo AS patientphoto " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"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\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"b.doctor AS \"doctorCode\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"b.actual_sender AS \"generalDoctor\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.name AS \"patientName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.id as \"patientId\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.idcard as \"patientIdcard\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.sex as \"patientsex\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"d.photo AS \"patientphoto\" " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"FROM wlyy_consult a," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"wlyy_consult_team b," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"base_patient d  " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2419,20 +2427,20 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if("9".equals(type) || "16".equals(type)|| "12".equals(type)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.description AS title," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.description AS symptoms," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.create_time AS czrq," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.status AS status," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.evaluate_status AS evaluate," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.doctor AS doctorCode," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.general_doctor AS generalDoctor," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"patient.NAME AS patientName," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"patient.id AS patientId," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"patient.idcard AS patientIdcard," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"patient.sex AS patientsex," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"patient.photo AS patientphoto," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.id AS outpatientid," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.register_date AS registerDate," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.description AS \"title\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.description AS \"symptoms\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.create_time AS \"czrq\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.status AS \"status\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.evaluate_status AS \"evaluate\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.doctor AS \"doctorCode\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.general_doctor AS \"generalDoctor\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"patient.NAME AS \"patientName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"patient.id AS \"patientId\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"patient.idcard AS \"patientIdcard\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"patient.sex AS \"patientsex\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"patient.photo AS \"patientphoto\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.id AS \"outpatientid\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.register_date AS \"registerDate\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"op.status AS outpatientstatus " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"FROM wlyy_outpatient op," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"base_patient patient " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2483,7 +2491,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public List<Map<String,Object>>  getDoctorConsultCount(String doctorids) throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//医生角色 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"count(id) AS total," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"count(id) AS \"total\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"doctor " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"FROM wlyy_consult_team " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"WHERE doctor IN ("+doctorids+") AND (type=1 OR type=15) and status = 0 GROUP BY doctor"; 
			 |