lmstack 3 years ago
parent
commit
630451e159
1 changed files with 2 additions and 2 deletions
  1. 2 2
      LIB/MIDDLE/SaftyCenter/Low_Soc_Alarm/low_soc_alarm_sta.py

+ 2 - 2
LIB/MIDDLE/SaftyCenter/Low_Soc_Alarm/low_soc_alarm_sta.py

@@ -10,8 +10,8 @@ def low_soc_alarm_sta(db_qxcas_engine, conn, db_sp_engine):
     
     cursor = conn.cursor()
 
-    sql = "select sn, DATE_FORMAT(time, '%Y-%m-%d %H:%i:%s') as time, level from lowsoc_info where add_time >DATE_FORMAT( DATE_SUB(CURDATE(), INTERVAL -1 DAY), '%Y-%m-%d 00:00:00')"+ \
-        " and  add_time <DATE_FORMAT( DATE_SUB(CURDATE(), INTERVAL -1 DAY), '%Y-%m-%d 23:59:59')"           
+    sql = "select sn, DATE_FORMAT(time, '%Y-%m-%d %H:%i:%s') as time, level from lowsoc_info where add_time >DATE_FORMAT( DATE_SUB(CURDATE(), INTERVAL 0 DAY), '%Y-%m-%d 00:00:00')"+ \
+        " and  add_time <DATE_FORMAT( DATE_SUB(CURDATE(), INTERVAL 0 DAY), '%Y-%m-%d 23:59:59')"           
     df_lowsocalarm_lastday = pd.read_sql(sql, db_qxcas_engine)
     sn_lowsoc = df_lowsocalarm_lastday['sn'].tolist()