Skip to content

Commit

Permalink
fix(monitoring): also include detections with the same timestamp to a…
Browse files Browse the repository at this point in the history
…lways return a detection if one existed
  • Loading branch information
NuttyShrimp committed Mar 8, 2023
1 parent f8ea463 commit ac75872
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/telraam/database/daos/DetectionDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ INSERT INTO detection (station_id, baton_id, timestamp, rssi, battery, remote_id
List<Detection> getSinceId(@Bind("id") int id, @Bind("limit") int limit);


@SqlQuery("SELECT * FROM detection WHERE baton_id = :batonId AND timestamp > :timestamp ORDER BY timestamp DESC LIMIT 1")
@SqlQuery("SELECT * FROM detection WHERE baton_id = :batonId AND timestamp >= :timestamp ORDER BY timestamp DESC LIMIT 1")
@RegisterBeanMapper(Detection.class)
Optional<Detection> latestDetectionByBatonId(@Bind("batonId") int batonId, @Bind("timestamp") Timestamp timestamp);

Expand Down

0 comments on commit ac75872

Please sign in to comment.