Merge pull request 'fix: 해구 조회 바운딩 박스 간소화' (#28) from feature/dashboard-phase-1 into develop
This commit is contained in:
커밋
908f047f55
@ -103,18 +103,18 @@ public class MonitoringController {
|
|||||||
JOIN signal.t_ais_position a
|
JOIN signal.t_ais_position a
|
||||||
ON a.lat BETWEEN h.min_lat AND h.max_lat
|
ON a.lat BETWEEN h.min_lat AND h.max_lat
|
||||||
AND a.lon BETWEEN h.min_lon AND h.max_lon
|
AND a.lon BETWEEN h.min_lon AND h.max_lon
|
||||||
AND public.ST_Contains(h.geom, a.geom)
|
|
||||||
WHERE a.last_update > NOW() - INTERVAL '30 minutes'
|
WHERE a.last_update > NOW() - INTERVAL '30 minutes'
|
||||||
GROUP BY h.haegu_no, h.min_lat, h.min_lon, h.max_lat, h.max_lon,
|
GROUP BY h.haegu_no, h.min_lat, h.min_lon, h.max_lat, h.max_lon,
|
||||||
h.center_lon, h.center_lat, h.geom
|
h.center_lon, h.center_lat
|
||||||
HAVING COUNT(DISTINCT a.mmsi) > 0
|
HAVING COUNT(DISTINCT a.mmsi) > 0
|
||||||
ORDER BY current_vessels DESC
|
ORDER BY current_vessels DESC
|
||||||
LIMIT 50
|
LIMIT 50
|
||||||
""";
|
""";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
List<Map<String, Object>> result = queryJdbcTemplate.queryForList(sql);
|
List<Map<String, Object>> result = queryJdbcTemplate.queryForList(sql);
|
||||||
log.info("Haegu realtime query returned {} rows", result.size());
|
log.info("Haegu realtime query: {} rows in {}ms", result.size(), System.currentTimeMillis() - start);
|
||||||
return result;
|
return result;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Failed to get realtime haegu status: {}", e.getMessage(), e);
|
log.error("Failed to get realtime haegu status: {}", e.getMessage(), e);
|
||||||
|
|||||||
불러오는 중...
Reference in New Issue
Block a user