使用mybatis-plus分页查询时出现这个错误,弄了好久也不知道哪里错了,求解!

这是我分页查询的代码

img

Error querying database. Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error: Method queryTotal execution error.

The error may exist in com/javali/organization/mapper/CommentMapper.java (best guess)

The error may involve defaultParameterMap

The error occurred while setting parameters

Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error: Method queryTotal execution error.

日志很明显呀,函数查询总数的时候出错了

1.首先你传的参数是什么呢?最好发出来才能更好分析;
2.selectPage 返回的是Page吧,这个我有点记不太清,你可以查一下

这个问题我也遇到了,你解决了吗

我的报错和你这一样,我把mybatisplus的版本降到3.4.0就没有报这个错误了。我刚开始开始用的是版本是3.4.2。

<dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.4.0</version>
</dependency>