解决 Invalid bound statement: com.luwebsite.online.modules.business.service.ArtcleCousemer.getById问题

Spring Boot ::(v2.3.5.RELEASE) +mybatis-plus3.2.0版本项目 @MapperScan("com.luwebsite.online")与@mapper的共用


就出现这个问题

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.luwebsite.online.modules.business.service.ArtcleCousemerService.getById

项目启动没问题,但是请求方法的时候出现了这样一个问题,本人也在网上找了很多解决办法,但是情况和我的好像都不一样,大部分找到的是这种说法

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题,即在mybatis中dao接口与mapper配置文件在做映射绑定的时候出现问题,简单说,就是接口与xml要么是找不到,要么是找到了却匹配不到。

可是我前前后后 从 yml配置到mapper 与 mapper.xml,仔细检查都没有任何问题,问题困扰了我好几天,后来发现在mybatis-plus里 如果 你不小心 配置了@mapperscan 而且又在dao层上加了@mapper

就会出现这个问题,只有去掉一个就不会有问题了。

上一篇:报错:Invalid bound statement (not found): com.pinyougou.mapper.TbBrandMapper.selectByExample


下一篇:2020.2.27——STL初步