use of com.baomidou.mybatisplus.core.metadata.IPage in project weather-push by yangh124.
the class SchTaskServiceImpl method pageList.
@Override
public IPage<SchTaskPageDTO> pageList(PageParam pageParam) {
IPage<SchTask> page = new Page<>(pageParam.getCurrentPage(), pageParam.getPageSize());
page = super.page(page);
IPage<SchTaskPageDTO> res = new Page<>();
BeanUtil.copyProperties(page, res);
List<SchTask> records = page.getRecords();
List<SchTaskPageDTO> resRecords = new ArrayList<>(records.size());
if (CollUtil.isNotEmpty(records)) {
List<Long> taskIds = records.stream().map(SchTask::getId).collect(Collectors.toList());
Map<Long, List<Tag>> map = getTaskTagMap(taskIds);
for (SchTask record : records) {
SchTaskPageDTO dto = new SchTaskPageDTO();
BeanUtil.copyProperties(record, dto);
Long taskId = record.getId();
List<Tag> tagList = map.get(taskId);
dto.setTagList(tagList);
String taskName = record.getTaskName();
String desc = TaskEnum.getDescByName(taskName);
dto.setTaskName(desc);
resRecords.add(dto);
}
}
res.setRecords(resRecords);
return res;
}
use of com.baomidou.mybatisplus.core.metadata.IPage in project cicd-platform by ken-xue.
the class LogRepositoryImpl method page.
@Override
public Page<Log> page(LogPageQry qry) {
QueryWrapper<LogDO> qw = new QueryWrapper<>();
IPage doPage = logMapper.selectPage(new PageDTO(qry.getPageIndex(), qry.getPageSize()), qw);
return Page.of(doPage.getCurrent(), doPage.getSize(), doPage.getTotal(), log2DOConvector.toDomainList(doPage.getRecords()));
}
use of com.baomidou.mybatisplus.core.metadata.IPage in project cicd-platform by ken-xue.
the class UserOfRoleRepositoryImpl method page.
@Override
public Page<UserOfRole> page(UserOfRolePageQry qry) {
QueryWrapper<UserOfRoleDO> wp = new QueryWrapper<>();
// 未删除
wp.eq("deleted", 0);
IPage doPage = new PageDTO(qry.getPageIndex(), qry.getPageSize());
IPage<UserOfRoleDO> page = userOfRoleMapper.selectPage(doPage, wp);
return Page.of(page.getCurrent(), page.getSize(), page.getTotal(), userOfRole2DOConvector.toDomainList(page.getRecords()));
}
use of com.baomidou.mybatisplus.core.metadata.IPage in project cicd-platform by ken-xue.
the class ProjectOfUserRepositoryImpl method page.
@Override
public Page<ProjectOfUser> page(ProjectOfUserPageQry qry) {
QueryWrapper<ProjectOfUserDO> qw = new QueryWrapper<>();
IPage doPage = projectOfUserMapper.selectPage(new PageDTO(qry.getPageIndex(), qry.getPageSize()), qw);
return Page.of(doPage.getCurrent(), doPage.getSize(), doPage.getTotal(), projectOfUser2DOConvector.toDomainList(doPage.getRecords()));
}
use of com.baomidou.mybatisplus.core.metadata.IPage in project cicd-platform by ken-xue.
the class ApplicationInfoRepositoryImpl method page.
@Override
public Page<ApplicationInfo> page(ApplicationInfoPageQry qry) {
QueryWrapper<ApplicationInfoDO> qw = new QueryWrapper<>();
ApplicationInfoDTO qryDTO = qry.getApplicationInfoDTO();
if (Objects.nonNull(qryDTO) && StringUtils.isNotBlank(qryDTO.getApplicationName()))
qw.like("application_name", qryDTO.getApplicationName());
if (Objects.nonNull(qryDTO) && StringUtils.isNotBlank(qryDTO.getProjectUuid()))
qw.eq("project_uuid", qryDTO.getProjectUuid());
IPage doPage = applicationInfoMapper.selectPage(new PageDTO(qry.getPageIndex(), qry.getPageSize()), qw);
return Page.of(doPage.getCurrent(), doPage.getSize(), doPage.getTotal(), applicationInfo2DOConvector.toDomainList(doPage.getRecords()));
}
Aggregations