|
|
|
@ -16,10 +16,6 @@ class DeptDao(BaseDao): |
|
|
|
|
dept_qry = dept_qry.filter( |
|
|
|
|
DeptEntity.name.like(f"%{dept.name}%") |
|
|
|
|
) |
|
|
|
|
if dept.status is not None: |
|
|
|
|
dept_qry = dept_qry.filter( |
|
|
|
|
DeptEntity.status == dept.status |
|
|
|
|
) |
|
|
|
|
parent_results = dept_qry.all() |
|
|
|
|
|
|
|
|
|
# 初始化结果列表 |
|
|
|
@ -31,6 +27,10 @@ class DeptDao(BaseDao): |
|
|
|
|
DeptEntity.parent_id == parent_id, |
|
|
|
|
DeptEntity.deleted == 0 |
|
|
|
|
) |
|
|
|
|
if dept.status is not None: |
|
|
|
|
subdept_qry = subdept_qry.filter( |
|
|
|
|
DeptEntity.status == dept.status |
|
|
|
|
) |
|
|
|
|
subdept_qry = subdept_qry.order_by(DeptEntity.sort.asc()) |
|
|
|
|
subdepts = subdept_qry.all() |
|
|
|
|
for subdept in subdepts: |
|
|
|
|