Преглед на файлове

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

wangzhinan преди 5 години
родител
ревизия
f8c44ca9c2

+ 9 - 1
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorService.java

@ -42,7 +42,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
     * @param page
     * @param pageSize
     */
    public Envelop queryList(String city, String hospital, String status, String name, int page, int pageSize){
    public Envelop queryList(String city, String hospital, String status, String name, String type, int page, int pageSize){
        Map<String,Object> params = new HashedMap();
        String sqlTotal ="SELECT " +
                " COUNT(1) AS \"total\" " +
@ -70,6 +70,11 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
            sqlTotal += " AND (a.name like:name or b.dept_name like:name)";
            params.put("name",name);
        }
        if (StringUtils.isNotBlank(type)){
            type = "%"+type+"%";
            sqlTotal += " AND a.outpatient_type like:type";
            params.put("type",type);
        }
        sqlTotal += " AND e.dept_type_code =:typeCode";
        params.put("typeCode",6);
        Long count = 0L;
@ -105,6 +110,9 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        if (StringUtils.isNotBlank(name)){
            sql += " AND (a.name like:name or b.dept_name like:name)";
        }
        if (StringUtils.isNotBlank(type)){
            sql += " AND a.outpatient_type like:type";
        }
        sql += " AND e.dept_type_code =:typeCode";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params,page,pageSize);

+ 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 ";
        }
        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{
            totalSql+=" AND d.outpatient_type is not null ";
        }
@ -985,16 +998,32 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if(StringUtils.isNotBlank(orgCode)){
            sql+= " AND h.org_code = '"+orgCode+"'";
        }
    
        if(StringUtils.isNotBlank(chargeType)){
            sql+= " AND d.charge_type ='"+chargeType+"'";
        }else{
            sql+= " AND d.charge_type is not null";
        }
        
        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 ";
            sql+=" AND d.outpatient_type is not null ";
        }
        
        if(StringUtils.isNotBlank(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+"'"+
                    " )";
        }
        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);
        if(list!=null&&list.size()>0){
            //获取排班
@ -2880,7 +2909,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
    
        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)){
@ -2896,7 +2940,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            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);
        logger.info("findDoctorByHospitalAndDiseaseAndDept end:"+DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));

+ 4 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/config/DoctorServiceEndPoint.java

@ -39,14 +39,16 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
            @RequestParam(value = "hospital", required = false) String hospital,
            @ApiParam(name = "status", value = "状态")
            @RequestParam(value = "status", required = false) String status,
            @ApiParam(name = "name", value = "科室或病种名称")
            @ApiParam(name = "name", value = "科室或医生名称")
            @RequestParam(value = "name", required = false) String name,
            @ApiParam(name = "type", value = "咨询类型")
            @RequestParam(value = "type", required = false) String type,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "pageSize", value = "页码", required = true, defaultValue = "10")
            @RequestParam(value = "pageSize") int pageSize) throws Exception {
        return baseDoctorService.queryList(city,hospital,status,name,page,pageSize);
        return baseDoctorService.queryList(city,hospital,status,name,type,page,pageSize);
    }