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;

}

相关推荐
长征coder1 小时前
AWS MySQL 读写分离配置指南
mysql·云计算·aws
ladymorgana1 小时前
【docker】修改 MySQL 密码后 Navicat 仍能用原密码连接
mysql·adb·docker
PanZonghui1 小时前
Centos项目部署之安装数据库MySQL8
linux·后端·mysql
GreatSQL社区2 小时前
用systemd管理GreatSQL服务详解
数据库·mysql·greatsql
掘根2 小时前
【MySQL进阶】错误日志,二进制日志,mysql系统库
数据库·mysql
weixin_438335402 小时前
基础知识:mysql-connector-j依赖
数据库·mysql
小明铭同学2 小时前
MySQL 八股文【持续更新ing】
数据库·mysql
纳兰青华2 小时前
bean注入的过程中,Property of ‘java.util.ArrayList‘ type cannot be injected by ‘List‘
java·开发语言·spring·list
云泽野10 小时前
【Java|集合类】list遍历的6种方式
java·python·list
程序员岳焱12 小时前
Java 与 MySQL 性能优化:Java 实现百万数据分批次插入的最佳实践
后端·mysql·性能优化