| 
					
				 | 
			
			
				@ -170,7 +170,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @param status 状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public List<ConsultVO>  findConsultRecordByPatient(String patient, String id,Integer type, int page,int pagesize, String title,Integer status) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public List<ConsultVO>  findConsultRecordByPatient(String patient, String id,String type, int page,int pagesize, String title,Integer status) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if(page >=1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							page --; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -197,7 +197,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"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="+type; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND b.doctor=d.id AND a.patient='"+patient+"' AND a.type in ("+type+")"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						List<ConsultVO> result = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if(!StringUtils.isEmpty(title)){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -234,7 +234,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @param title 标题关键字 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Long countConsultRecordByPatient(String patient, String id,Integer type, String title) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Long countConsultRecordByPatient(String patient, String id,String type, String title) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String  sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								" COUNT(1) AS total " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -242,7 +242,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"wlyy_consult_team b," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"base_doctor d " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"WHERE a.id=b.consult " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND b.doctor=d.id AND a.patient='"+patient+"' AND a.type="+type; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								"AND b.doctor=d.id AND a.patient='"+patient+"' AND a.type in ("+type+") "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						List<ConsultVO> result = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if(!StringUtils.isEmpty(title)){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1454,6 +1454,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						patientinfoObj.put("sex",basePatientDO.getSex()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						patientinfoObj.put("mobile",basePatientDO.getMobile()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						patientinfoObj.put("address",basePatientDO.getAddress()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						patientinfoObj.put("photo",basePatientDO.getPhoto()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Integer age = DateUtil.getAgeForIdcard(basePatientDO.getIdcard()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						patientinfoObj.put("age",age); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("patientInfo",patientinfoObj); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1661,7 +1662,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public List<ConsultVO>  findConsultRecordByDoctor(String doctor, String id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                                  Integer type, Integer status, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                                  String type, Integer status, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                                  int page,int pagesize, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                                  String title,String start_time,String end_time) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1674,7 +1675,8 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						String  sql = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if(1 == type || 15 ==type){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//专家咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if("1".equals(type) || "15".equals(type) || type.contains(",")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"a.id AS id," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									"a.type AS type," + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1750,9 +1752,9 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//咨询状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if(type != 0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								sql +=" AND a.type="+type; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//咨询类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if(!StringUtils.isEmpty(type)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								sql +=" AND a.type in ("+type+")" ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if (!StringUtils.isEmpty(id)) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1775,7 +1777,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @param end_time 结束时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Long countConsultRecordByDoctor(String doctor, String id,Integer type, Integer status,String title,String start_time,String end_time) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					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 " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1812,9 +1814,9 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//咨询状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if(type != 0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							sql +=" AND a.type="+type; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//咨询类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if(!StringUtils.isEmpty(type)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							sql +=" AND a.type in ("+type+")"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if (!StringUtils.isEmpty(id)) { 
			 |