新增查询时间

Signed-off-by: yinzijian <yinzijian@haomozhixing.onaliyun.com>
This commit is contained in:
yinzijian 2026-03-23 16:38:44 +08:00
parent acbf7c5987
commit e161101976
1 changed files with 17 additions and 0 deletions

View File

@ -830,6 +830,23 @@ class PhaseTableDbHelper(TableDbHelperBase):
return None, e
finally:
self.close(conn, cursor)
def query_cross_phase_update_time(self, crossids, citycode):
conn, cursor = self.connect()
try:
sql = f"""select xl_crossid, max(update_time) max_update_time
from phase_record
where xl_crossid in %s
and nodeid = %s
group by xl_crossid"""
print(cursor.mogrify(sql, (crossids,citycode)))
cursor.execute(sql, (crossids,citycode))
result = cursor.fetchall()
return result, None
except Exception as error:
return None, error
finally:
self.close(conn, cursor)
# if __name__ == '__main__':
# tt_5min = get_latest_5min_timestamp()
# print(tt_5min)