feat(system): 优化部门查询功能

- 修改 DeptMapper 接口,将 selectCompany 方法的 type 参数
This commit is contained in:
furongxin 2025-03-14 15:43:45 +08:00
parent 6b2b14c96f
commit 0f035799fd
3 changed files with 6 additions and 3 deletions

View File

@ -63,5 +63,5 @@ public interface DeptMapper extends BaseMapperX<DeptDO> {
}
List<DeptDO> selectCompany(@Param("flag") String flag,
@Param("type") String type);
@Param("type") List<String> type);
}

View File

@ -373,7 +373,7 @@ public class DeptServiceImpl implements DeptService {
}
// 根据所在部门信息获取 所在公司信息
List<DeptDO> companyDeptList = deptMapper.selectCompany(deptDo.getFlag(), DeptTypeEnum.COMPANY.getValue());
List<DeptDO> companyDeptList = deptMapper.selectCompany(deptDo.getFlag(), Arrays.asList(DeptTypeEnum.HEAD_COMPANY.getValue(), DeptTypeEnum.COMPANY.getValue()));
if (CollectionUtil.isEmpty(companyDeptList)) {
return new DeptDO();

View File

@ -16,7 +16,10 @@
system_dept
WHERE
#{flag} LIKE CONCAT('%', flag, '%')
AND type = #{type}
AND type IN
<foreach collection="type" item="item" open="(" separator="," close=")">
#{item}
</foreach>
AND deleted = 0
</select>
</mapper>