spring boot Mybatis_plus 读取数据库selectById()和selectList()返回null问题
1.控制台问题如下所示:

2.解决方案:
1.在yml配置文件中加入(当然yaml和 properties文件也一样,改成对应文件格式就可以了)

只加入这一项可以解决解决selectList()问题。
2.在我们的类文件中的id上面加入注明

(mybatis_plus 默认会使用 “id” 为主键字段解决:加上@TableId(value =“数据库你的主键字段”)注解即可)
posted on 2022-03-17 13:50 WenHaooooo 阅读(1743) 评论(0) 收藏 举报
浙公网安备 33010602011771号