我遇到这个异常的原因是: mapper接口的返回类型是int,但是对应的mapper.xml的返回类型是Integer 解决这个问题: 把mapper.xml中对应的这个sql的返回值类型改为Integer