Project scenario:
Used by SpringBoot+MybatisPlus.
Problem Description
Could not autowire. No beans of ‘UserMapper’ type found.
Cause Analysis:
not scanned
Because this is the code for SpringBoot to integrate Mybatis, the @Mapper annotation is used in the Mapper interface class.
But it would be troublesome to add @Mapper annotation to each Mapper interface class, so the @MapperScan annotation is used to scan Mapper interface classes in batches.
solution:
Add the @MapperScan("com.xxx.xxx.mapper") annotation to the xxxApplication startup class.