26 lines
779 B
Python
26 lines
779 B
Python
|
|
# -*- coding: utf-8 -*-
|
||
|
|
# @Author: Owl
|
||
|
|
# @Date: 2025/10/10 16:17
|
||
|
|
# @Description:
|
||
|
|
|
||
|
|
from app.db_func_base import *
|
||
|
|
|
||
|
|
|
||
|
|
class CrossDbHelper(TableDbHelperBase):
|
||
|
|
|
||
|
|
def __init__(self, pool):
|
||
|
|
self.db_pool = pool
|
||
|
|
self.DB_Name = 'ledger'
|
||
|
|
|
||
|
|
def query_cross_usable_date_sql(self, crossid, nodeid):
|
||
|
|
sql = f"""
|
||
|
|
select distinct day from traffic_{nodeid}.cross_delay where crossid = '{crossid}'
|
||
|
|
"""
|
||
|
|
return self.do_select(sql)
|
||
|
|
|
||
|
|
def query_cross_delay_info(self, crossid, nodeid, date_list, tp_start, tp_end):
|
||
|
|
sql = f"""
|
||
|
|
select * from traffic_{nodeid}.cross_delay where crossid = '{crossid}' and day in ({date_list}) and tp_start = '{tp_start}' and tp_end = '{tp_end}'
|
||
|
|
"""
|
||
|
|
return self.do_select(sql)
|