aboutsummaryrefslogtreecommitdiff
path: root/debug.xml
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-11 13:50:13 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-11 13:50:13 +1300
commitaa289b8600d9a55fdd053e003705de116ab25f2e (patch)
tree4d778f5b001f7eedc10dfae46603c92611fa8fe5 /debug.xml
parent16f2679a18d00270bd733292a11c67b38458bf7b (diff)
downloadtrackermap-server-aa289b8600d9a55fdd053e003705de116ab25f2e.tar.gz
trackermap-server-aa289b8600d9a55fdd053e003705de116ab25f2e.tar.bz2
trackermap-server-aa289b8600d9a55fdd053e003705de116ab25f2e.zip
Make changes to model hierarchy
Diffstat (limited to 'debug.xml')
-rw-r--r--debug.xml18
1 files changed, 18 insertions, 0 deletions
diff --git a/debug.xml b/debug.xml
index 5350536a1..5192dcb8b 100644
--- a/debug.xml
+++ b/debug.xml
@@ -111,6 +111,7 @@
deviceId INT NOT NULL,
serverTime TIMESTAMP NOT NULL,
deviceTime TIMESTAMP NOT NULL,
+ type VARCHAR(128),
attributes VARCHAR(4096) NOT NULL,
FOREIGN KEY (deviceId) REFERENCES device (id) ON DELETE CASCADE);
@@ -244,6 +245,23 @@
UPDATE device SET positionId = :id WHERE id = :deviceId;
</entry>
+ <entry key='database.selectData'>
+ SELECT * FROM data WHERE deviceId = :deviceId AND deviceTime BETWEEN :from AND :to ORDER BY deviceTime;
+ </entry>
+
+ <entry key='database.insertData'>
+ INSERT INTO data (deviceId, protocol, serverTime, deviceTime, type, attributes)
+ VALUES (:deviceId, :protocol, CURRENT_TIMESTAMP(), :time, :type, :attributes);
+ </entry>
+
+ <entry key='database.selectLatestData'>
+ SELECT * FROM data WHERE id IN (SELECT dataId FROM device);
+ </entry>
+
+ <entry key='database.updateLatestData'>
+ UPDATE device SET dataId = :id WHERE id = :deviceId;
+ </entry>
+
<!-- PROTOCOL CONFIG -->
<!--<entry key='detector.port'>5000</entry>-->