1.出问题代码
当sql返回结果为null时报错 org.apache.ibatis.binding.BindingException: Mapper method 'com.yswl.scientific.mapper.UniScientificPayoffsFlowMapper.getMaxXJSort attempted to return null from a method with a primitive return type (int).
解决方案:
1、将select出的字段加上IFNULL函数,将null替换成其他相同返回类型的值(mysql的解决方案)
2、给数据库字段设置个默认值