Exemple #1
0
	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
Exemple #2
0
	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
Exemple #3
0
	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
Exemple #4
0
	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)
Exemple #5
0
	def list_all():
		sql = "SELECT * FROM class"
		return execute(sql)
Exemple #6
0
	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)
Exemple #7
0
	def list_all():
		sql = "SELECT * FROM teacher"
		return execute(sql)
Exemple #8
0
	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)
Exemple #9
0
	def list_all():
		sql = "SELECT * FROM student"
		return execute(sql)
Exemple #10
0
	def list_all():
		sql = "SELECT * FROM collage"
		return execute(sql)
Exemple #11
0
	def list_all():
		sql = "SELECT * FROM tro"
		return execute(sql)
Exemple #12
0
	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)
Exemple #13
0
	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)
Exemple #14
0
	def list_all():
		sql = "SELECT * FROM department"
		return execute(sql)
Exemple #15
0
	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)
Exemple #16
0
	def list_all():
		sql = "SELECT * FROM source"
		return execute(sql)
Exemple #17
0
	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)
Exemple #18
0
	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)