分页2
This commit is contained in:
@@ -21,6 +21,6 @@ public interface BannerDao extends BaseMapper<Banner> {
|
||||
|
||||
// List<Banner> selectList(@Param("classify") Integer classify);
|
||||
|
||||
IPage<Banner> selectBannerPage(Page<Banner> page,@Param("classify") Integer classify);
|
||||
List<Banner> selectBanner(@Param("classify") Integer classify);
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.banner.dao.BannerDao;
|
||||
@@ -53,8 +55,8 @@ public class BannerServiceImpl extends ServiceImpl<BannerDao, Banner> implements
|
||||
|
||||
@Override
|
||||
public PageUtils selectBannerPage(Integer page, Integer limit, Integer classify) {
|
||||
Page<Banner> pages = new Page<>(page, limit);
|
||||
return new PageUtils(bannerDao.selectBannerPage(pages, classify));
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(bannerDao.selectBanner(classify)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user