lmstack 3 年之前
父节点
当前提交
630451e159
共有 1 个文件被更改,包括 2 次插入2 次删除
  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()