Mapper method 'com.gyl.mapper.BrandMapper.selectTotalCount attempted to return null from a method with a primitive return type (int).
解决方法:
遇到此类问题去检查你的@ResultMap
第一种情况: 是未配置 导致数据库与需要使用的名称不一致,需要配置@ResultMap使其名称一致就可以了
@ResultMap
第二种情况:就是误配置,这里selectTotalCount 无返回值类型 就不要使用 @ResultMap
这里的正确做法是
希望能给您带来帮助!