!705 update 优化分页写法

* update 优化分页写法
This commit is contained in:
AprilWind
2025-06-27 01:32:55 +00:00
committed by 疯狂的狮子Li
parent bbabffe191
commit 682d8b0099
2 changed files with 11 additions and 18 deletions

View File

@ -78,10 +78,8 @@ public class FlwDefinitionServiceImpl implements IFlwDefinitionService {
LambdaQueryWrapper<FlowDefinition> wrapper = buildQueryWrapper(flowDefinition);
wrapper.eq(FlowDefinition::getIsPublish, PublishStatus.PUBLISHED.getKey());
Page<FlowDefinition> page = flowDefinitionMapper.selectPage(pageQuery.build(), wrapper);
TableDataInfo<FlowDefinitionVo> build = TableDataInfo.build();
build.setRows(BeanUtil.copyToList(page.getRecords(), FlowDefinitionVo.class));
build.setTotal(page.getTotal());
return build;
List<FlowDefinitionVo> list = BeanUtil.copyToList(page.getRecords(), FlowDefinitionVo.class);
return new TableDataInfo<>(list, page.getTotal());
}
/**
@ -96,10 +94,8 @@ public class FlwDefinitionServiceImpl implements IFlwDefinitionService {
LambdaQueryWrapper<FlowDefinition> wrapper = buildQueryWrapper(flowDefinition);
wrapper.in(FlowDefinition::getIsPublish, Arrays.asList(PublishStatus.UNPUBLISHED.getKey(), PublishStatus.EXPIRED.getKey()));
Page<FlowDefinition> page = flowDefinitionMapper.selectPage(pageQuery.build(), wrapper);
TableDataInfo<FlowDefinitionVo> build = TableDataInfo.build();
build.setRows(BeanUtil.copyToList(page.getRecords(), FlowDefinitionVo.class));
build.setTotal(page.getTotal());
return build;
List<FlowDefinitionVo> list = BeanUtil.copyToList(page.getRecords(), FlowDefinitionVo.class);
return new TableDataInfo<>(list, page.getTotal());
}
private LambdaQueryWrapper<FlowDefinition> buildQueryWrapper(FlowDefinition flowDefinition) {