| 
					
				 | 
			
			
				@ -4662,7 +4662,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " base_doctor d " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " Left join ( select count(id) as total,doctor from wlyy_outpatient where status = 3 GROUP BY doctor ) a on a.doctor = d.id "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String, Object> params = new HashedMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNotBlank(iswork) &&"0".equalsIgnoreCase(iswork)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Date date = new Date(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+="LEFT JOIN (SELECT  COUNT(t1.doctor) as workTotal, t1.doctor FROM  wlyy_doctor_work_time t1   WHERE   " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "t1.start_time <=:startTime  AND t1.end_time >=:endTime GROUP BY t1.doctor) dw ON dw.doctor=d.id "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            params.put("startTime", date); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            params.put("endTime", date); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("1".equalsIgnoreCase(isAttention)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " join base_doctor_patient_follow follow on follow.doctor = d.id and follow.patient ='" + patientid + "' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4681,9 +4688,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " JOIN wlyy_doctor_work_time wk on wk.doctor = d.id "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += " WHERE  1=1 "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String, Object> params = new HashedMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += " WHERE  1=1 "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isBlank(chargType)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql += " AND d.charge_type is not null "; 
			 |