马睿智牛逼!

This commit is contained in:
test1
2026-09-22 14:50:43 +08:00
parent 751d430e3e
commit e9086e842b
2 changed files with 29 additions and 2 deletions
+22 -1
View File
@@ -107,4 +107,25 @@ def select_days2(db):
).all()
return l2
except Exception:
raise HTTPException(status_code=500, detail="查询异常")
raise HTTPException(status_code=500, detail="查询异常")
# 薪资区间分布:统计薪资在5k以下、5k-10k、10k-15k、15k以上的人数分布,反映学生的整体就业质量。
def classify_salary(db):
try:
a=b=c=d=0
l=db.query(Employment_info).filter(Employment_info.delete_status==0).all()
for i in l:
if i.salary is None:
continue
elif i.salary<5000:
a+=1
elif 5000<=i.salary<10000:
b+=1
elif 10000<=i.salary<15000:
c+=1
else:
d+=1
return {'5k以下': a, '5k-10k': b, '10k-15k': c, '15k': d}
except:
raise HTTPException(status_code=500,detail='查询异常!')