BindingException:Type interface XXX is not known to the MapperRegistry

  • 公司之前的非Spring boot项目,需要二次开发,新增表结构之后,在开发的过程中插入数据时遇到下面的异常
    org.apache.ibatis.binding.BindingException: Type interface com.ehi.oilRecord.dao.OilPerDistributionReserveMapper is not known to the MapperRegistry.
    BindingException:Type interface XXX is not known to the MapperRegistry
  • 第一反应是mybatis的表的mapper文件缺少配置导致的,找了一段时间之后发现在mybatis的工具类中需要配置新增表的mapper文件对应的class文件,新增addMapper问题得到解决
    BindingException:Type interface XXX is not known to the MapperRegistry