use of com.baomidou.mybatisplus.core.metadata.IPage in project cicd-platform by ken-xue.
the class JenkinsRepositoryImpl method page.
@Override
public Page<Jenkins> page(JenkinsPageQry qry) {
QueryWrapper<JenkinsDO> qw = new QueryWrapper<>();
qw.eq("deleted", false);
if (Objects.nonNull(qry.getJenkinsDTO()) && Objects.nonNull(qry.getJenkinsDTO().getName()))
qw.like("name", qry.getJenkinsDTO().getName());
IPage doPage = jenkinsMapper.selectPage(new PageDTO(qry.getPageIndex(), qry.getPageSize()), qw);
return Page.of(doPage.getCurrent(), doPage.getSize(), doPage.getTotal(), jenkins2DOConvector.toDomainList(doPage.getRecords()));
}
use of com.baomidou.mybatisplus.core.metadata.IPage in project cicd-platform by ken-xue.
the class PipelineExecuteLoggerRepositoryImpl method page.
@Override
public Page<PipelineExecuteLogger> page(PipelineExecuteLoggerPageQry qry) {
QueryWrapper<PipelineExecuteLoggerDO> qw = new QueryWrapper<>();
qw.eq("deleted", false);
if (Objects.nonNull(qry.getPipelineUuid()))
qw.eq("pipeline_uuid", qry.getPipelineUuid());
qw.orderByDesc("gmt_create");
IPage doPage = pipelineExecuteLoggerMapper.selectPage(new PageDTO(qry.getPageIndex(), qry.getPageSize()), qw);
return Page.of(doPage.getCurrent(), doPage.getSize(), doPage.getTotal(), pipelineExecuteLogger2DOConvector.toDomainList(doPage.getRecords()));
}
use of com.baomidou.mybatisplus.core.metadata.IPage in project cicd-platform by ken-xue.
the class PipelineNodeRepositoryImpl method page.
@Override
public Page<PipelineNode> page(PipelineNodePageQry qry) {
QueryWrapper<PipelineNodeDO> qw = new QueryWrapper<>();
IPage doPage = pipelineNodeMapper.selectPage(new PageDTO(qry.getPageIndex(), qry.getPageSize()), qw);
return Page.of(doPage.getCurrent(), doPage.getSize(), doPage.getTotal(), pipelineNode2DOConvector.toDomainList(doPage.getRecords()));
}
use of com.baomidou.mybatisplus.core.metadata.IPage in project springboot-learning by lyb-geek.
the class BookServiceImpl method pageBook.
@Override
public PageResult<BookDTO> pageBook(PageQuery<BookDTO> pageQuery) {
BookDTO bookDTO = pageQuery.getQueryParams();
Wrapper<Book> wrapper = wrapperQueryCondition(bookDTO);
IPage<Book> page = new Page<>(pageQuery.getPageNo(), pageQuery.getPageSize());
IPage<Book> bookIPage = baseMapper.selectPage(page, wrapper);
if (bookIPage != null) {
List<BookDTO> bookDTOS = new ArrayList<>();
if (CollectionUtils.isNotEmpty(bookIPage.getRecords())) {
bookDTOS = BeanMapperUtils.mapList(bookIPage.getRecords(), BookDTO.class);
}
return PageUtil.INSTANCE.getPage(bookIPage, bookDTOS);
}
return null;
}
use of com.baomidou.mybatisplus.core.metadata.IPage in project springboot-learning by lyb-geek.
the class BookServiceImpl method pageBook.
@Override
@RedisCache(type = CacheOperateType.QUERY, cacheKeyPrefix = "pageBook", expireTime = 180)
public PageResult<BookDTO> pageBook(PageQuery<BookDTO> pageQuery) {
log.info("pageBookčµ°db");
BookDTO bookDTO = pageQuery.getQueryParams();
Wrapper<Book> wrapper = wrapperQueryCondition(bookDTO);
IPage<Book> page = new Page<>(pageQuery.getPageNo(), pageQuery.getPageSize());
IPage<Book> bookIPage = baseMapper.selectPage(page, wrapper);
if (bookIPage != null) {
List<BookDTO> bookDTOS = new ArrayList<>();
if (CollectionUtils.isNotEmpty(bookIPage.getRecords())) {
bookDTOS = BeanMapperUtils.mapList(bookIPage.getRecords(), BookDTO.class);
}
return PageUtil.INSTANCE.getPage(bookIPage, bookDTOS);
}
return null;
}
Aggregations