def get_password(self): sql = """SELECT * FROM user WHERE account='{account}' """.format(account=self.account) req = execute(sql) if req: req = req[0][2] return req
def find_account(self)->bool: """ 存在:True 不存在:Flase """ sql = """SELECT * FROM user WHERE account='{account}' """.format(account=self.account) if execute(sql): req = True else: req = False return req
def account_list()->list: """返回数据库中所有的帐号""" sql = "SELECT * FROM user" req = execute(sql) aclist = [] if req: for ac in req: aclist.append(ac[1]) else: aclist = None return aclist
def search(search_str:str)->tuple: sql = """SELECT * FROM source WHERE (student_no LIKE "{search_str}") or (course_no LIKE "{search_str}") or (source LIKE "%{search_str}%")""".format(search_str=search_str) return execute(sql)
def list_all(): sql = "SELECT * FROM class" return execute(sql)
def search(search_str:str)->tuple: sql = """SELECT * FROM course WHERE (course_no LIKE "%{search_str}%") or (course_name LIKE "%{search_str}%") or (period LIKE "%{search_str}%") or (credit LIKE "%{search_str}%") or (teacher_no LIKE "%{search_str}%")""".format(search_str=search_str) return execute(sql)
def list_all(): sql = "SELECT * FROM teacher" return execute(sql)
def search(search_str:str)->tuple: sql = """SELECT * FROM teacher WHERE (teacher_no LIKE "%{search_str}%") or (teacher_name LIKE "%{search_str}%") or (gender LIKE "{search_str}") or (post LIKE "%{search_str}%") or (tro_no LIKE "%{search_str}%")""".format(search_str=search_str) return execute(sql)
def list_all(): sql = "SELECT * FROM student" return execute(sql)
def list_all(): sql = "SELECT * FROM collage" return execute(sql)
def list_all(): sql = "SELECT * FROM tro" return execute(sql)
def search(search_str:str)->tuple: sql = """SELECT * FROM tro WHERE (tro_no LIKE "%{search_str}%") or (tro_name LIKE "%{search_str}%") or (tro_size LIKE "%{search_str}%") or (department_no LIKE "%{search_str}%")""".format(search_str=search_str) return execute(sql)
def search(search_str:str)->tuple: sql = """SELECT * FROM class WHERE (class_no LIKE "%{search_str}%") or (class_name LIKE "%{search_str}%") or (class_size LIKE "%{search_str}%") or (professional LIKE "%{search_str}%") or (department_no LIKE "%{search_str}%")""".format(search_str=search_str) return execute(sql)
def list_all(): sql = "SELECT * FROM department" return execute(sql)
def search(search_str:str)->tuple: sql = """SELECT * FROM department WHERE (department_no LIKE "%{search_str}%") or (name LIKE "%{search_str}%") or (tro_num LIKE "%{search_str}%") or (class_num LIKE "%{search_str}%") or (collage_no LIKE "%{search_str}%")""".format(search_str=search_str) return execute(sql)
def list_all(): sql = "SELECT * FROM source" return execute(sql)
def search(search_str:str)->tuple: sql = """SELECT * FROM student WHERE (student_no LIKE "%{search_str}%") or (student_name LIKE "%{search_str}%") or (gender LIKE "%{search_str}%") or (birthplace LIKE "%{search_str}%") or (class_no LIKE "%{search_str}%")""".format(search_str=search_str) return execute(sql)
def search(search_str:str)->tuple: sql = """SELECT * FROM collage WHERE (collage_no LIKE "%{search_str}%") or (collage_name LIKE "%{search_str}%") or (dean LIKE "%{search_str}%") or (tel LIKE "%{search_str}%") or (address LIKE "%{search_str}%")""".format(search_str=search_str) return execute(sql)