From 2daae73d7849cac8d775cc606a4a83ae3e518282 Mon Sep 17 00:00:00 2001 From: zakhy <=> Date: Sun, 16 Feb 2025 18:15:53 +0700 Subject: [PATCH] =?UTF-8?q?=D0=BB=D0=BE=D0=B3=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/schedulers/tasks.py | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/apps/schedulers/tasks.py b/apps/schedulers/tasks.py index f4432df..4fd28f7 100644 --- a/apps/schedulers/tasks.py +++ b/apps/schedulers/tasks.py @@ -559,28 +559,11 @@ def load_asd(): element.speed = speed element.save() - sql_query = """ - SELECT - ta1.ALARMID, - ta1.OBJID, - ta1.LAT, - ta1.LON, - ta1.ALARMTIME, - ta1.ALARMTYPE -FROM - MFSB.TRUCKALARMS ta1 -WHERE - ta1.ALARMTYPE = 'Усталость водителя' - AND EXISTS ( - SELECT 1 - FROM MFSB.TRUCKALARMS ta2 - WHERE - ta2.OBJID = ta1.OBJID - AND ta2.ALARMTIME BETWEEN ta1.ALARMTIME - (1 / 1440) AND ta1.ALARMTIME - AND ta2.ALARMTYPE = 'Усталость водителя' - HAVING COUNT(*) > 3 - ); - """ + sql_query = """SELECT * FROM v$version;""" + cursor = connection.cursor() + cursor.execute(sql_query) + logging.message(cursor) + sql_query = """SELECT * FROM MFSB.TRUCKALARMS""" cursor = connection.cursor() cursor.execute(sql_query)