Search in sources :

Example 1 with Page

use of io.nerv.core.mvc.util.Page in project EVA-API by PKAQ-LAB.

the class RoleService method listRole.

/**
 * 查询角色列表
 * @param roleEntity
 * @return
 */
public IPage<RoleEntity> listRole(RoleEntity roleEntity, Integer page, Integer pageSize) {
    page = null != page ? page : 1;
    pageSize = null != pageSize ? pageSize : 10;
    // 查询条件
    QueryWrapper<RoleEntity> wrapper = new QueryWrapper<>(roleEntity);
    // 分页条件
    Page pagination = new Page();
    pagination.setCurrent(page);
    pagination.setSize(pageSize);
    return this.mapper.selectPage(pagination, wrapper);
}
Also used : RoleEntity(io.nerv.web.sys.role.entity.RoleEntity) QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) Page(io.nerv.core.mvc.util.Page) IPage(com.baomidou.mybatisplus.core.metadata.IPage)

Example 2 with Page

use of io.nerv.core.mvc.util.Page in project EVA-API by PKAQ-LAB.

the class UserService method listUser.

/**
 * 查询用户列表
 * @param userEntity
 * @return
 */
public IPage<UserEntity> listUser(UserEntity userEntity, Integer page, Integer size) {
    page = null != page ? page : 1;
    size = null != size ? size : 10;
    Page pagination = new Page();
    pagination.setCurrent(page);
    pagination.setSize(size);
    return this.mapper.getUerWithRoleId(pagination, userEntity);
}
Also used : Page(io.nerv.core.mvc.util.Page) IPage(com.baomidou.mybatisplus.core.metadata.IPage)

Example 3 with Page

use of io.nerv.core.mvc.util.Page in project EVA-API by PKAQ-LAB.

the class StdBaseService method listPage.

/**
 * 通用分页查询
 * @param entity    目标实体类
 * @param page      当前页码
 * @return          分页模型类
 */
public IPage<T> listPage(T entity, Integer page) {
    page = null != page ? page : 1;
    // 查询条件
    QueryWrapper<T> wrapper = new QueryWrapper<>(entity);
    wrapper.orderByDesc("gmt_Modify");
    // 分页条件
    Page pagination = new Page();
    pagination.setCurrent(page);
    return this.mapper.selectPage(pagination, wrapper);
}
Also used : QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) Page(io.nerv.core.mvc.util.Page) IPage(com.baomidou.mybatisplus.core.metadata.IPage)

Example 4 with Page

use of io.nerv.core.mvc.util.Page in project EVA-API by PKAQ-LAB.

the class BizLogCtrl method list.

@GetMapping("/list")
@ApiOperation(value = "获取日志列表", response = Response.class)
public Response list(@ApiParam(name = "dateRange", value = "查询区间") DateRangeVo dateRange, @ApiParam(name = "pageNo", value = "页码") Integer pageNo, @ApiParam(name = "pageCount", value = "条数") Integer size) {
    QueryWrapper<MybatisBizLogEntity> wrapper = new QueryWrapper<>();
    LocalDate begin = dateRange.getBegin();
    LocalDate end = dateRange.getEnd();
    if (null == begin) {
        begin = LocalDate.now().minusDays(7);
    }
    if (null == end) {
        end = LocalDate.now();
    }
    wrapper.ge("OPERATE_DATETIME", begin);
    wrapper.le("OPERATE_DATETIME", end);
    Page pagination = new Page();
    pagination.setCurrent(pageNo == null ? 1 : pageNo);
    pagination.setSize(size == null ? 10 : size);
    return new Response().success(this.mybatisSupporterMapper.selectPage(pagination, wrapper));
}
Also used : Response(io.nerv.core.mvc.util.Response) QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) MybatisBizLogEntity(io.nerv.core.bizlog.supporter.mybatis.entity.MybatisBizLogEntity) Page(io.nerv.core.mvc.util.Page) LocalDate(java.time.LocalDate) GetMapping(org.springframework.web.bind.annotation.GetMapping) ApiOperation(io.swagger.annotations.ApiOperation)

Example 5 with Page

use of io.nerv.core.mvc.util.Page in project EVA-API by PKAQ-LAB.

the class ErrorCtrl method list.

@GetMapping("/list")
@ApiOperation(value = "获取错误日志列表", response = Response.class)
public Response list(@ApiParam(name = "dateRange", value = "查询区间") DateRangeVo dateRange, @ApiParam(name = "pageNo", value = "页码") Integer pageNo, @ApiParam(name = "pageCount", value = "条数") Integer pageCount) {
    QueryWrapper<ErrorlogEntity> wrapper = new QueryWrapper<>();
    LocalDate begin = dateRange.getBegin();
    LocalDate end = LocalDate.now();
    if (null == begin) {
        begin = LocalDate.now().minusDays(7);
    }
    if (null == end) {
        end = LocalDate.now();
    }
    wrapper.ge("REQUEST_TIME", begin);
    wrapper.le("REQUEST_TIME", end);
    Page pagination = new Page();
    pagination.setCurrent(pageNo == null ? 1 : pageNo);
    pagination.setSize(pageCount == null ? 10 : pageCount);
    return new Response().success(this.errorlogMapper.selectPage(pagination, wrapper));
}
Also used : ErrorlogEntity(io.nerv.core.exception.entity.ErrorlogEntity) Response(io.nerv.core.mvc.util.Response) QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) Page(io.nerv.core.mvc.util.Page) LocalDate(java.time.LocalDate) GetMapping(org.springframework.web.bind.annotation.GetMapping) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

Page (io.nerv.core.mvc.util.Page)5 QueryWrapper (com.baomidou.mybatisplus.core.conditions.query.QueryWrapper)4 IPage (com.baomidou.mybatisplus.core.metadata.IPage)3 Response (io.nerv.core.mvc.util.Response)2 ApiOperation (io.swagger.annotations.ApiOperation)2 LocalDate (java.time.LocalDate)2 GetMapping (org.springframework.web.bind.annotation.GetMapping)2 MybatisBizLogEntity (io.nerv.core.bizlog.supporter.mybatis.entity.MybatisBizLogEntity)1 ErrorlogEntity (io.nerv.core.exception.entity.ErrorlogEntity)1 RoleEntity (io.nerv.web.sys.role.entity.RoleEntity)1