Mybatis-puls BUG集合

No qualifying bean of type ‘com.tengyun.itinerary.mapper.ClasMapper’ available: expected at least 1 bean which qualifies as autow

没有合格的bean可用,没有扫描到mapper,需要在启动类中加入,@MapperScan(" com.test.test1.mapper ")
Mybatis-puls BUG集合_第1张图片

Invalid bound statement (not found): com.tengyun.itinerary.service.ClasService.pageClas

绑定语句无效,没有加载到mapper.xml文件,如果你的mapper.xml放在Java类文件夹中,需要在pom.xml中配置,放在dependencies标签外


    
        
            
                src/main/java
                
                    **/*.xml
                
                false
            
        
    

在application.properties配置文件中,配置

#配置mapper xml文件的路径
mybatis-plus.mapper-locations=classpath:com/lsl/eduservice/mapper/xml/*.xml

yml格式

mybatis-puls:
  mapper-locations: classpath:/com/tengyun/itinerary/mapper/xml/*.xml

不要把路径写错了

你可能感兴趣的:(spring,boot)