diff --git a/sf_machine_connect/controllers/controllers.py b/sf_machine_connect/controllers/controllers.py index 2972345f..3b83cf2c 100644 --- a/sf_machine_connect/controllers/controllers.py +++ b/sf_machine_connect/controllers/controllers.py @@ -1327,8 +1327,8 @@ class Sf_Dashboard_Connect(http.Controller): cur.execute(""" SELECT * FROM device_data WHERE device_name = %s - AND device_state in ('待机', '警告', '运行中') AND time >= %s AND process_time IS NOT NULL - ORDER BY time ASC + AND device_state in ('待机', '警告', '运行中') AND time <= %s AND process_time IS NOT NULL + ORDER BY time DESC LIMIT 1; """, (item, time_threshold)) last_24_time = fetch_result_as_dict(cur)