!37 修复删除部门的碧油鸡

Merge pull request !37 from LiZongLiang/master
This commit is contained in:
1024创新实验室 2024-09-02 13:46:09 +00:00 committed by Gitee
commit 8920b35945
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ public class DepartmentService {
} }
// 是否有未删除员工 // 是否有未删除员工
int employeeNum = employeeDao.countByDepartmentId(departmentId); int employeeNum = employeeDao.countByDepartmentId(departmentId, Boolean.FALSE);
if (employeeNum > 0) { if (employeeNum > 0) {
return ResponseDTO.userErrorParam("请先删除部门员工"); return ResponseDTO.userErrorParam("请先删除部门员工");
} }

View File

@ -69,7 +69,7 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
* 获取某个部门员工数 * 获取某个部门员工数
* *
*/ */
Integer countByDepartmentId(@Param("departmentId") Long departmentId); Integer countByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 获取一批员工 * 获取一批员工

View File

@ -85,7 +85,7 @@
<select id="countByDepartmentId" resultType="integer"> <select id="countByDepartmentId" resultType="integer">
SELECT count(1) FROM t_employee SELECT count(1) FROM t_employee
WHERE WHERE
department_id = #{departmentId} department_id = #{departmentId} AND deleted_flag = #{deletedFlag}
</select> </select>