SpringBoot集成MyBatis-Plus报错:

  • Warn: Could not find @TableId in Class: com.mzmy.bookdata.vo.BooksVo.

在调用selectById(id)查询数据时的报错
image
从后台日志信息可以看到,这是因为表不包含主键时,给予的警告:
image

解决方法:

		查看该实体类是否缺少id字段
		查看该表中是否设置了id主键
		
		@TableId(value = "c_id",type = IdType.AUTO)//在自增主键的变量加上即可
		private Integer cId;