|
|
@@ -1,13 +1,12 @@
|
|
|
package top.imwork.window.silos.service.impl;
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
import jakarta.annotation.Resource;
|
|
|
|
|
|
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 top.imwork.commons.core.constants.Constants;
|
|
|
@@ -22,6 +21,7 @@ import top.imwork.window.silos.service.IContentsService;
|
|
|
import top.imwork.window.silos.convert.ContentsConvert;
|
|
|
|
|
|
import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Service("contentsService")
|
|
|
public class ContentsServiceImpl extends ServiceImpl<ContentsDao,Contents> implements IContentsService {
|
|
|
@@ -114,16 +114,17 @@ public class ContentsServiceImpl extends ServiceImpl<ContentsDao,Contents> imple
|
|
|
queryWrapper.apply("update_time <= '" + contentsListDTO.getUpdateEndTime() + "'");
|
|
|
}
|
|
|
|
|
|
- Page<Contents> page = new Page<>(contentsListDTO.getPageNo(), contentsListDTO.getPageRows());
|
|
|
+
|
|
|
PageHelper.startPage(contentsListDTO.getPageNo(), contentsListDTO.getPageRows());
|
|
|
- IPage<Contents> iPage = contentsDao.queryPage(page, queryWrapper);
|
|
|
+ List<Contents> list = contentsDao.selectList(queryWrapper);
|
|
|
+ PageInfo<Contents> pageInfo = new PageInfo<>(list);
|
|
|
|
|
|
ContentsResultBO resultBO = new ContentsResultBO();
|
|
|
resultBO.setPageNo(contentsListDTO.getPageNo());
|
|
|
resultBO.setPageRows(contentsListDTO.getPageRows());
|
|
|
- resultBO.setPageCount((int) iPage.getPages());
|
|
|
- resultBO.setTotalRows((int) iPage.getTotal());
|
|
|
- resultBO.setDataList(ContentsConvert.contentsListToContentsBOList(iPage.getRecords()));
|
|
|
+ resultBO.setPageCount(pageInfo.getPages());
|
|
|
+ resultBO.setTotalRows((int) pageInfo.getTotal());
|
|
|
+ resultBO.setDataList(ContentsConvert.contentsListToContentsBOList(list));
|
|
|
resultBO.setParams(contentsListDTO);
|
|
|
|
|
|
return resultBO;
|