当前使用版本(必填,否则不予处理)

mybatis-plus-boot-starter

3.4.0

该问题是如何引起的?(确定最新版也有问题再提!!!)

引起原因详述

这里使用的是@Mapper

项目启动类中 增加 @ComponentScan() 只要指定扫描位置(包括了mapper.java文件位置) 项目启动类中 增加 @ComponentScans() 只要指定扫描位置(包括了mapper.java文件位置),无论指定一种或多种扫描位置 mybatis 不加载,请求接口报错

重现步骤(如果有就写完整)

手动增加 @ComponentScan

报错信息

Invalid bound statement (not found): com.apsp.demo.aaa.sys.mapper.UserMapper.selectList

Comment From: wangyunpeng0319

使用这个注解@MapperScan

Comment From: niuniu-blog

并没有,只是引入进去,没有进行其他配置

在 2020年11月3日 22:59,miemieYahonotifications@github.com 写道:

你自己注入了 MapperFactoryBean 或 MapperScannerConfigurer ? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Comment From: miemieYaho

这是mybatis的东西,你自己多谷歌看看吧

Comment From: niuniu-blog

使用@MapperScan 这个注解 指定路径就可以了

在 2020年11月4日 13:40,miemieYahonotifications@github.com 写道:

这是mybatis的东西,你自己多谷歌看看吧 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.