Mybatis Plus创建重复Mapper的问题

一、提示如下:Skipping MapperFactoryBean with name ‘xxxMapper’ and ‘com.xxx.xxx.mapper.xxxMapper’ mapperInterface. Bean already defined with the same name!

二、原因分析:提示很明显,说明是重复往容器里注册了名称一样的bean。检查发现,springboot启动配置和Mybatis Plus配置都加了@MapperScan注解

https://qwe-oss.oss-cn-beijing.aliyuncs.com/image/Snipaste_2024-05-23_16-00-23.jpg

https://qwe-oss.oss-cn-beijing.aliyuncs.com/image/Snipaste_2024-05-23_16-00-00.jpg

三、解决方案:去除其中一个即可,我这里去除的是springboot启动配置的@MapperScan注解