Java Code Examples for com.baomidou.mybatisplus.plugins.Page#getTotal()

The following examples show how to use com.baomidou.mybatisplus.plugins.Page#getTotal() . 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: UserServiceImpl.java    From easyweb-shiro with MIT License 6 votes vote down vote up
@Override
public PageResult<User> list(int pageNum, int pageSize, boolean showDelete, String column, String value) {
    Wrapper<User> wrapper = new EntityWrapper<>();
    if (StringUtil.isNotBlank(column)) {
        wrapper.like(column, value);
    }
    if (!showDelete) {  // 不显示锁定的用户
        wrapper.eq("state", 0);
    }
    Page<User> userPage = new Page<>(pageNum, pageSize);
    List<User> userList = userMapper.selectPage(userPage, wrapper.orderBy("create_time", true));
    if (userList != null && userList.size() > 0) {
        // 查询user的角色
        List<UserRole> userRoles = userRoleMapper.selectByUserIds(getUserIds(userList));
        for (User one : userList) {
            List<Role> tempURs = new ArrayList<>();
            for (UserRole ur : userRoles) {
                if (one.getUserId().equals(ur.getUserId())) {
                    tempURs.add(new Role(ur.getRoleId(), ur.getRoleName()));
                }
            }
            one.setRoles(tempURs);
        }
    }
    return new PageResult<>(userPage.getTotal(), userList);
}
 
Example 2
Source File: PageInfoBT.java    From MeetingFilm with Apache License 2.0 4 votes vote down vote up
public PageInfoBT(Page<T> page) {
    this.rows = page.getRecords();
    this.total = page.getTotal();
}
 
Example 3
Source File: PageInfoBT.java    From WebStack-Guns with MIT License 4 votes vote down vote up
public PageInfoBT(Page<T> page) {
    this.rows = page.getRecords();
    this.total = page.getTotal();
}
 
Example 4
Source File: LoginRecordServiceImpl.java    From easyweb-shiro with MIT License 4 votes vote down vote up
@Override
public PageResult<LoginRecord> list(int pageNum, int pageSize, String startDate, String endDate, String account) {
    Page<LoginRecord> page = new Page<>(pageNum, pageSize);
    List<LoginRecord> records = loginRecordMapper.listFull(page, startDate, endDate, account);
    return new PageResult<>(page.getTotal(), records);
}