LAPTOP-KB9HII50\70708 1 éve
szülő
commit
1462e7166c

+ 8 - 8
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -111,9 +111,7 @@ public class MonitorPlatformService {
        String countSql = "select count(*) ";
        String sql = "select * ";
        String fileter = " from wlyy_patient_device_location where del=0 ";
        if(!StringUtils.isEmpty(deviceCommon)){
            fileter += " and device_common = '"+deviceCommon+"'";
        }
        if(!StringUtils.isEmpty(use)){
            fileter += " and use_code = '"+use+"'";
        }
@ -123,12 +121,16 @@ public class MonitorPlatformService {
        if(!StringUtils.isEmpty(networkTransmission)){
            fileter += " and network_transmission = '"+networkTransmission+"'";
        }
        if(!StringUtils.isEmpty(town)&&"350200".equals(town)){
        if(!StringUtils.isEmpty(town)&&!"350200".equals(town)){
            fileter += " and town = '"+town+"'";
        }
        if(!StringUtils.isEmpty(deviceCommon)){
            deviceCommon = deviceCommon.replace(",","','");
            fileter += " and device_common in ('"+deviceCommon+"')";
        }
        String limit = " limit "+(page-1)*size+","+size;
        Long totalCount = jdbcTemplate.queryForObject(countSql+fileter, Long.class);
        List<Map<String, Object>> result = jdbcTemplate.queryForList(sql+fileter+limit);
        List<IotLocationDataVO> locationDataVOList = new ArrayList<>();
        result.forEach(map -> {
@ -136,7 +138,7 @@ public class MonitorPlatformService {
            JSONObject location = JSONObject.parseObject(map.get("location").toString());
            GeoPoint geoPoint = new GeoPoint(Double.parseDouble(location.get("lat").toString()), Double.parseDouble(location.get("lon").toString()));
            locationDataVO.setId(map.get("id").toString());
            locationDataVO.setIdCard(AesEncryptUtils.decrypt(map.get("idcard")+""));
            locationDataVO.setIdCard(map.get("idcard")+"");
            locationDataVO.setCategoryCode(map.get("category_code")+"");
            locationDataVO.setDeviceSn(map.get("device_sn")+"");
            locationDataVO.setLocation(geoPoint);
@ -157,8 +159,6 @@ public class MonitorPlatformService {
            locationDataVOList.add(locationDataVO);
        });
        Long totalCount = jdbcTemplate.queryForObject(countSql+fileter, Long.class);
        return PageEnvelop.getSuccessListWithPage("获取成功",locationDataVOList,page,size,totalCount);
    }