Java Code Examples for com.baomidou.mybatisplus.core.metadata.IPage#setTotal()

The following examples show how to use com.baomidou.mybatisplus.core.metadata.IPage#setTotal() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProcessEngineService.java    From open-cloud with MIT License 5 votes vote down vote up
/**
 * 获取代办列表
 *
 * @param userId
 * @return
 */
public IPage<Task> findTodoTask(String userId, int firstResult, int maxResults) {
    //得到用户待办
    TaskQuery query = taskService.createTaskQuery();
    query.includeTaskLocalVariables();
    if (StringUtils.isNotBlank(userId)) {
        query.taskAssignee(userId);
    }
    List<Task> list = query.listPage(firstResult, maxResults);
    IPage page = new Page();
    page.setRecords(list);
    page.setTotal(query.count());
    return page;
}
 
Example 2
Source File: ProcessEngineService.java    From open-cloud with MIT License 5 votes vote down vote up
/**
 * 查询流程定义列表
 *
 * @return
 */
public IPage<ProcessDefinition> findProcessDefinition(String key, int firstResult, int maxResults) {
    ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
    // 只查询最新版本
    query.latestVersion();
    if (StringUtils.isNotBlank(key)) {
        String processKey = "%" + key + "%";
        query.processDefinitionKeyLike(processKey);
    }
    List<ProcessDefinition> list = query.listPage(firstResult, maxResults);
    IPage page = new Page();
    page.setRecords(list);
    page.setTotal(query.count());
    return page;
}
 
Example 3
Source File: TaskController.java    From open-cloud with MIT License 5 votes vote down vote up
/**
 * 获取任务列表
 *
 * @return
 */
@ApiOperation(value = "获取任务列表", notes = "获取任务列表")
@GetMapping(value = "/job")
public ResultBody<IPage<TaskInfo>> getJobList(@RequestParam(required = false) Map map) {
    List<TaskInfo> list = schedulerService.getJobList();
    IPage page = new Page();
    page.setRecords(list);
    page.setTotal(list.size());
    return ResultBody.ok().data(page);
}