@AutoLog(value = "tenant_info-分页列表查询")
@ApiOperation(value = "tenant_info-分页列表查询", notes = "tenant_info-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<TenantInfo>> queryPageList(TenantInfo tenantInfo,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<TenantInfo> queryWrapper = QueryGenerator.initQueryWrapper(tenantInfo, req.getParameterMap());
Page<TenantInfo> page = new Page<TenantInfo>(pageNo, pageSize);
IPage<TenantInfo> pageList = tenantInfoService.page(page, queryWrapper);
pageList.getRecords().forEach(item -> {
if (item.getMonitorPonitIds() != null && item.getMonitorPonitIds().length() > 0) {
List<String> monitorIds = Arrays.asList(item.getMonitorPonitIds().split("\\|"));
List<String> monitorPoint = monitorPointService
.listByIds(monitorIds)
.stream()
.map(MonitorPoint::getMonitorPointName)
.collect(Collectors.toList());
item.setMonitorPointNames(monitorPoint);
}
});
return Result.OK(pageList);
}
租户管理 -- 隐患点显示id更改为显示隐患点名称,根据隐患点id列表查询相应的隐患点名称
最新推荐文章于 2023-08-16 20:30:15 发布
这篇博客展示了如何在SpringBoot应用中实现分页查询,利用QueryGenerator和Service进行条件过滤。同时,详细解释了如何将查询结果中的监控点ID转换为监控点名称,通过集合操作进行数据增强,提高了数据的可读性。
摘要由CSDN通过智能技术生成