| | |
| | | import com.sinata.appointment.mapper.MpUserMapper; |
| | | import com.sinata.appointment.mapper.SysDeptMapper; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | new LambdaQueryWrapper<MpPassAccessArea>() |
| | | .eq(MpPassAccessArea::getDelFlag, 0) |
| | | .orderByAsc(MpPassAccessArea::getPid) |
| | | .orderByAsc(MpPassAccessArea::getAreaName) |
| | | .orderByAsc(MpPassAccessArea::getId)); |
| | | if (rows.isEmpty()) { |
| | | return List.of(); |
| | |
| | | } |
| | | parent.getChildren().add(current); |
| | | } |
| | | sortAreaTree(roots); |
| | | return roots; |
| | | } |
| | | |
| | | private void sortAreaTree(List<MiniPassAccessAreaTreeVo> nodes) { |
| | | nodes.sort( |
| | | Comparator.comparing( |
| | | MiniPassAccessAreaTreeVo::getAreaName, |
| | | Comparator.nullsLast(String::compareTo)) |
| | | .thenComparing(MiniPassAccessAreaTreeVo::getId)); |
| | | for (MiniPassAccessAreaTreeVo node : nodes) { |
| | | sortAreaTree(node.getChildren()); |
| | | } |
| | | } |
| | | |
| | | public List<MiniVisitedUserVo> searchVisitedUsersByExactName(String realName) { |
| | | String name = realName == null ? "" : realName.trim(); |
| | | if (name.isEmpty()) { |