liubing 3 лет назад
Родитель
Сommit
7cfe3cbd07

+ 6 - 6
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/PatientDeviceService.java

@ -990,10 +990,10 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
            }else{
                switch (device.getCategoryCode()){
                    case "1"://血压设备
                        result = getHealthIndex(result,1,deviceSn,null,page,pageSize);
                        result = getHealthIndex(result,1,deviceSn,patient,page,pageSize);
                        break;
                    case "2"://血糖设备
                        result = getHealthIndex(result,2,deviceSn,null,page,pageSize);
                        result = getHealthIndex(result,2,deviceSn,patient,page,pageSize);
                        break;
                    default://安防设备
                        result  = getEmeWarn(result,deviceSn,null,page,pageSize);
@ -1013,8 +1013,8 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
        result.put("dataList",new ArrayList<>());
        if (type == 1) {
            List<Object> re = new ArrayList<>();
            String countSql =" select count(*) from wlyy_patient_health_index a where a.user = '"+patient+"' " +
                    " and a.type=1 and a.device_sn='"+deviceSn+"' and a.del = '1' group by DATE_FORMAT(a.record_date,'%Y-%m-%d') ";
            String countSql =" select count(Distinct DATE_FORMAT(a.record_date,'%Y-%m-%d')) from wlyy_patient_health_index a where a.user = '"+patient+"' " +
                    " and a.type=1 and a.device_sn='"+deviceSn+"' and a.del = '1' ";
            count = jdbcTemplate.queryForObject(countSql,Long.class);
            String sql =" select DATE_FORMAT(a.record_date,'%Y-%m-%d') from wlyy_patient_health_index a where a.user = '"+patient+"' " +
                    " and a.type=1 and a.device_sn='"+deviceSn+"' and a.del = '1' group by DATE_FORMAT(a.record_date,'%Y-%m-%d') order by DATE_FORMAT(a.record_date,'%Y-%m-%d') desc limit "+pageRequest.getOffset()+" ,"+pageRequest.getPageSize();
@ -1032,8 +1032,8 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
        else if (type == 2){
            JSONArray re = new JSONArray();
            // 排序
            String countSql =" select count(*) from wlyy_patient_health_index a where a.user = '"+patient+"' " +
                    " and a.type=2 and a.device_sn='"+deviceSn+"' and a.del = '1' GROUP BY user,value1,value2,value3,value4,value5,value6,value7,type,record_date,sort_date ";
            String countSql =" select count(distinct user,value1,value2,value3,value4,value5,value6,value7,type,record_date,sort_date ) from wlyy_patient_health_index a where a.user = '"+patient+"' " +
                    " and a.type=2 and a.device_sn='"+deviceSn+"' and a.del = '1'  ";
            count = jdbcTemplate.queryForObject(countSql,Long.class);
            String sql = "SELECT " +
                    "MIN(id) id" +