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)