昨日遇到此类问题,在网上找许多解决办法。
汇总如下。
1、https://www.jianshu.com/p/121e5567af57 主键未加@tableId注解
2、https://blog.csdn.net/weigang200820chengdu/article/details/81407995 MP配置未正确引入。
mapper-locations: classpath:mapper/*/*Mapper.xml
3、https://blog.csdn.net/a347911/article/details/79580621 MP的大量问题汇总
上面的都参考过了,一步一步排除之后,确定了是MP未正确引入。
//MP说明中,有一段话,如下 //调整 SqlSessionFactory 为 MyBatis-Plus 的 SqlSessionFactory
<bean id="sqlSessionFactory" class="com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>