| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.Page; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.*; |
| | |
| | | } |
| | | } |
| | | } |
| | | PageInfo pageInfo=new PageInfo(flagList); |
| | | //创建Page类 |
| | | Page page = new Page(pageCurr, pageSize); |
| | | //为Page类中的total属性赋值 |
| | | int total = flagList.size(); |
| | | page.setTotal(total); |
| | | //计算当前需要显示的数据下标起始值 |
| | | int startIndex = (pageCurr - 1) * pageSize; |
| | | int endIndex = Math.min(startIndex + pageSize,total); |
| | | //从链表中截取需要显示的子链表,并加入到Page |
| | | page.addAll(flagList.subList(startIndex,endIndex)); |
| | | //以Page创建PageInfo |
| | | PageInfo pageInfo = new PageInfo<>(page); |
| | | return new Response().setII(1,flagList.size()>0,pageInfo,"筛选数据库信息"); |
| | | } |
| | | |