Search in sources :

Example 36 with IPage

use of com.baomidou.mybatisplus.core.metadata.IPage in project jun_springboot_api_service by wujun728.

the class SysDictDetailController method findListByPage.

@ApiOperation(value = "查询列表数据")
@PostMapping("/listByPage")
@RequiresPermissions("sysDict:list")
public DataResult findListByPage(@RequestBody SysDictDetailEntity sysDictDetail) {
    Page page = new Page(sysDictDetail.getPage(), sysDictDetail.getLimit());
    if (StringUtils.isEmpty(sysDictDetail.getDictId())) {
        return DataResult.success();
    }
    IPage<SysDictDetailEntity> iPage = sysDictDetailService.listByPage(page, sysDictDetail.getDictId());
    return DataResult.success(iPage);
}
Also used : SysDictDetailEntity(com.jun.plugin.system.entity.SysDictDetailEntity) Page(com.baomidou.mybatisplus.extension.plugins.pagination.Page) IPage(com.baomidou.mybatisplus.core.metadata.IPage) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) ApiOperation(io.swagger.annotations.ApiOperation)

Example 37 with IPage

use of com.baomidou.mybatisplus.core.metadata.IPage in project jun_springboot_api_service by wujun728.

the class SysFilesController method findListByPage.

@ApiOperation(value = "查询分页数据")
@PostMapping("/listByPage")
@RequiresPermissions("sysFiles:list")
public DataResult findListByPage(@RequestBody SysFilesEntity sysFiles) {
    Page page = new Page(sysFiles.getPage(), sysFiles.getLimit());
    IPage<SysFilesEntity> iPage = sysFilesService.page(page, Wrappers.<SysFilesEntity>lambdaQuery().orderByDesc(SysFilesEntity::getCreateDate));
    return DataResult.success(iPage);
}
Also used : Page(com.baomidou.mybatisplus.extension.plugins.pagination.Page) IPage(com.baomidou.mybatisplus.core.metadata.IPage) SysFilesEntity(com.jun.plugin.system.entity.SysFilesEntity) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) ApiOperation(io.swagger.annotations.ApiOperation)

Example 38 with IPage

use of com.baomidou.mybatisplus.core.metadata.IPage in project jun_springboot_api_service by wujun728.

the class BizTestController method findListByPage.

@ApiOperation(value = "查询分页数据")
@PostMapping("bizTest/listByPage")
@RequiresPermissions("bizTest:list")
@ResponseBody
public DataResult findListByPage(@RequestBody BizTestEntity bizTest) {
    Page page = new Page(bizTest.getPage(), bizTest.getLimit());
    LambdaQueryWrapper<BizTestEntity> queryWrapper = Wrappers.lambdaQuery();
    // 查询条件示例
    // queryWrapper.eq(BizTestEntity::getId, bizTest.getId());
    IPage<BizTestEntity> iPage = bizTestService.page(page, queryWrapper);
    return DataResult.success(iPage);
}
Also used : Page(com.baomidou.mybatisplus.extension.plugins.pagination.Page) IPage(com.baomidou.mybatisplus.core.metadata.IPage) BizTestEntity(com.jun.plugin.bizservice.entity.BizTestEntity) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) ApiOperation(io.swagger.annotations.ApiOperation)

Example 39 with IPage

use of com.baomidou.mybatisplus.core.metadata.IPage in project springboot by lbshold.

the class ApplicationTests method contextLoads.

@Test
public void contextLoads() {
    // System.out.println(("----- selectAll method test ------"));
    // List<User> userList = userMapper.selectList(null);
    // Assert.assertEquals(5, userList.size());
    // userList.forEach(System.out::println);
    IPage<User> userIPage = userMapper.selectPageVo(new Page(1, 5), "J");
    userIPage.getRecords().forEach(System.out::println);
}
Also used : User(top.lconcise.domain.User) Page(com.baomidou.mybatisplus.extension.plugins.pagination.Page) IPage(com.baomidou.mybatisplus.core.metadata.IPage) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test)

Example 40 with IPage

use of com.baomidou.mybatisplus.core.metadata.IPage in project ballcat by ballcat-projects.

the class PageUtil method prodPage.

/**
 * 根据 PageParam 生成一个 IPage 实例
 * @param pageParam 分页参数
 * @param <V> 返回的 Record 对象
 * @return IPage<V>
 */
public static <V> IPage<V> prodPage(PageParam pageParam) {
    Page<V> page = new Page<>(pageParam.getCurrent(), pageParam.getSize());
    List<PageParam.Sort> sorts = pageParam.getSorts();
    for (PageParam.Sort sort : sorts) {
        OrderItem orderItem = sort.isAsc() ? OrderItem.asc(sort.getField()) : OrderItem.desc(sort.getField());
        page.addOrder(orderItem);
    }
    return page;
}
Also used : OrderItem(com.baomidou.mybatisplus.core.metadata.OrderItem) Page(com.baomidou.mybatisplus.extension.plugins.pagination.Page) IPage(com.baomidou.mybatisplus.core.metadata.IPage) PageParam(com.hccake.ballcat.common.model.domain.PageParam)

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