问题描述:
SpringBoot项目启动报错,报错内容:‘com.xxx.mapper.XxxxMapper’ that could not be found
*************************** APPLICATION FAILED TO START
Description:
Field userMapper in com.demo.controller.MemberController required a
bean of type ‘com.demo.mapper.UserMapper’ that could not be found.Action:
Consider defining a bean of type ‘com.demo.mapper.UserMapper’ in your
configuration.Process finished with exit code 1
问题原因:未扫描到mapper
解决方式:启动类中添加@MapperScan("com.demo.mapper")