From 5f45dd3e3b1d23ef6e3259f2eb00b757ffe4be3b Mon Sep 17 00:00:00 2001 From: zakhy <=> Date: Sun, 16 Feb 2025 18:31:39 +0700 Subject: [PATCH] =?UTF-8?q?=D0=BE=D1=82=D0=BA=D0=B0=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/schedulers/tasks.py | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/apps/schedulers/tasks.py b/apps/schedulers/tasks.py index d522ff3..270eea9 100644 --- a/apps/schedulers/tasks.py +++ b/apps/schedulers/tasks.py @@ -559,30 +559,7 @@ def load_asd(): element.speed = speed element.save() - cursor = connection.cursor() - cursor.execute(sql_query) - - sql_query = """ - WITH AlarmCounts AS ( - SELECT - *, - COUNT(*) OVER ( - PARTITION BY ta1.OBJID - ORDER BY ta1.ALARMTIME - RANGE BETWEEN NUMTODSINTERVAL(1, 'MINUTE') PRECEDING AND CURRENT ROW - ) AS AlarmCount - FROM - MFSB.TRUCKALARMS ta1 - WHERE - ta1.ALARMTYPE = 'Усталость водителя' -) -SELECT -* -FROM - AlarmCounts -WHERE - AlarmCount > 3 - """ + sql_query = """SELECT * FROM MFSB.TRUCKALARMS""" cursor = connection.cursor() cursor.execute(sql_query)