mybatis 如何通过resultMap 返回long

mybatis resultMap 返回long

  
          
     

mybatis long 类型返回为null报异常

Mapper method 'com.mpn.dao.TWeatherMapper.avgWeatherTemperature attempted to return null from a method with a primitive return type (long).


  
   
  
   

由于返回为空long中没有此类型所以抛异常,改为


   
  
   
  
   

用IFNULL来进行判断!

以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。

你可能感兴趣的:(mybatis 如何通过resultMap 返回long)