常见问题
Long类型传至前端后几位变成0
请在Long类型字段上增加@JsonSerialize(using = ToStringSerializer.class)注解。
如果是List<Long>类型的字段,请在字段上增加@JsonSerialize(using = LongArrayToStringArraySerialize.class)注解。
@JsonSerialize(using = ToStringSerializer.class)
private Long parentId;
@JsonSerialize(using = LongArrayToStringArraySerialize.class)
private List<Long> parentIdList;
数据库更新为null值不生效
MyBatisPlus默认配置不允许更新为null值,如果要允许更新为null值
请在字段的@TableField注解中增加updateStrategy = FieldStrategy.IGNORED
@TableField(value = "parent_id", updateStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "父级部门ID")
private Long parentId;
数据库中json字段的使用
attachmentDto的使用... 怎么自己写typeJsonHandler select查询中怎么映射(resultMap大法)
