添加注释

This commit is contained in:
2026-09-21 17:24:14 +08:00
parent acf5eb1441
commit 71c7a3db2f
2 changed files with 35 additions and 14 deletions
+25 -12
View File
@@ -58,11 +58,16 @@ def update_emp_dao(id,update_data,db): #更新数据函数
def get_emp_dao( #获取学生就业信息函数
# stuid,
stuname
,compname
,db
, min_salary: int = 0
, max_salary: int | None = None
stuname
,stuclass
,compname
,min_salary
,max_salary
,somewhere
,employment_open_date
,offer_date
,db
# ,page
# ,page_size
): #根据选择条件获取信息
@@ -75,6 +80,10 @@ def get_emp_dao( #获取学生
if stuname: #根据学生姓名筛选
q = q.filter( Employments.stuname == stuname )
if stuclass:
q = q.filter(Employments.stuclass == stuclass)
if somewhere:
q = q.filter(Address.somewhere.like(f'%{somewhere}%'))
if compname: #根据公司姓名筛选
q=q.filter(Company.compname.like(f'%{compname}%'))
# r = q.offset( (page-1)*page_size ).limit( page_size ).all()
@@ -82,18 +91,22 @@ def get_emp_dao( #获取学生
q = q.filter(Employments.salary >= min_salary)
if max_salary is not None: ##根据最大薪资筛选
q = q.filter(Employments.salary <= max_salary)
if employment_open_date:
q = q.filter(Employments.employment_open_date == employment_open_date)
if offer_date:
q = q.filter(Employments.offer_date == offer_date)
r= q.all()
if r:
return [ {"id": i.id,
'stuname':i.stuname,
'stuclass':i.stuclass,
"company_name": compname,
"address":somewhere,
'学生姓名':i.stuname,
'学生班级':i.stuclass,
"公司": compname,
"公司区域":somewhere,
# "company_id": i.company_id,
"salary":i.salary,
"薪资":i.salary,
# "address_id": i.address_id,
"employment_open_date":i.employment_open_date,
"offer_date":i.offer_date,
"就业开放时间":i.employment_open_date,
"offer下发时间":i.offer_date,
"created_date": i.created_date,
"updated_date": i.updated_date,
"is_deleted":i.is_deleted } for i,compname,somewhere in r ] #返回信息列表