按视频目录建立mapper,在yml配置:
mybatis-plus: mapper-locations: - com/mp/mapper/*
这样报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mp.dao.UserMapper.selectAll,如果把mapper放到resource目录,则下面配置可以:
mybatis-plus: mapper-locations: classpath*:mapper/*
有时候,按照我视频那样写正常,有时候不正常,不正常的情况下可以在pom.xml文件中加入如下配置:
<build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> </resources> </build>
楼主,我遇到了和你一样的问题,你最后怎么解决的呀?
mybatis-plus: mapper-locations: classpath*:mybatis/mapper/*.xml