update 使用常量替代硬编码的删除标志,优化查询条件

This commit is contained in:
AprilWind
2026-03-30 09:34:22 +08:00
parent ee2ee27cf1
commit a1f8df90cf
5 changed files with 87 additions and 105 deletions

View File

@@ -19,6 +19,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static org.dromara.common.core.constant.SystemConstants.NORMAL;
/**
* 部门管理 数据层
*
@@ -105,7 +107,7 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDept, SysDeptVo> {
.leftJoin(SysRoleDept.class, "srd", SysRoleDept::getDeptId, SysDept::getDeptId)
.leftJoin(SysRole.class, "sr", SysRole::getRoleId, SysRoleDept::getRoleId)
.eq("srd", SysRoleDept::getRoleId, roleId)
.eq("sr", SysRole::getStatus, "0")
.eq("sr", SysRole::getStatus, NORMAL)
.orderByAsc("d", SysDept::getParentId)
.orderByAsc("d", SysDept::getOrderNum));
Set<Long> parentIds = deptCheckStrictly ? new HashSet<>(StreamUtils.toList(depts, SysDept::getParentId)) : Collections.emptySet();