Search in sources :

Example 31 with PageInfo

use of com.github.pagehelper.PageInfo in project paascloud-master by paascloud.

the class OmcOrderController method queryUserOrderListWithPage.

/**
 * Query user order list with page wrapper.
 *
 * @param baseQuery the base query
 *
 * @return the wrapper
 */
@PostMapping("queryUserOrderListWithPage")
@ApiOperation(httpMethod = "POST", value = "查询用户订单列表")
public Wrapper queryUserOrderListWithPage(@RequestBody BaseQuery baseQuery) {
    logger.info("queryUserOrderListWithPage - 查询用户订单集合. baseQuery={}", baseQuery);
    Long userId = getLoginAuthDto().getUserId();
    logger.info("操作人信息. userId={}", userId);
    PageInfo pageInfo = omcOrderService.queryUserOrderListWithPage(userId, baseQuery);
    return WrapMapper.ok(pageInfo);
}
Also used : PageInfo(com.github.pagehelper.PageInfo) ApiOperation(io.swagger.annotations.ApiOperation)

Example 32 with PageInfo

use of com.github.pagehelper.PageInfo in project paascloud-master by paascloud.

the class TpcMqConsumerController method querySubscribeListWithPage.

/**
 * 查询订阅者列表.
 *
 * @param tpcMqConsumer the tpc mq consumer
 *
 * @return the wrapper
 */
@PostMapping(value = "/querySubscribeListWithPage")
@ApiOperation(httpMethod = "POST", value = "查询订阅者列表")
public Wrapper<PageInfo<TpcMqSubscribeVo>> querySubscribeListWithPage(@ApiParam(name = "consumer", value = "Mq消费者") @RequestBody TpcMqConsumer tpcMqConsumer) {
    logger.info("查询Mq订阅列表tpcMqConsumerQuery={}", tpcMqConsumer);
    PageHelper.startPage(tpcMqConsumer.getPageNum(), tpcMqConsumer.getPageSize());
    tpcMqConsumer.setOrderBy("update_time desc");
    List<TpcMqSubscribeVo> list = tpcMqConsumerService.listSubscribeVoWithPage(tpcMqConsumer);
    PageInfo<TpcMqSubscribeVo> pageInfo = new PageInfo<>(list);
    if (PublicUtil.isNotEmpty(list)) {
        Map<Long, TpcMqSubscribeVo> tpcMqSubscribeVoMap = this.trans2Map(list);
        List<Long> subscribeIdList = new ArrayList<>(tpcMqSubscribeVoMap.keySet());
        List<TpcMqSubscribeVo> tagVoList = tpcMqConsumerService.listSubscribeVo(subscribeIdList);
        for (TpcMqSubscribeVo vo : tagVoList) {
            Long subscribeId = vo.getId();
            if (!tpcMqSubscribeVoMap.containsKey(subscribeId)) {
                continue;
            }
            TpcMqSubscribeVo tpcMqSubscribeVo = tpcMqSubscribeVoMap.get(subscribeId);
            tpcMqSubscribeVo.setTagVoList(vo.getTagVoList());
        }
        pageInfo.setList(new ArrayList<>(tpcMqSubscribeVoMap.values()));
    }
    return WrapMapper.ok(pageInfo);
}
Also used : TpcMqSubscribeVo(com.paascloud.provider.model.vo.TpcMqSubscribeVo) PageInfo(com.github.pagehelper.PageInfo) ArrayList(java.util.ArrayList) ApiOperation(io.swagger.annotations.ApiOperation)

Example 33 with PageInfo

use of com.github.pagehelper.PageInfo in project paascloud-master by paascloud.

the class UacActionServiceImpl method queryActionListWithPage.

