MyBatis提示getFundBonus attempted to return null from a method with a primitive return type (double)

suyunlong發表於2017-10-13

錯誤提示:

Caused by: org.apache.ibatis.binding.BindingException: Mapper method 'com.amc.nonstandardinsinfo.dao.mapper.NonstandardInsInfoManageMapper.getFundBonus attempted to return null from a method with a primitive return type (double).

解決方法:

原SQL:

select SUM(t.STOCK_NUMBER) from AMC_BIZ_REC t WHERE t.UUID=123

修改後SQL:

select NVL(SUM(t.STOCK_NUMBER),0) from AMC_BIZ_REC t WHERE t.UUID=123

加上NVL後就可以解決SUM為空時,不能將NULL複製給double型別的問題了。



相關文章