aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/database
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-12-27 10:21:19 -0800
committerGitHub <noreply@github.com>2021-12-27 10:21:19 -0800
commit790db6295f130e64c8346f13985dd0c15f938b40 (patch)
tree3fdb5bfc3bdb695bc29bde4105f22ac2da41e9cd /src/main/java/org/traccar/database
parent19f170b8c147935c8df4044a4fa3b6456baad6c7 (diff)
parent41453ca2ee76372a031ea206c264c1c7cde58ee6 (diff)
downloadtrackermap-server-790db6295f130e64c8346f13985dd0c15f938b40.tar.gz
trackermap-server-790db6295f130e64c8346f13985dd0c15f938b40.tar.bz2
trackermap-server-790db6295f130e64c8346f13985dd0c15f938b40.zip
Merge pull request #4740 from soshial/relative_filtering
Add support for relative filtering
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())