MyBatis的一点小"bug"
//分页查询
findPage() {
var param = {
currentPage:this.pagination.currentPage,
pageSize:this.pagination.pageSize,
queryString: this.pagination.queryString // 查询条件
};
// 发送ajax请求到后台
axios.post("/orderSettingList/findPage.do",param)
.then((res)=>{
//解析Controller响应回的数据,为模型数据赋值
this.pagination.total = res.data.total;
this.dataList = res.data.rows;
}
);
}
前端代码如上,将分页查询的参数封装然后发送到后台,在后台,执行如下代码
// 导入分页插件的包
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
// 导入OrderSettingListDaoHj包,这个包是被代理的接口的包
import com.itheima.dao.OrderSettingListDaoHj;
// 导入一个封装返回结果的包
import com.itheima.entity.PageResult;
// 导入一个封装了前端传递过来的参数的包
import com.itheima