| 
					
				 | 
			
			
				@ -670,7 +670,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param dept 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String,Object>> findDoctorByHospitalAndDept(String orgCode,String dept,String chargeType,String doctorCode,String outpatientType){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String,Object>> findDoctorByHospitalAndDept(String orgCode,String dept,String chargeType,String doctorCode,String outpatientType,String startDate,String endDate){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql ="SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.id, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.photo, " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -696,6 +696,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+=" AND d.outpatient_type is not null "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNotBlank(endDate)&&StringUtils.isNotBlank(startDate)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+=" AND EXISTS ( " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "  1 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "  wlyy_doctor_work_time t " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " WHERE " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "  t.doctor = d.id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " AND t.start_time >='" +startDate+"'" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " AND t.start_time <='"+endDate+"'"+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " )"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(list!=null&&list.size()>0&&StringUtils.isNotBlank(doctorCode)){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -717,7 +729,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param dept 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop findDoctorWithWork(String orgCode,String dept,String chargeType,String doctorCode,String outpatientType,Integer page,Integer size){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop findDoctorWithWork(String orgCode,String dept,String chargeType,String doctorCode,String outpatientType,String startDate,String endDate,Integer page,Integer size){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String totalSql ="SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " count(1) AS total " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -735,6 +747,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            totalSql+=" AND d.outpatient_type is not null "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNotBlank(endDate)&&StringUtils.isNotBlank(startDate)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            totalSql+=" AND EXISTS ( " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "  1 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "  wlyy_doctor_work_time t " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " WHERE " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "  t.doctor = d.id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " AND t.start_time >='" +startDate+"'" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " AND t.start_time <='"+endDate+"'"+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " )"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Long count = 0L; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -769,6 +793,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+=" AND d.outpatient_type is not null "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNotBlank(endDate)&&StringUtils.isNotBlank(startDate)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+=" AND EXISTS ( " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "  1 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " FROM " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "  wlyy_doctor_work_time t " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " WHERE " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "  t.doctor = d.id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " AND t.start_time >='" +startDate+"'" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " AND t.start_time <='"+endDate+"'"+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " )"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += " LIMIT " + (page - 1) * size + "," + size + ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(list!=null&&list.size()>0){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1523,6 +1559,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("jobTitleName",doctorDO.getJobTitleName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("chargeType",doctorDO.getChargeType()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("photo",doctorDO.getPhoto()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("consultStatus",doctorDO.getConsultStatus()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //机构科室信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<BaseDoctorHospitalDO> hospitalDOs =  baseDoctorHospitalDao.findByDoctorCode(doctorDO.getId()); 
			 |