第四版_完整

This commit is contained in:
jianqi
2026-09-14 15:23:26 +08:00
parent 06c329fdd1
commit c2909191d2
14 changed files with 84 additions and 64 deletions
+5 -6
View File
@@ -7,8 +7,7 @@ from sqlalchemy.orm import Session
from model.employ_model import StudentEmployManage as ETable
from scheme.employ_scheme import EmployStatusCreate as EModel, EmployStatusQuery as QModel,EmployStatusDelete as DModel
from model.stu_model import StuInfo
from typing import Optional, List
from typing import List
class StudentEmployManageDAO:
"""
封装stu_emp_mgmt 表的所有数据库操作(增、删、改、查)
@@ -197,13 +196,13 @@ class StudentEmployManageDAO:
:return: 返回查询到的 所有 学生就业信息
"""
e_all = db.query(ETable)
if emp_sta_query.stu_id: # 根据 学生编号 筛选出 学生就业信息
if emp_sta_query.stu_id is not None: # 根据 学生编号 筛选出 学生就业信息
e_all = e_all.filter(ETable.stu_id == emp_sta_query.stu_id)
if emp_sta_query.emp_company: # 根据 就业公司名称 模糊筛选出 学生就业信息
if emp_sta_query.emp_company is not None: # 根据 就业公司名称 模糊筛选出 学生就业信息
e_all = e_all.filter(ETable.emp_company.like(f"%{emp_sta_query.emp_company}%"))
if emp_sta_query.min_salary: # 根据 最小薪资范围 筛选出 大于 最小薪资范围的 学生就业信息
if emp_sta_query.min_salary is not None: # 根据 最小薪资范围 筛选出 大于 最小薪资范围的 学生就业信息
e_all = e_all.filter(ETable.salary >= emp_sta_query.min_salary)
if emp_sta_query.max_salary: # 根据 最大薪资范围 筛选出 小于 最大薪资范围的 学生就业信息
if emp_sta_query.max_salary is not None: # 根据 最大薪资范围 筛选出 小于 最大薪资范围的 学生就业信息
e_all = e_all.filter(ETable.salary <= emp_sta_query.max_salary)
total = e_all.count()