Ver código fonte

低电量报警

qingfeng 2 anos atrás
pai
commit
995684b1f6

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

@@ -47,7 +47,7 @@ def low_soc_alarm_sta(df_sns, db_qxcas_engine, conn, db_sp_engine):
         df = df_lowsocalarm_lastday[df_lowsocalarm_lastday['sn']==sn]
         df1 = df_all_alarm_info[df_all_alarm_info['product_id']==sn]
 
-        sql = ''' update all_fault_info set update_time='{}', end_time='{}' where product_id = '{}' and start_time = '{}' and code = {}'''.format \
+        sql = "update all_fault_info set update_time='{}', end_time='{}' where product_id = '{}' and start_time = '{}' and code = '{}'".format \
                     (now, datetime.datetime.strftime(now,"%Y-%m-%d %H:%M:%S"), sn, pd.to_datetime(df1['start_time'].values[0]), df1['code'].values[0])
         cursor.execute(sql)
         conn.commit()