org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘) FROM sys_user’ at line 1 ### The error may exist in com/ruoyi/web/mapper/UserMapper.java (best guess) ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: SELECT COUNT() FROM sys_use
由于ruoyi-vue 集成了 pagehelper分页插件,在进行集成mybatis-plus时候,mybatis-plus 中有jsqlparser jar包,,pagehelper jsqlparser中也有jsqlparser jar包,排除下就可以了。 注意如果有用到mybatis-plus-generator也需要排除jsqlparser jar包,主要原因是因为两个版本不一致,代码逻辑不一致导致
将ruoyi-vue项目中的 pagehelper 依赖排除jsqlparser即可
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.boot.version}</version>
<exclusions>
<exclusion>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
</exclusion>
</exclusions>
</dependency>
重新加载maven即可