use of vip.mate.system.vo.SysDepartVO in project matecloud by matevip.
the class SysDepartServiceImpl method searchList.
@Override
public List<SysDepartVO> searchList(Map<String, Object> search) {
String keyword = String.valueOf(search.get("keyword"));
String startDate = String.valueOf(search.get("startDate"));
String endDate = String.valueOf(search.get("endDate"));
LambdaQueryWrapper<SysDepart> lambdaQueryWrapper = new LambdaQueryWrapper<>();
if (StrUtil.isNotBlank(startDate) && !startDate.equals(NULL)) {
lambdaQueryWrapper.between(SysDepart::getCreateTime, startDate, endDate);
}
if (StrUtil.isNotBlank(keyword) && !keyword.equals(NULL)) {
lambdaQueryWrapper.and(i -> i.or().like(SysDepart::getName, keyword).or().like(SysDepart::getId, keyword));
}
List<SysDepart> sysDeparts = this.baseMapper.selectList(lambdaQueryWrapper);
List<SysDepartVO> sysDepartVOS = sysDeparts.stream().map(sysDepart -> {
SysDepartVO sysDepartVO = new SysDepartVO();
BeanUtils.copyProperties(sysDepart, sysDepartVO);
return sysDepartVO;
}).collect(Collectors.toList());
return ForestNodeMerger.merge(sysDepartVOS);
}
Aggregations