当前使用版本(必填,否则不予处理)

3.4.1

该问题是如何引起的?(确定最新版也有问题再提!!!)

若依框架 将mybatis 替换成mybatis-plus ,用分页插件 sql语句中的 COUNT () 括号里没有 * ,导致sql执行报错。 但是直接使用Pagehelper.startPage() 可以。

重现步骤(如果有就写完整)

报错信息

MyBatis-Plus 分页查询 COUNT () 括号里没有 *

Comment From: miemieYaho

最新版

Comment From: fun-huan

我跟你遇到了同样的问题,最后发现是依赖冲突导致的,你可以看下你工程里面是否有高版本的jsqlparser包。 com.github.jsqlparser jsqlparser

Comment From: crossyourheart

我跟你遇到了同样的问题,最后发现是依赖冲突导致的,你可以看下你工程里面是否有高版本的jsqlparser包。 com.github.jsqlparser jsqlparser 我是升级成最新的mybatis-plus 之后,发现启动报错。也是依赖冲突,排除了pagehelper 中的 mybatis 就可以了。

Comment From: boxzhang88

若依整合Mybatis-plus报错select count()去掉这个依赖就行了

    <dependency>
        <groupId>com.github.pagehelper</groupId>
        <artifactId>pagehelper-spring-boot-starter</artifactId>
        <exclusions>
            <exclusion>
                <artifactId>jsqlparser</artifactId>
                <groupId>com.github.jsqlparser</groupId>
            </exclusion>
        </exclusions>
    </dependency>

Comment From: Qwenjin

不是Jsqlparser的问题,参考:https://github.com/baomidou/mybatis-plus/issues/5020