| 
					
				 | 
			
			
				@ -4180,6 +4180,7 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.medical_state as \"medicalState\"  ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "bop.status as \"payStatus1\" ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.patient_cancel_value as \"patientCancelValue\" ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "op.plan_doctor as \"planDoctor\" ," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "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 base_business_order_pay bop on bop.relation_code = op.id" + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4197,7 +4198,12 @@ public class ImService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (org.apache.commons.lang.StringUtils.isNotBlank(doctor)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " AND op.doctor='" + doctor + "' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if("28".equals(type)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " AND (op.doctor='" + doctor + "' or op.plan_doctor='"+doctor+"')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " AND op.doctor='" + doctor + "' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (org.apache.commons.lang.StringUtils.isNotBlank(patient)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " AND (op.consumer='" + patient + "' or op.patient ='" + patient + "')"; 
			 |