Mybatis把返回结果封装成map类型,表的字段名对应map中的key,字段所属的值对应map中的value时提示@MapKey is required
解决方案:
添加注解:@SuppressWarnings("MybatisXMapperMethodInspection")
在上方加入你所要指定的主键即可,@MapKey("xx") 指定一个字段xx作为返回Map中的key
![](https://img-blog.csdnimg.cn/img_convert/2c4caf8f463b5617cd1f5c74283cc9fe.png)
Mybatis把返回结果封装成map类型,表的字段名对应map中的key,字段所属的值对应map中的value时提示@MapKey is required
解决方案:
添加注解:@SuppressWarnings("MybatisXMapperMethodInspection")
在上方加入你所要指定的主键即可,@MapKey("xx") 指定一个字段xx作为返回Map中的key