| 
					
				 | 
			
			
				@ -3641,11 +3641,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " JOIN base_doctor_hospital h ON h.doctor_code = d.id "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " Left join ( select count(id) as total,doctor from wlyy_outpatient where status = 2 GROUP BY doctor ) a on a.doctor = d.id "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (isAttention.equalsIgnoreCase("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+=" Left join base_doctor_patient_follow follow on follow.doctor = d.id and follow.patient ='"+patientid+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("1".equalsIgnoreCase(isAttention)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+=" join base_doctor_patient_follow follow on follow.doctor = d.id and follow.patient ='"+patientid+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (isAttention.equalsIgnoreCase("0")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " Left join base_doctor_patient_follow follow on follow.doctor = d.id and follow.patient !='" + patientid + "' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("0".equalsIgnoreCase(isAttention)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " join base_doctor_patient_follow follow on follow.doctor = d.id and follow.patient !='" + patientid + "' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNotBlank(diseaseKey)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+=" left join wlyy_doctor_special_disease sp on d.id = sp.doctor_code "; 
			 |