use of com.baomidou.mybatisplus.core.conditions.query.QueryWrapper 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.conditions.query.QueryWrapper 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.conditions.query.QueryWrapper 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.conditions.query.QueryWrapper in project cicd-platform by ken-xue.
the class ProjectInfoRepositoryImpl method page.
@Override
public Page<ProjectInfo> page(ProjectInfoPageQry qry) {
QueryWrapper<ProjectInfoDO> qw = new QueryWrapper<>();
UserDTO user = UserThreadContext.getUser();
UserDO userDO = userMapper.selectOne(new QueryWrapper<UserDO>().eq("user_id", user.getUserId()));
String uuid = userDO.getUuid();
qw.eq("user_uuid", uuid);
ProjectTypeEnum projectType = qry.getProjectType();
IPage<ProjectInfoDO> doPage;
PageDTO pageDTO = new PageDTO(qry.getPageIndex(), qry.getPageSize());
if (projectType == ProjectTypeEnum.JOIN) {
doPage = projectInfoMapper.queryRelatedProject(pageDTO, userDO.getUuid(), qry.getProjectInfoDTO().getUsername(), qry.getProjectInfoDTO().getProjectName());
} else {
if (Objects.nonNull(qry.getProjectInfoDTO()) && StringUtils.isNotBlank(qry.getProjectInfoDTO().getProjectName()))
qw.like("project_name", qry.getProjectInfoDTO().getProjectName());
doPage = projectInfoMapper.selectPage(pageDTO, qw);
doPage.getRecords().forEach(v -> v.setUsername(userDO.getUserName()));
}
return Page.of(doPage.getCurrent(), doPage.getSize(), doPage.getTotal(), projectInfo2DOConvector.toDomainList(doPage.getRecords()));
}
use of com.baomidou.mybatisplus.core.conditions.query.QueryWrapper in project cicd-platform by ken-xue.
the class UserRepositoryImpl method getByUserId.
public User getByUserId(String userId) {
QueryWrapper<UserDO> wrapper = new QueryWrapper<>();
wrapper.eq("user_id", userId);
UserDO userDO = userMapper.selectOne(wrapper);
Assert.notNull(userDO, "There is no User for : " + userId);
User user = DomainFactory.getUser();
BeanUtils.copyProperties(userDO, user);
return user;
}
Aggregations