mysql 字段类型为json,后端用list接收

数据库

board` jsonDEFAULT 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>

实体类

@Data

@EqualsAndHashCode(callSuper = false)

public class ProductDeviceOperationsVo extends BaseEntity {

private String brandId;

private String brandName;

private List<Map<String, Object>> board;

}

相关推荐
Venuslite3 天前
从 Unexpected token < 到 Extra data:一次讲清 JSON 解析错误的排查思路
json
唐青枫3 天前
MySQL JSON 实战详解:从存储、查询、更新到 JSON_TABLE 与索引
sql·mysql
小满8783 天前
5.Mysql事务隔离级别与锁机制
mysql
元Y亨H4 天前
技术笔记:MySQL 字符集排序规则与大小写敏感性问题解决方案
mysql
这个DBA有点耶5 天前
GROUP BY优化全解:如何写出既不丢数据又飞快的分组查询
数据库·mysql·架构
掉头发的王富贵5 天前
【StarRocks】极限十分钟入门StarRocks
数据库·sql·mysql
SamDeepThinking5 天前
一条UPDATE语句在MySQL 8.0中到底加了几把锁?
后端·mysql·程序员
李白客7 天前
KES新版MySQL兼容能力再升级意味着什么?
mysql·国产数据库
Jim6009 天前
【吃透 MySQL InnoDB连载】第 1 章・解密线上数据库高频故障
mysql