diff --git a/app/phase_db_func.py b/app/phase_db_func.py index f2fcbca..cb586b8 100644 --- a/app/phase_db_func.py +++ b/app/phase_db_func.py @@ -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)