MybatisPlus的那些坑
1.实体类属性会被错误解析,需要加上注解@TableField
@TableField("front_of_id_card")
//身份证正面
private String frontOfIDCard;
上面这个属性就会被错误解析成front_of_i_d_card,加了映射关系也好像没有用
<resultMap id="BaseResultMap" type="com.seaway.cms.mtp.model.SubRmmsCustomUser">
<result column="front_of_id_card" property="frontOfIDCard" />
</resultMap>
2.实体类有数据库不存在的字段的时候,意思是数据库对应的字段在映射关系里面,映射关系里面的字段除外的字段,在调用MybatisPlus时也会报错,这时候需要用到另一种注解@TableField(exist = false)
//字段不在库表中 @TableField(exist = false) private String queryType;
后续MybatisPlus坑会不断更新
浙公网安备 33010602011771号