数据库
board` json DEFAULT NULL COMMENT '信息,格式[{"name":"net","chip":"esp32","hdVer":1}]'
接收-List
Mybatis
<resultMap id="productDeviceAndBrand" type="com.charg.product.domain.vo.ProductDeviceOperationsVo">
<result property="brandId" column="brand_id"/>
<result property="brandName" column="brand_name"/>
<result property="productName" column="product_name"/>
<result property="productCode" column="product_code"/>
<result property="deviceNum" column="device_num"/>
<result property="netFirmVer" column="net_firm_ver"/>
<result property="appFirmVer" column="app_firm_ver"/>
<result property="mcbFirmVer" column="mcb_firm_ver"/>
<result property="uiFirmVer" column="ui_firm_ver"/>
<result property="board" column="board" javaType="java.util.List"
typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
<result property="status" column="status"/>
<result property="productTime" column="product_time"/>
<result property="bindTime" column="bind_time"/>
</resultMap>文章来源:https://www.toymoban.com/news/detail-845864.html
实体类
@Data
@EqualsAndHashCode(callSuper = false)
public class ProductDeviceOperationsVo extends BaseEntity {
private String brandId;
private String brandName;
private List<Map<String, Object>> board;
}文章来源地址https://www.toymoban.com/news/detail-845864.html
到了这里,关于mysql 字段类型为json,后端用list接收的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!