| 
					
				 | 
			
			
				@ -4315,200 +4315,11 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop recordByDoctor(String doctor, String id,String type, Integer status,String title, String start_time, String end_time, String patient) { // 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "a.id AS \"id\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.pay_status AS \"payStatus\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.type as \"type\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.outpatient_type as \"outpatientType\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.description AS \"title\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.description AS \"symptoms\","; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("xm_ykyy_wx".equals(wxId)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (flag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql = sql + "date_format(op.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\","; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql = sql + "date_format(op.end_time,'%Y-%m-%d %H:%i:%S' )  AS \"endTime\", "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql = sql + "to_char(op.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\","; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql = sql + "to_char(op.end_time,'YYYY-MM-DD hh24:mi:ss')  AS \"endTime\","; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = sql + "date_format(op.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\","; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql = sql + "date_format(op.end_time,'%Y-%m-%d %H:%i:%S' )  AS \"endTime\","; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql = sql + "op.status AS \"status\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "b.evaluate AS \"evaluate\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "d.name AS \"patientName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "d.id as \"patientId\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "d.idcard as \"patientIdcard\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "d.sex as \"patientSex\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.consumer as \"consumer\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.consumer_name as \"consumerName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.consumer_mobile as \"consumerMobile\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.id as \"outpatientId\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.type as \"consultType\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.general_doctor as \"generalDoctor\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.icd10_name as \"icd10Name\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "d.photo AS \"patientPhoto\" , " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.doctor as \"doctor\" ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.source as \"source\"  ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.card_no as \"cardNo\"  ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.patient_cancel_value as \"patientCancelValue\" ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.patient_cancel_remark as \"patient_cancel_remark\"  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "FROM wlyy_outpatient op LEFT JOIN wlyy_consult a  ON a.relation_code = op.id \n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LEFT join wlyy_consult_team b on a.id = b.consult" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LEFT JOIN base_patient d on op.patient = d.id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " WHERE 1=1 "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (status == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " and op.status = 0 and op.pay_status =1 and op.pay_status =2 and op.pay_status =3"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else if (status == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else if (status == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " and op.status = 0 and op.pay_status =1 "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else if (status == 2){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " and op.status = 1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else if (status == 3) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " and op.status = 2"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (org.apache.commons.lang.StringUtils.isNotBlank(doctor)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " AND op.doctor='" + doctor + "' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (org.apache.commons.lang.StringUtils.isNotBlank(patient)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " AND (op.consumer='" + patient + "' or op.patient ='" + patient + "')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!StringUtils.isEmpty(title)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            title = "%" + title + "%"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " and (op.patient_name like '" + title + "' OR op.doctor_name like '" + title + "' OR op.dept_name like '" + title + "' )"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!StringUtils.isEmpty(start_time)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("xm_ykyy_wx".equals(wxId)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (flag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql += " and op.create_time >= str_to_date('" + start_time + "','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql += " and op.create_time >= to_date('" + start_time + "','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " and op.create_time >= '" + start_time + "'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!StringUtils.isEmpty(end_time)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("xm_ykyy_wx".equals(wxId)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (flag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql += " and op.create_time <= str_to_date('" + end_time + "','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql += " and op.create_time <= to_date('" + end_time + "','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " and op.create_time <= '" + end_time + "'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //咨询类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!StringUtils.isEmpty(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (type.equalsIgnoreCase("9")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " AND op.type =1 and op.outpatient_type = 1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else if (type.equalsIgnoreCase("16")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " AND op.type =2 and op.outpatient_type = 1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else if (type.equalsIgnoreCase("1")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " AND op.type =1 and op.outpatient_type = 3"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else if (type.equalsIgnoreCase("15")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " AND op.type =3 and op.outpatient_type = 3"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else if (type.equalsIgnoreCase("17")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " AND op.type =2 and op.outpatient_type = 3"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else if (type.equalsIgnoreCase("12")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " AND op.outpatient_type = 2"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " AND op.type in (1,2,3) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!StringUtils.isEmpty(id)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " and a.id = '" + id + "'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += " ORDER BY op.create_time desc "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> List = hibenateUtils.createSQLQuery(sql);// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (Map<String, Object> map : List) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (map.get("patientIdcard") != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String idcard = map.get("patientIdcard").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Integer age = IdCardUtil.getAgeForIdcard(idcard); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("patientAge", age); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("patientAge", null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (map.get("doctor") != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String doctorId = map.get("doctor").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doctorId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(doctorId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("deptName", doctorHospitalDOS.get(0).getDeptName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (baseDoctorDO != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("doctorName", baseDoctorDO.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (map.get("outpatientId") != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(map.get("outpatientId").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                map.put("deptName", wlyyOutpatientDO.getDeptName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (map.get("outpatientType") != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("3".equalsIgnoreCase(map.get("outpatientType").toString()) && "1".equalsIgnoreCase(map.get("type").toString())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("type", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("3".equalsIgnoreCase(map.get("outpatientType").toString()) && "2".equalsIgnoreCase(map.get("type").toString())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("type", 17); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("3".equalsIgnoreCase(map.get("outpatientType").toString()) && "3".equalsIgnoreCase(map.get("type").toString())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("type", 15); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("1".equalsIgnoreCase(map.get("outpatientType").toString()) && "1".equalsIgnoreCase(map.get("type").toString())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("type", 9); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("1".equalsIgnoreCase(map.get("outpatientType").toString()) && "2".equalsIgnoreCase(map.get("type").toString())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("type", 16); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("2".equalsIgnoreCase(map.get("outpatientType").toString())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("type", 12); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (map.get("id") != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("1".equals(type) || "15".equals(type) || type.contains(",") || "17".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    String consultCode = map.get("id").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    List<WlyyConsultAdvice> consultAdvices = wlyyConsultAdviceDao.getByConsult(consultCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    StringBuffer content = new StringBuffer(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    for (WlyyConsultAdvice consultAdvice : consultAdvices) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        content.append(consultAdvice.getAdviceValue() + ","); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (content != null && content.length() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        System.out.println("content+=====" + content); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        content.deleteCharAt(content.length() - 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("icd10Name", content); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } else if ("0".equals(type) && null != map.get("outpatientType") && "3".equalsIgnoreCase(map.get("outpatientType").toString())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    String consultCode = map.get("id").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    List<WlyyConsultAdvice> consultAdvices = wlyyConsultAdviceDao.getByConsult(consultCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    StringBuffer content = new StringBuffer(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    for (WlyyConsultAdvice consultAdvice : consultAdvices) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        content.append(consultAdvice.getAdviceValue() + ","); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (content != null && content.length() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        System.out.println("content+=====" + content); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        content.deleteCharAt(content.length() - 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    map.put("icd10Name", content); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String pushSql = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        pushSql = 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "SELECT\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "\ta.patient_name AS \"pname\",\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "\ta.consumer_name AS \"dname\",\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "\ta.doctor_name AS \"dname\",\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "\ta.dept_name AS \"dept\",\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "\ta.outpatient_type AS \"type\",\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "\ta.create_time AS \"ctime\",\n" + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4534,10 +4345,14 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (org.apache.commons.lang3.StringUtils.isNotBlank(doctor)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            pushSql += " AND a.consumer_name like '%" + doctor + "%' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            pushSql += " AND a.doctor = '" + doctor + "' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (org.apache.commons.lang3.StringUtils.isNotBlank(patient)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            pushSql += " AND a.patient_name like '%" + patient + "%' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            pushSql += " AND a.patient = '" + patient + "' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!StringUtils.isEmpty(title)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            title = "%" + title + "%"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            pushSql += " and (a.patient_name like '" + title + "' OR a.doctor_name like '" + title + "' OR a.dept_name like '" + title + "' )"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (org.apache.commons.lang3.StringUtils.isNotBlank(start_time)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("xm_ykyy_wx".equals(wxId)) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4559,7 +4374,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    pushSql += " and a.create_time <= to_date('" + end_time + " 23:59:59','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " AND a.create_time <='" + end_time + " 23:59:59'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                pushSql += " AND a.create_time <='" + end_time + " 23:59:59'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        pushSql = pushSql + "\tORDER BY a.create_time desc "; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4569,7 +4384,6 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return MixEnvelop.getSuccessListWithPage2(BaseHospitalRequestMapping.Prescription.api_success, mapList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String, Object>> doctorUpcomingList2(String doctorCode, String type) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("1,15,17".equals(type)) { 
			 |