소스 검색

医生列表增加号别过滤

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

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

@ -932,7 +932,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            totalSql+= " AND d.charge_type is not null ";
            totalSql+= " AND d.charge_type is not null ";
        }
        }
        if(StringUtils.isNotBlank(outpatientType)){
        if(StringUtils.isNotBlank(outpatientType)){
            totalSql+= " AND d.outpatient_type like'%"+outpatientType+"%'";
            if(outpatientType.contains("or")){
                String[] outpatientTypeArray = outpatientType.split("or");
                totalSql+= " AND ( ";
    
                for (int i = 0; i < outpatientTypeArray.length; i++) {
                    totalSql +=" d.outpatient_type like'%"+outpatientTypeArray[i]+"%'";
                    if(i != outpatientTypeArray.length -1){
                        totalSql += " or ";
                    }
                }
                totalSql+= "  ) ";
            }else{
                totalSql+= " AND d.outpatient_type like'%"+outpatientType+"%'";
            }
        }else{
        }else{
            totalSql+=" AND d.outpatient_type is not null ";
            totalSql+=" AND d.outpatient_type is not null ";
        }
        }
@ -985,16 +998,32 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if(StringUtils.isNotBlank(orgCode)){
        if(StringUtils.isNotBlank(orgCode)){
            sql+= " AND h.org_code = '"+orgCode+"'";
            sql+= " AND h.org_code = '"+orgCode+"'";
        }
        }
    
        if(StringUtils.isNotBlank(chargeType)){
        if(StringUtils.isNotBlank(chargeType)){
            sql+= " AND d.charge_type ='"+chargeType+"'";
            sql+= " AND d.charge_type ='"+chargeType+"'";
        }else{
        }else{
            sql+= " AND d.charge_type is not null";
            sql+= " AND d.charge_type is not null";
        }
        }
        
        if(StringUtils.isNotBlank(outpatientType)){
        if(StringUtils.isNotBlank(outpatientType)){
            sql+= " AND d.outpatient_type like'%"+outpatientType+"%'";
            if(outpatientType.contains("or")){
                String[] outpatientTypeArray = outpatientType.split("or");
                sql+= " AND ( ";
            
                for (int i = 0; i < outpatientTypeArray.length; i++) {
                    sql +=" d.outpatient_type like'%"+outpatientTypeArray[i]+"%'";
                    if(i != outpatientTypeArray.length -1){
                        sql += " or ";
                    }
                }
                sql+= " ) ";
            }else{
                sql+= " AND d.outpatient_type like'%"+outpatientType+"%'";
            }
        }else{
        }else{
            sql+= " AND d.outpatient_type is not null ";
            sql+=" AND d.outpatient_type is not null ";
        }
        }
        
        if(StringUtils.isNotBlank(key)){
        if(StringUtils.isNotBlank(key)){
            sql+=" AND (h.dept_name like '%"+key+"%' OR d.name like '%"+key+"%' OR d.expertise like '%"+key+"%') ";
            sql+=" AND (h.dept_name like '%"+key+"%' OR d.name like '%"+key+"%' OR d.expertise like '%"+key+"%') ";
        }
        }
@ -1013,7 +1042,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    " AND t.start_time <='"+endDate+"'"+
                    " AND t.start_time <='"+endDate+"'"+
                    " )";
                    " )";
        }
        }
        sql += " AND d.del='1'AND d.charge_type is not null AND d.outpatient_type is not null LIMIT " + (page - 1) * size + "," + size + "";
        sql += " AND d.del='1' AND d.outpatient_type is not null LIMIT " + (page - 1) * size + "," + size + "";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if(list!=null&&list.size()>0){
        if(list!=null&&list.size()>0){
            //获取排班
            //获取排班
@ -2880,7 +2909,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        }
    
    
        if(StringUtils.isNotBlank(outpatientType)){
        if(StringUtils.isNotBlank(outpatientType)){
            sql+=" AND d.outpatient_type like '%"+outpatientType+"%' ";
            if(outpatientType.contains("or")){
                String[] outpatientTypeArray = outpatientType.split("or");
                sql+= " AND ( ";
            
                for (int i = 0; i < outpatientTypeArray.length; i++) {
                    sql +=" d.outpatient_type like'%"+outpatientTypeArray[i]+"%'";
                    if(i != outpatientTypeArray.length -1){
                        sql += " or ";
                    }
                }
                sql+= " ) ";
            }else{
                sql+= " AND d.outpatient_type like'%"+outpatientType+"%'";
            }
        }else{
            sql+=" AND d.outpatient_type is not null ";
        }
        }
    
    
        if(StringUtils.isNotBlank(keyName)){
        if(StringUtils.isNotBlank(keyName)){
@ -2896,7 +2940,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            sql+=" AND d.consult_status = '"+consultStatus+"' ";
            sql+=" AND d.consult_status = '"+consultStatus+"' ";
        }
        }
    
    
        sql += " and d.del='1' and d.charge_type is not null  AND d.outpatient_type is not null order by a.total "+ consutlSort +" limit "+page * pagesize +","+pagesize;
        sql += " and d.del='1' order by a.total "+ consutlSort +" limit "+page * pagesize +","+pagesize;
        
        
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        logger.info("findDoctorByHospitalAndDiseaseAndDept end:"+DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));
        logger.info("findDoctorByHospitalAndDiseaseAndDept end:"+DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));