问题: 代码: 原因分析: Mapper.xml文件中返回类型是integer,是允许为null,Mapper.java中返回值是int不能为null 解决方案: 将Mapper.java中int 改为integer ,问题解决