Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[错误报告]: 分页插件在属性有 List 遇到 where 后 total 数目 #6584

Open
3 tasks done
Asukadadadihaokan opened this issue Nov 13, 2024 · 0 comments
Open
3 tasks done

Comments

@Asukadadadihaokan
Copy link

确认

  • 我使用的版本是最新版, 并且使用插件确认过项目里无依赖版本冲突
  • 我已经在 issue 中搜索过, 确认问题没有被提出过
  • 我已经修改标题, 将标题中的 描述 替换为遇到的问题

当前程序版本

3.5.9

问题描述

4

3
我在利用上述语句测试的时候,是成功的,尽管有 4 行数据,但是 total 为 3, 后续发现有个属性为 null 则他不该显示,所以在 sql 最后加了一个 where attr is not null,但后续发现, total 的值为结果的行数,并非实际对象数了。
如果能解答或提供相关帮助,万分感谢

详细堆栈日志

2024-11-13T23:57:55.994+08:00 DEBUG 11212 --- [amusement-park-server] [           main] e.c.m.m.S.pagination_mpCount             : ==>  Preparing: SELECT COUNT(*) AS total FROM system_user AS u LEFT JOIN system_user_role AS ur ON u.id = ur.user_id LEFT JOIN system_role AS r ON ur.role_id = r.id WHERE ur.role_id IS NOT NULL
2024-11-13T23:57:56.015+08:00 DEBUG 11212 --- [amusement-park-server] [           main] e.c.m.m.S.pagination_mpCount             : ==> Parameters: 
2024-11-13T23:57:56.031+08:00 DEBUG 11212 --- [amusement-park-server] [           main] e.c.m.m.S.pagination_mpCount             : <==      Total: 1
2024-11-13T23:57:56.035+08:00 DEBUG 11212 --- [amusement-park-server] [           main] e.c.m.m.SystemUserMapper.pagination      : ==>  Preparing: select u.id, u.username, u.password, u.nickname, u.phone_number, u.avatar, u.del_flag, u.create_time, u.update_time, ur.id as ur_id, ur.role_id as ur_role_id, ur.user_id as ur_user_id from system_user as u left join system_user_role as ur on u.id = ur.user_id left join system_role as r on ur.role_id = r.id where ur.role_id is not null LIMIT ?
2024-11-13T23:57:56.035+08:00 DEBUG 11212 --- [amusement-park-server] [           main] e.c.m.m.SystemUserMapper.pagination      : ==> Parameters: 10(Long)
2024-11-13T23:57:56.042+08:00 DEBUG 11212 --- [amusement-park-server] [           main] e.c.m.m.SystemUserMapper.pagination      : <==      Total: 2
SystemUserManageInfo(super=SystemUser(id=1, username=zs, password=null, nickname=null, phoneNumber=18650758741, avatar=null, delFlag=false), roles=[SystemUserRole(id=1, userId=1, roleId=1), SystemUserRole(id=2, userId=1, roleId=2)])
2
2024-11-13T23:57:56.069+08:00  INFO 11212 --- [amusement-park-server] [ionShutdownHook] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closing ...
2024-11-13T23:57:56.073+08:00  INFO 11212 --- [amusement-park-server] [ionShutdownHook] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant