Search in sources :

Example 16 with IPage

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;
}
Also used : ArrayList(java.util.ArrayList) Page(com.baomidou.mybatisplus.extension.plugins.pagination.Page) IPage(com.baomidou.mybatisplus.core.metadata.IPage) SchTask(com.yh.weatherpush.entity.SchTask) ArrayList(java.util.ArrayList) List(java.util.List) TaskRelTag(com.yh.weatherpush.entity.TaskRelTag) Tag(com.yh.weatherpush.entity.Tag) SchTaskPageDTO(com.yh.weatherpush.dto.schtask.SchTaskPageDTO)

Example 17 with IPage

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()));
}
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 18 with IPage

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()));
}
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 19 with IPage

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()));
}
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 20 with IPage

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()));
}
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)

Aggregations

IPage (com.baomidou.mybatisplus.core.metadata.IPage)197 Page (com.baomidou.mybatisplus.extension.plugins.pagination.Page)152 QueryWrapper (com.baomidou.mybatisplus.core.conditions.query.QueryWrapper)73 ApiOperation (io.swagger.annotations.ApiOperation)28 ArrayList (java.util.ArrayList)21 Test (org.junit.Test)20 PageDTO (com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO)19 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)18 LoginUser (org.jeecg.common.system.vo.LoginUser)16 JSONObject (com.alibaba.fastjson.JSONObject)15 RequiresPermissions (org.apache.shiro.authz.annotation.RequiresPermissions)15 PageInfo (org.apache.dolphinscheduler.api.utils.PageInfo)13 LambdaQueryWrapper (com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper)11 Result (org.jeecg.common.api.vo.Result)10 List (java.util.List)9 User (org.apache.dolphinscheduler.dao.entity.User)9 Field (java.lang.reflect.Field)8 Date (java.util.Date)8 Collectors (java.util.stream.Collectors)7 UserRolesVo (top.hcode.hoj.pojo.vo.UserRolesVo)7