aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/database
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/database')
-rw-r--r--src/main/java/org/traccar/database/DataManager.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/database/DataManager.java b/src/main/java/org/traccar/database/DataManager.java
index 00c802fde..ebd0dcade 100644
--- a/src/main/java/org/traccar/database/DataManager.java
+++ b/src/main/java/org/traccar/database/DataManager.java
@@ -333,6 +333,13 @@ public class DataManager {
.executeQuery(Position.class);
}
+ public Position getPrecedingPosition(long deviceId, Date date) throws SQLException {
+ return QueryBuilder.create(dataSource, getQuery("database.selectPrecedingPosition"))
+ .setLong("deviceId", deviceId)
+ .setDate("time", date)
+ .executeQuerySingle(Position.class);
+ }
+
public void updateLatestPosition(Position position) throws SQLException {
QueryBuilder.create(dataSource, getQuery("database.updateLatestPosition"))
.setDate("now", new Date())