| 
					
				 | 
			
			
				@ -378,17 +378,17 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT p.id,p.register_no, p.status, p.dept, p.dept_name,patient.name as paName,d.name as docName\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "     , patient.sex, patient.idcard, patient.mobile, dic.req_fee,reg.date\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "FROM wlyy_outpatient p\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "\tLeft JOIN wlyy_patient_register reg on reg.register_no = p.register_no\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "\tLeft JOIN base_doctor d ON p.doctor = d.id\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "\tLeft JOIN wlyy_charge_dict dic ON d.charge_type = dic.charge_type \n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "\tLeft JOIN base_patient patient on patient.id = p.patient\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "\t JOIN wlyy_patient_register reg on reg.register_no = p.register_no\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "\t JOIN base_doctor d ON p.doctor = d.id\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "\t JOIN wlyy_charge_dict dic ON d.charge_type = dic.charge_type \n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "\t JOIN base_patient patient on patient.id = p.patient\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "WHERE dic.dept_type_code = p.win_no\n" ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNotBlank(startDate)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql =  sql + "  and reg.date >=  '" + startDate + "' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql =  sql + "  and reg.create_time >=  '" + startDate + "' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNotBlank(endDate)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql =  sql +  "  and reg.date < '" + endDate + "' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql =  sql +  "  and reg.create_time < '" + endDate + "' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNotBlank(keyId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql =  sql +  "  and  p.id = '" + keyId + "' "; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -468,13 +468,13 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " i.create_time, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.`name`, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.idcard, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.doctorIdCard," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.idcard AS doctorIdCard," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.mobile " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " wlyy_inspection i " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " JOIN wlyy_outpatient o ON o.id = i.outpatient_id  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " JOIN base_patient p ON p.id = o.patient " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " JOIN base_doctor d ON p.id = o.doctor " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " JOIN base_doctor d ON d.id = o.doctor " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "WHERE " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " i.create_time >='"+startDate+"' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " and i.create_time <='"+endDate+"'" + 
			 |