具体错误信息:

org.apache.ibatis.binding.BindingException: Mapper method 'com.xx.xx.xx.xx.xx.getCount attempted to return null from a method with a primitive return type (int). 

 

定义的Integer,怎么会返回null呢?mysql版本问题?

不是这样的,仔细检查sql语句,加了group by ,那么count(*)在检索后如果没有任何数据,那就会返回null。

解决:

 

  1.  
    SELECT COUNT(*) FROM (
  2.  
    <!-- 原来的sql -->
  3.  
    ) t


再试下,ok

相关文章:

  • 2021-11-17
  • 2021-10-25
  • 2021-09-10
  • 2022-12-23
  • 2021-07-15
  • 2022-12-23
  • 2021-08-25
猜你喜欢
  • 2022-01-26
  • 2021-10-23
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2022-01-16
  • 1970-01-01
相关资源
相似解决方案