想去放牛

导航

 

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、给数据库字段设置个默认值

 

 

 

 

 

 

 

 

 

 

 

 

 

posted on 2022-03-29 11:18  想去放牛  阅读(582)  评论(0编辑  收藏  举报