소스 검색

导诊列表增加部门搜索

huangwenjie 5 년 전
부모
커밋
791466dd27
1개의 변경된 파일17개의 추가작업 그리고 6개의 파일을 삭제
  1. 17 6
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

+ 17 - 6
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -2195,7 +2195,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        
        //获取今天的排班列表
        String doctorsql ="SELECT doctor,doctor_name FROM wlyy_doctor_work_time WHERE date='"+date+"' GROUP BY doctor";
        String doctorsql ="SELECT doctor,doctor_name FROM wlyy_doctor_work_time WHERE date='"+date+"'";
        
        if(StringUtils.isNoneBlank(dept)){
            doctorsql = doctorsql + " and dept = '"+dept+"' ";
        }
        doctorsql = doctorsql+ " GROUP BY doctor";
    
        List<Map<String,Object>> doctorlist = jdbcTemplate.queryForList(doctorsql);
    
@ -2224,8 +2229,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "room.doctor_name AS doctorName " +
                "FROM wlyy_outpatient op,wlyy_hospital_waiting_room room " +
                "WHERE op.`status`=0 AND room.outpatient_id=op.id AND room.consult_type=2 " +
                "AND room.doctor IS NOT NULL " +
                "AND room.reservation_time>='"+date+" 00:00:00' AND room.reservation_time<='"+date+" 23:59:59' GROUP BY room.doctor; ";
                "AND room.doctor IS NOT NULL ";
        if(StringUtils.isNoneBlank(dept)){
            waitingSql = waitingSql + " and op.dept = '"+dept+"' ";
        }
        waitingSql = waitingSql + "AND room.reservation_time>='"+date+" 00:00:00' AND room.reservation_time<='"+date+" 23:59:59' GROUP BY room.doctor; ";
    
        List<Map<String,Object>> waitinglist = jdbcTemplate.queryForList(waitingSql);
        if(waitinglist!=null&&waitinglist.size()>0){
@ -2278,9 +2286,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "AND room.outpatient_id=outpatient.id " +
                "AND consult.relation_code=outpatient.id " +
                "AND consult.status=0 " +
                "AND room.consult_type=2 " +
                "AND room.reservation_time>='"+date+" 00:00:00' AND room.reservation_time<='"+date+" 23:59:59' " +
                "GROUP BY room.doctor";
                "AND room.consult_type=2 ";
        if(StringUtils.isNoneBlank(dept)){
            onlineSql = onlineSql + " and outpatient.dept = '"+dept+"' ";
        }
        onlineSql = onlineSql+ "AND room.reservation_time>='"+date+" 00:00:00' AND room.reservation_time<='"+date+" 23:59:59' GROUP BY room.doctor";
        
        List<Map<String,Object>> onlinelist = jdbcTemplate.queryForList(onlineSql);
        if(onlinelist!=null&&onlinelist.size()>0){
            //根据身份证计算年龄