【java】记录一次非常奇怪的冲突

发现mybatis-plus 3.4.1与pagehelper-spring-boot-starter 1.4.7有冲突,编译时能成功,但是运行时,查询记录条数拼接出来的count() 会运行异常!

2024-05-07 08:42:54,177|WARN|org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver|207|Resolved [org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: com.microsoft.sqlserver.jdbc.SQLServerException: COUNT 函数要求有 1 个参数。
### The error may exist in com/soft/htgl/mapper/JtjyNcctoszyyHtqdMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT COUNT() FROM JTJY_NCCToSZYY_HTQD WHERE (groupid = ?)
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: COUNT 函数要求有 1 个参数。]

  解决方法:将pagehelper-spring-boot-starter降为1.4.4即可!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章