aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-06-30 09:35:45 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-06-30 09:35:45 +1200
commitc646926a7fb0e66407c1ed7aa18daa1c9fc41cd8 (patch)
tree78ca671a6243330f0310e7f4b3836d23657b9d3e
parent15a7049210f7bcdfb56b6afaedbd9d23d2050bcb (diff)
downloadtrackermap-server-c646926a7fb0e66407c1ed7aa18daa1c9fc41cd8.tar.gz
trackermap-server-c646926a7fb0e66407c1ed7aa18daa1c9fc41cd8.tar.bz2
trackermap-server-c646926a7fb0e66407c1ed7aa18daa1c9fc41cd8.zip
Update OpenGTS queries (fix #1279)
-rw-r--r--opengts.xml6
1 files changed, 3 insertions, 3 deletions
diff --git a/opengts.xml b/opengts.xml
index 56a96e7e1..8f3b35835 100644
--- a/opengts.xml
+++ b/opengts.xml
@@ -21,13 +21,13 @@
<entry key='database.password'>[PASSWORD]</entry>
<entry key='database.selectDevicesAll'>
- SELECT imeiNumber AS id, imeiNumber AS imei FROM Device WHERE imeiNumber REGEXP '^[0-9]+$';
+ SELECT imeiNumber AS id, imeiNumber AS uniqueId FROM Device WHERE imeiNumber REGEXP '^[0-9]+$';
</entry>
<entry key='database.insertPosition'>
START TRANSACTION;
- UPDATE Device SET lastValidLatitude = :latitude, lastValidLongitude = :longitude, lastGPSTimestamp = UNIX_TIMESTAMP(:time), lastUpdateTime = UNIX_TIMESTAMP(NOW()) WHERE imeiNumber = RIGHT(CONCAT('000000000000000', :device_id), 15);
- SELECT @accountID := accountID, @deviceID := deviceID FROM Device WHERE imeiNumber = RIGHT(CONCAT('000000000000000', :device_id), 15);
+ UPDATE Device SET lastValidLatitude = :latitude, lastValidLongitude = :longitude, lastGPSTimestamp = UNIX_TIMESTAMP(:time), lastUpdateTime = UNIX_TIMESTAMP(NOW()) WHERE imeiNumber = RIGHT(CONCAT('000000000000000', :deviceId), 15);
+ SELECT @accountID := accountID, @deviceID := deviceID FROM Device WHERE imeiNumber = RIGHT(CONCAT('000000000000000', :deviceId), 15);
INSERT INTO EventData (accountID, deviceID, timestamp, statusCode, latitude, longitude, speedKPH, heading, altitude, rawData, creationTime, address)
VALUES (@accountID, @deviceID, UNIX_TIMESTAMP(:time), 0, :latitude, :longitude, :speed * 1.852, :course, :altitude, '', UNIX_TIMESTAMP(NOW()), :address);
COMMIT;