| 
					
				 | 
			
			
				@ -4314,9 +4314,9 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop recordByDoctor() { //String doctor, String id,String type, Integer status,String title, String start_time, String end_time, String patient 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    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 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "a.id AS \"id\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.pay_status AS \"payStatus\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.type as \"type\"," + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4358,14 +4358,16 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " 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 == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " and op.status = 0 and op.pay_status =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 == 2) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else if (status == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " and op.status = 0 and op.pay_status =1 "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else if (status == 2){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " and op.status = 1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " and op.status = " + status; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else if (status == 3) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " and op.status = 2"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (org.apache.commons.lang.StringUtils.isNotBlank(doctor)) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4429,8 +4431,8 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " and a.id = '" + id + "'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += " ORDER BY op.create_time desc "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> mapList = hibenateUtils.createSQLQuery(sql, page, pagesize); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (Map<String, Object> map : mapList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        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); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4501,9 +4503,9 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return mapList;*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql = "select \n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String pushSql = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        pushSql = "select \n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "IFNULL(a.patient_name,' ') AS pname,\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "IFNULL(a.doctor_name,' ') as dname,\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "IFNULL(a.dept_name,' ') as dept,\n" + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4531,7 +4533,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "where 1=1;"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> mapList = hibenateUtils.createSQLQuery(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> mapList = hibenateUtils.createSQLQuery(pushSql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return MixEnvelop.getSuccessListWithPage2(BaseHospitalRequestMapping.Prescription.api_success, mapList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |