瀏覽代碼

Merge branch 'dev' of zd_123/patient-co-management into dev

huangwenjie 7 年之前
父節點
當前提交
74177553db

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -5634,7 +5634,7 @@ public class StatisticsESService {
                        obj.put("code", one.get("doctorCode"));
                        obj.put("name", one.get("doctorName"));
                        obj.put("amount", one.get("amount"));
                        obj = deviceRateList(obj,hos,String.valueOf(obj.get("doctorCode")));
                        obj = deviceRateList(obj,hos);
                        if("other".equals(one.get("doctorCode")+"")){
                            amount += Integer.valueOf(obj.get("amount")+"");
                            allNum += Integer.valueOf(obj.get("allNum")+"");
@ -5766,14 +5766,14 @@ public class StatisticsESService {
    }
    //按绑定的医生列表展示绑定的设备列表
    public Map<String, Object> deviceRateList(Map<String, Object> reMap,Hospital hos,String doctor){
    public Map<String, Object> deviceRateList(Map<String, Object> reMap,Hospital hos){
//        String sql = " select count(1) as amount from wlyy.wlyy_patient_device p JOIN wlyy.wlyy_doctor r on p.doctor is not null and  p.doctor =r.code  LEFT JOIN device.wlyy_devices d on p.device_sn=d.device_code where  p.doctor is not null and d.grant_org_code ='" + hos.getCode() + "' and p.doctor='"+reMap.get("code")+"'";
        String temp = "other".equals(reMap.get("code"))? " and p.doctor is null ":" and p.doctor='"+reMap.get("code")+"' ";
        String temp = "other".equals(reMap.get("code"))? " and wd.grant_org_code ='"+hos.getCode()+"' and (wd.grant_doctor is null or wd.grant_doctor='')":" and wd.grant_doctor='"+String.valueOf(reMap.get("code"))+"' ";
       /* String sql = " select count(1) as amount " +
                " from (select  DISTINCT p.doctor,r.name,p.device_sn FROM wlyy.wlyy_patient_device p left join device.wlyy_devices d on p.device_sn=d.device_code left JOIN wlyy.wlyy_doctor r ON  p.doctor = r. CODE " +
                " where d.is_binding in (1,2) and p.category_code in('1','2') and d.grant_org_code ='" + hos.getCode() + "' "+temp+") a " +
                " GROUP BY a.doctor,a.name";*/
       String sql ="SELECT count(1) as amount from device.wlyy_devices wd LEFT JOIN dm_device dd ON wd.device_model=dd.model where grant_doctor ='"+doctor+"' AND dd.category_code IN('1','2')";
       String sql ="SELECT count(1) as amount from device.wlyy_devices wd LEFT JOIN dm_device dd ON wd.device_model=dd.model where 1=1 "+temp+" AND dd.category_code IN('1','2') and wd.is_grant=1";
//        Map<String, Object> map = jdbcTemplate.queryForMap(sql);
        List<Map<String,Object>> result = jdbcTemplate.queryForList(sql);
        Map<String,Object> map = result.get(0);