1、<select id="selectByExample" 添加
<if test="pageIndex != null and pageSize != null and pageSize != 0">
limit #{pageIndex},#{pageSize}
</if>
2、generator 生成的class ***Example 中添加
private Integer pageIndex;
private Integer pageSize;
public Integer getPageIndex() {
return pageIndex;
}
public void setPageIndex(Integer pageIndex) {
this.pageIndex = pageIndex;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
3、DAO层实现层 *DaoImpl implements *Dao 中方法 set pageIndex/pageSize
public List<*> selectMaintainInfo(MaintainConfigBean request, Integer pageIndex,Integer pageSize) {
Example example = new Example();
example.setPageIndex(pageIndex);
example.setPageSize(pageSize);
网友评论