use of com.cas.sim.tis.mapper.ResourceMapper in project TeachingInSimulation by ScOrPiOzzy.
the class ResourceServiceImpl method findResourcesByCollection.
@Override
public PageInfo<Resource> findResourcesByCollection(int pagination, int pageSize, List<Integer> resourceTypes, String keyword, String orderByClause, Integer creator) {
ResourceMapper resourceMapper = (ResourceMapper) mapper;
// 开始分页查询
PageHelper.startPage(pagination, pageSize, orderByClause);
List<Resource> result = resourceMapper.findResourcesByCollection(resourceTypes, keyword, creator);
PageInfo<Resource> page = new PageInfo<Resource>(result);
// 查到的总记录数
// 解释一下:这个page.getTotal(),是所有符合条件的记录数。
// result.size():是当前页中的数据量 <= pageSize
LOG.info("成功查找到{}条资源,当前页码{},每页{}条资源,共{}页", result.size(), pagination, pageSize, page.getPages());
return page;
}
Aggregations