From 7eee3528b5c3adacc0e8c9b8efb505a394b60509 Mon Sep 17 00:00:00 2001 From: Sabron Date: Tue, 12 Nov 2024 10:32:44 +0700 Subject: [PATCH] update : 12.11.2024 10:32:44,01 --- apps/schedulers/tasks.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/schedulers/tasks.py b/apps/schedulers/tasks.py index c1facb4..fb18663 100644 --- a/apps/schedulers/tasks.py +++ b/apps/schedulers/tasks.py @@ -477,11 +477,11 @@ def load_sotekom(): cursor_device_model = cursor.fetchall() for device_model in cursor_device_model: element.model = device_type[1] - #SQL_QUERY = r'SELECT * FROM vw_WDATA_POSITION WHERE Machine = ' + "'" + str(data[1]) + "'" - #;cursor = mssql.executeSQL(conn,SQL_QUERY) - #cursor_position = cursor.fetchall() - #for position in cursor_position: - # logging.message(f' position = {cursor_position}') + SQL_QUERY = r'SELECT * FROM vw_WDATA_POSITION WHERE Machine = ' + "'" + str(data[1]) + "' ORDER BY AtTime DESC LIMIT 1" + cursor = mssql.executeSQL(conn,SQL_QUERY) + cursor_position = cursor.fetchall() + for position in cursor_position: + logging.message(f' position = {cursor_position}') # element.time = row[0]+ timedelta(hours=7) # element.lat = 0 if row[2] is None else row[2] # element.lon = 0 if row[3] is None else row[3]