|
@@ -66,9 +66,13 @@ if __name__ == '__main__':
|
|
|
df_diag_ram = pd.read_sql(sql, db_engine)
|
|
|
|
|
|
# 修改数据库示例
|
|
|
- session = Session()
|
|
|
- sql = 'insert into table (data) values (:data)'
|
|
|
- params = {'data':1}
|
|
|
+ # session = Session()
|
|
|
+ # sql = 'insert into table (data) values (:data)'
|
|
|
+ # params = {'data':1}
|
|
|
+ # session.execute(sql,params=params)
|
|
|
+
|
|
|
+ sql = "update all_fault_info_copy set update_time=:time,end_time=:end_time where product_id=:sn and end_time=:end_time and code=:code"
|
|
|
+ params = {"time":datetime.datetime.now(), "end_time":end_time, "sn":sn, "code":'C493'}
|
|
|
session.execute(sql,params=params)
|
|
|
session.commit()
|
|
|
session.close()
|