数据库设计
类型选择json
CREATE TABLE `t_project_decision_chain` (
`id` varchar(32) NOT NULL COMMENT 'id',
`content` json DEFAULT NULL COMMENT '内容',
PRIMARY KEY (`id`)
)
实体创建
类上加@TableName(value = "t_project_score", autoResultMap = true),不加的话查询结果json字段为空
字段添加@TableField(typeHandler = FastjsonTypeHandler.class),不加会导致插入数据库报错
@TableName(value = "t_project_score", autoResultMap = true)
public class ProjectScore implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.INPUT)
private String id;
@ApiModelProperty("内容")
@TableField(typeHandler = FastjsonTypeHandler.class)
private JSONObject content;
}