1.数据库设置字段
2.java实体类字段类型为List
@ApiModelProperty(value = "后缀")
@TableField(value = "postfix", typeHandler = JacksonTypeHandler.class)
private List<String> postfix;
3.TableName注解要加autoResultMap
@TableName(value = "op_dataset_view_conf",autoResultMap = true)
4.xml 字段加typehandler
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhito.sjpt.common.database.mapper.op.DatasetViewConfMapper">
<resultMap id="DatasetViewConf" type="com.zhito.sjpt.common.database.entity.op.DatasetViewConf">
<id column="id" property="id"/>
<result column="type" property="type"/>
<result column="play_next" property="playNext"/>
<result column="postfix" property="postfix" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
<result column="replay" property="replay"/>
</resultMap>
</mapper>