Search in sources :

Example 56 with QueryWrapper

use of com.baomidou.mybatisplus.core.conditions.query.QueryWrapper 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()));
}
Also used : IPage(com.baomidou.mybatisplus.core.metadata.IPage) PageDTO(com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO) QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) LogDO(io.kenxue.cicd.infrastructure.repositoryimpl.sys.database.dataobject.LogDO)

Example 57 with QueryWrapper

use of com.baomidou.mybatisplus.core.conditions.query.QueryWrapper 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()));
}
Also used : IPage(com.baomidou.mybatisplus.core.metadata.IPage) PageDTO(com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO) QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) UserOfRoleDO(io.kenxue.cicd.infrastructure.repositoryimpl.sys.database.dataobject.UserOfRoleDO)

Example 58 with QueryWrapper

use of com.baomidou.mybatisplus.core.conditions.query.QueryWrapper 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()));
}
Also used : IPage(com.baomidou.mybatisplus.core.metadata.IPage) PageDTO(com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO) QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) ProjectOfUserDO(io.kenxue.cicd.infrastructure.repositoryimpl.project.database.dataobject.ProjectOfUserDO)

Example 59 with QueryWrapper

use of com.baomidou.mybatisplus.core.conditions.query.QueryWrapper 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()));
}
Also used : IPage(com.baomidou.mybatisplus.core.metadata.IPage) PageDTO(com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO) QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) ApplicationInfoDO(io.kenxue.cicd.infrastructure.repositoryimpl.application.database.dataobject.ApplicationInfoDO) ApplicationInfoDTO(io.kenxue.cicd.coreclient.dto.application.applicationinfo.ApplicationInfoDTO)

Example 60 with QueryWrapper

use of com.baomidou.mybatisplus.core.conditions.query.QueryWrapper in project cicd-platform by ken-xue.

the class MachineInfoRepositoryImpl method getById.

@Override
public MachineInfo getById(Long id) {
    MachineInfoDO machineInfoDO = machineInfoMapper.selectById(id);
    machineInfoDO.setGroupList(new ArrayList<>(machineOfGroupMapper.selectList(new QueryWrapper<MachineOfGroupDO>().eq("machine_uuid", machineInfoDO.getUuid())).stream().map(v -> v.getGroupUuid()).collect(Collectors.toSet())));
    return machineInfo2DOConvector.toDomain(machineInfoDO);
}
Also used : Page(io.kenxue.cicd.coreclient.dto.common.page.Page) QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) MachineInfoRepository(io.kenxue.cicd.domain.repository.machine.MachineInfoRepository) MachineInfoDO(io.kenxue.cicd.infrastructure.repositoryimpl.application.database.dataobject.MachineInfoDO) MachineInfo2DOConvector(io.kenxue.cicd.infrastructure.repositoryimpl.application.database.convertor.MachineInfo2DOConvector) MachineInfoMapper(io.kenxue.cicd.infrastructure.repositoryimpl.application.database.mapper.MachineInfoMapper) Resource(javax.annotation.Resource) MachineOfGroupMapper(io.kenxue.cicd.infrastructure.repositoryimpl.machine.database.mapper.MachineOfGroupMapper) Set(java.util.Set) MachineInfoListQry(io.kenxue.cicd.coreclient.dto.machine.MachineInfoListQry) MachineOfGroupDO(io.kenxue.cicd.infrastructure.repositoryimpl.machine.database.dataobject.MachineOfGroupDO) Collectors(java.util.stream.Collectors) PageDTO(com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO) ArrayList(java.util.ArrayList) MachineOfGroup2DOConvector(io.kenxue.cicd.infrastructure.repositoryimpl.machine.database.convertor.MachineOfGroup2DOConvector) MachineInfoPageQry(io.kenxue.cicd.coreclient.dto.machine.MachineInfoPageQry) Slf4j(lombok.extern.slf4j.Slf4j) Component(org.springframework.stereotype.Component) List(java.util.List) Optional(java.util.Optional) MachineInfo(io.kenxue.cicd.domain.domain.machine.MachineInfo) MachineOfGroupDO(io.kenxue.cicd.infrastructure.repositoryimpl.machine.database.dataobject.MachineOfGroupDO) MachineInfoDO(io.kenxue.cicd.infrastructure.repositoryimpl.application.database.dataobject.MachineInfoDO)

Aggregations

QueryWrapper (com.baomidou.mybatisplus.core.conditions.query.QueryWrapper)723 Transactional (org.springframework.transaction.annotation.Transactional)98 IPage (com.baomidou.mybatisplus.core.metadata.IPage)82 UserRolesVo (top.hcode.hoj.pojo.vo.UserRolesVo)74 LambdaQueryWrapper (com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper)72 Page (com.baomidou.mybatisplus.extension.plugins.pagination.Page)65 ArrayList (java.util.ArrayList)61 Session (org.apache.shiro.session.Session)61 StatusFailException (top.hcode.hoj.common.exception.StatusFailException)60 StatusForbiddenException (top.hcode.hoj.common.exception.StatusForbiddenException)55 Problem (top.hcode.hoj.pojo.entity.problem.Problem)50 UpdateWrapper (com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper)45 Date (java.util.Date)44 HttpServletRequest (javax.servlet.http.HttpServletRequest)35 HashMap (java.util.HashMap)34 RequiresAuthentication (org.apache.shiro.authz.annotation.RequiresAuthentication)34 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)34 ApiOperation (io.swagger.annotations.ApiOperation)32 HttpSession (javax.servlet.http.HttpSession)31 Judge (top.hcode.hoj.pojo.entity.judge.Judge)30