update : 12.11.2024 10:32:44,01

This commit is contained in:
Sabron 2024-11-12 10:32:44 +07:00
parent d8102d1be0
commit 7eee3528b5

View File

@ -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]