aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-08-05 16:34:32 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-08-05 16:34:32 +1200
commit5d8646147ca232d3a55d572e345308c3da97542d (patch)
tree63b8e77cce38103f2f3d21399cc5c13d8b9f3b19 /tools
parent3e95a6d0a2e87fa5903806593de269f609c17829 (diff)
downloadtraccar-server-5d8646147ca232d3a55d572e345308c3da97542d.tar.gz
traccar-server-5d8646147ca232d3a55d572e345308c3da97542d.tar.bz2
traccar-server-5d8646147ca232d3a55d572e345308c3da97542d.zip
Update OpenGTS config file
Diffstat (limited to 'tools')
-rw-r--r--tools/opengts.xml6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/opengts.xml b/tools/opengts.xml
index 8f3b35835..b1bfa197b 100644
--- a/tools/opengts.xml
+++ b/tools/opengts.xml
@@ -21,13 +21,13 @@
<entry key='database.password'>[PASSWORD]</entry>
<entry key='database.selectDevicesAll'>
- SELECT imeiNumber AS id, imeiNumber AS uniqueId FROM Device WHERE imeiNumber REGEXP '^[0-9]+$';
+ SELECT CONCAT('1', 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', :deviceId), 15);
- SELECT @accountID := accountID, @deviceID := deviceID FROM Device WHERE imeiNumber = RIGHT(CONCAT('000000000000000', :deviceId), 15);
+ UPDATE Device SET lastValidLatitude = :latitude, lastValidLongitude = :longitude, lastGPSTimestamp = UNIX_TIMESTAMP(:time), lastUpdateTime = UNIX_TIMESTAMP(NOW()) WHERE imeiNumber = SUBSTRING(CAST(:deviceId AS CHAR(32)), 2);
+ SELECT @accountID := accountID, @deviceID := deviceID FROM Device WHERE imeiNumber = SUBSTRING(CAST(:deviceId AS CHAR(32)), 2);
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;