def sigle_data_select(boat=None, route=None, company=None): if boat is not None: sql = f"SELECT * FROM main_boat where boat=\"{boat}\"" if route is not None: sql = f"SELECT * FROM route_detail where route=\"{route}\"" if company is not None: sql += f" and company=\"{company}\"" print(sql) return sql_handle.sql_search(sql)
def main_data_select(need="description_zh", company=None, boat=None, table="main_boat", route=None): sql = f"SELECT * FROM {table} where {need}=\"\"" if company is not None: sql += f" and company=\"{company}\"" if boat is not None: sql += f" and boat=\"{boat}\"" if route is not None: sql += f" and route=\"{route}\"" print(sql) return sql_handle.sql_search(sql)
def sea_select(sql=f"SELECT * FROM main_route where company=\"{COMPANY}\""): return sql_handle.sql_search(sql)
def company_select(): sql = f"SELECT * FROM company_list " return sql_handle.sql_search(sql)
def route_detail_select(need="description_zh", company=None): sql = f"SELECT * FROM route_detail where {need}=\"\"" if company is not None: sql += f" and company=\"{company}\"" return sql_handle.sql_search(sql)
def all_boat(): sql = f"SELECT * FROM main_boat" return sql_handle.sql_search(sql)
def all_route(): sql = f"SELECT * FROM route_detail" return sql_handle.sql_search(sql)
def route_detail_select(route=None): sql = f"SELECT * FROM route_detail where company=\"{COMPANY}\"" if route is not None: sql += f" and route=\"{route}\" " return sql_handle.sql_search(sql)
def select_main_boats(boat=None): sql = f"SELECT * FROM main_boat where company=\"{COMPANY}\"" if boat is not None: sql += f" and boat=\"{boat}\" " return sql_handle.sql_search(sql)