diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-20 16:57:21 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-20 16:57:21 +1200 |
commit | 6dfee3947ef96e1092b668ecfc7c58037355ffb8 (patch) | |
tree | d29ab479106c97b6443bc9c6a439f315bafa18b0 /src/org/traccar/database/DataManager.java | |
parent | eb586ea7e074c87444663aa71e9da6f538429ae5 (diff) | |
download | trackermap-server-6dfee3947ef96e1092b668ecfc7c58037355ffb8.tar.gz trackermap-server-6dfee3947ef96e1092b668ecfc7c58037355ffb8.tar.bz2 trackermap-server-6dfee3947ef96e1092b668ecfc7c58037355ffb8.zip |
Implement position report loading
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r-- | src/org/traccar/database/DataManager.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index 5e921c0ea..82e312c7e 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -25,13 +25,7 @@ import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; -import java.util.Calendar; -import java.util.Collection; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; +import java.util.*; import javax.sql.DataSource; import org.traccar.helper.DriverDelegate; import org.traccar.model.Device; @@ -381,4 +375,13 @@ public class DataManager { .executeUpdate(); } + public Collection<Position> getPositions(long userId, long deviceId, Date from, Date to) throws SQLException { + return QueryBuilder.create(dataSource, + "SELECT * FROM position WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to;") + .setLong("deviceId", deviceId) + .setDate("from", from) + .setDate("to", to) + .executeQuery(new Position()); + } + } |