具體錯誤信息:
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。
解決:
-
SELECT COUNT(*) FROM (
-
<! -- 原來的sql -->
-
) t
再試下,ok