@Override
@Transactional(readOnly = true, rollbackFor = Exception.class)
public PageInfo queryActionListWithPage(ActionMainQueryDto actionMainQueryDto) {
    List<Long> menuIdList = actionMainQueryDto.getMenuIdList();
    Long menuId = null;
    if (PublicUtil.isNotEmpty(menuIdList)) {
        menuId = menuIdList.get(menuIdList.size() - 1);
    }
    UacAction uacAction = new UacAction();
    uacAction.setMenuId(menuId);
    BeanUtils.copyProperties(actionMainQueryDto, uacAction);
    uacAction.setOrderBy("update_time desc");
    PageHelper.startPage(actionMainQueryDto.getPageNum(), actionMainQueryDto.getPageSize());
    List<ActionVo> actionList = uacActionMapper.queryActionListWithPage(uacAction);
    return new PageInfo<>(actionList);
}
Also used : PageInfo(com.github.pagehelper.PageInfo) UacAction(com.paascloud.provider.model.domain.UacAction) ActionVo(com.paascloud.provider.model.vo.ActionVo) Transactional(org.springframework.transaction.annotation.Transactional)

Example 34 with PageInfo

use of com.github.pagehelper.PageInfo in project production_ssm by megagao.

the class TechnologyServiceImpl method searchTechnologyByTechnologyName.

@Override
public EUDataGridResult searchTechnologyByTechnologyName(Integer page, Integer rows, String technologyName) throws Exception {
    // 分页处理
    PageHelper.startPage(page, rows);
    List<Technology> list = technologyMapper.searchTechnologyByTechnologyName(technologyName);
    // 创建一个返回值对象
    EUDataGridResult result = new EUDataGridResult();
    result.setRows(list);
    // 取记录总条数
    PageInfo<Technology> pageInfo = new PageInfo<>(list);
    result.setTotal(pageInfo.getTotal());
    return result;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) Technology(com.megagao.production.ssm.domain.Technology) EUDataGridResult(com.megagao.production.ssm.domain.customize.EUDataGridResult)

Example 35 with PageInfo

use of com.github.pagehelper.PageInfo in project production_ssm by megagao.

the class TechnologyServiceImpl method getList.

@Override
public EUDataGridResult getList(int page, int rows, Technology technology) throws Exception {
    // 查询工艺列表
    TechnologyExample example = new TechnologyExample();
    // 分页处理
    PageHelper.startPage(page, rows);
    List<Technology> list = technologyMapper.selectByExample(example);
    // 创建一个返回值对象
    EUDataGridResult result = new EUDataGridResult();
    result.setRows(list);
    // 取记录总条数
    PageInfo<Technology> pageInfo = new PageInfo<>(list);
    result.setTotal(pageInfo.getTotal());
    return result;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) Technology(com.megagao.production.ssm.domain.Technology) TechnologyExample(com.megagao.production.ssm.domain.TechnologyExample) EUDataGridResult(com.megagao.production.ssm.domain.customize.EUDataGridResult)

Aggregations

PageInfo (com.github.pagehelper.PageInfo)273 PostMapping (org.springframework.web.bind.annotation.PostMapping)96 EUDataGridResult (com.megagao.production.ssm.domain.customize.EUDataGridResult)90 Test (org.junit.Test)21 UserMapper (com.github.pagehelper.mapper.UserMapper)17 User (com.github.pagehelper.model.User)17 SqlSession (org.apache.ibatis.session.SqlSession)17 ApiOperation (io.swagger.annotations.ApiOperation)14 TaskRecordDetail (com.eservice.api.model.task_record.TaskRecordDetail)11 Condition (tk.mybatis.mapper.entity.Condition)9 DataTablesResult (cn.exrick.common.pojo.DataTablesResult)7 ArrayList (java.util.ArrayList)7 Criteria (tk.mybatis.mapper.entity.Example.Criteria)6 TaskRecord (com.eservice.api.model.task_record.TaskRecord)4 Product (com.megagao.production.ssm.domain.Product)4 Task (com.megagao.production.ssm.domain.Task)4 ManufactureVO (com.megagao.production.ssm.domain.vo.ManufactureVO)4 WorkVO (com.megagao.production.ssm.domain.vo.WorkVO)4 MachineInfo (com.eservice.api.model.machine.MachineInfo)3 User (com.eservice.api.model.user.User)3