Search in sources :

Example 1 with LibraryPublishMapper

use of com.cas.sim.tis.mapper.LibraryPublishMapper in project TeachingInSimulation by ScOrPiOzzy.

the class LibraryPublishServiceImpl method findPublishForTeacher.

@Override
public PageInfo<LibraryPublishForTeacher> findPublishForTeacher(int pageIndex, int pageSize, int creator) {
    LibraryPublishMapper publishMapper = (LibraryPublishMapper) mapper;
    PageHelper.startPage(pageIndex, pageSize);
    List<LibraryPublishForTeacher> result = publishMapper.findPublishForTeacher(creator);
    PageInfo<LibraryPublishForTeacher> page = new PageInfo<>(result);
    LOG.info("成功查找到{}条资源,当前页码{},每页{}条资源,共{}页", result.size(), pageIndex, pageSize, page.getPages());
    return page;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) LibraryPublishMapper(com.cas.sim.tis.mapper.LibraryPublishMapper) LibraryPublishForTeacher(com.cas.sim.tis.vo.LibraryPublishForTeacher)

Example 2 with LibraryPublishMapper

use of com.cas.sim.tis.mapper.LibraryPublishMapper in project TeachingInSimulation by ScOrPiOzzy.

the class LibraryPublishServiceImpl method findPublishForStudent.

@Override
public PageInfo<LibraryPublishForStudent> findPublishForStudent(int pageIndex, int pageSize, int type, int creator) {
    LibraryPublishMapper publishMapper = (LibraryPublishMapper) mapper;
    PageHelper.startPage(pageIndex, pageSize);
    List<LibraryPublishForStudent> result = publishMapper.findPublishForStudent(type, creator);
    PageInfo<LibraryPublishForStudent> page = new PageInfo<>(result);
    LOG.info("成功查找到{}条资源,当前页码{},每页{}条资源,共{}页", result.size(), pageIndex, pageSize, page.getPages());
    return page;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) LibraryPublishMapper(com.cas.sim.tis.mapper.LibraryPublishMapper) LibraryPublishForStudent(com.cas.sim.tis.vo.LibraryPublishForStudent)

Aggregations

LibraryPublishMapper (com.cas.sim.tis.mapper.LibraryPublishMapper)2 PageInfo (com.github.pagehelper.PageInfo)2 LibraryPublishForStudent (com.cas.sim.tis.vo.LibraryPublishForStudent)1 LibraryPublishForTeacher (com.cas.sim.tis.vo.LibraryPublishForTeacher)1