其他分享
首页 > 其他分享> > 分页插件pagehelper的count问题

分页插件pagehelper的count问题

作者:互联网

  分页插件pagehelper使用的默认count是select count(0) from (你的sql) table_count,也就是说,你用什么sql他就怎么count,但是问题在于,我的sql是用left join 的,这个查询的数据和我想要的total总数是不符的,所以需要手动给pagehelper设定自定义的count,目前只知道xml配置的设定,就是在你原先sql的基础上,再写一份原先id_count的查询sql就行了,pagehelper就会按照你指定的sql查询统计。

标签:count,插件,分页,查询,sql,pagehelper
来源: https://www.cnblogs.com/bulesea/p/16489257.html