springboot 嵌套vo demo

java 复制代码
public class CarInfoVO {
    /**
     * 指导价min
     */
    private BigDecimal guidePriceMin;
    /**
     * 指导价max
     */
    private BigDecimal guidePriceMax;
    /**
     * 产品服役开始时间
     */
    private LocalDate startTime;
    /**
     * 产品服役结束时间
     */
    private LocalDate endTime;
    /**
     * FAQ
     */
    private List<String> faqs;
    /**
     * 产品配置详情(图片)
     */
    private List<String> details;
    /**
     * 图片
     */
    private String picture;
    /**
     * 视频
     */
    private String video;
    /**
     * 车辆
     */
    private List<Car> cars;

    @Data
    public static class Car {
        /**
         * 车辆id
         */
        private String carId;
        /**
         * 车牌号
         */
        private String carNumber;
        /**
         * 车辆显示图
         */
        private String display;
        /**
         * 车辆图片(包含外观、内饰、空间)
         */
        private List<String> pictures;
        /**
         * 车辆名称
         */
        private String title;
        /**
         * 上架状态 0未上架 1上架
         */
        private Integer status;
        /**
         * 排期状态 0无排期1有排期
         */
        private Integer schedule;
        /**
         * 租金
         */
        private BigDecimal price;
        /**
         * 添加时间
         */
        private LocalDateTime createTime;
        /**
         * 上牌时间
         */
        private String registrationTime;
        /**
         * 车牌属地
         */
        private String carModelTerritory;
        /**
         * 表显里程
         */
        private BigDecimal currentMileage;
        /**
         * 自定义车辆配置
         */
        private List<CustomCarConfig> customCarConfigs;

        @Data
        public static class CustomCarConfig {
            private String title;
            private String resume;
            private String detail;
        }
    }

    /**
     * 标签
     */
    private List<String> tags;
    /**
     * 保险
     */
    private List<Insure> insures;

    @Data
    public static class Insure {
        /**
         * 保险id
         */
        private String id;
        /**
         * 名称
         */
        private String title;
        /**
         * 价格
         */
        private BigDecimal price;
        /**
         * 标签
         */
        private String tag;
        /**
         * 简述
         */
        private String sketch;
        /**
         * 详情
         */
        private String detail;
        /**
         * 条目
         */
        private List<Term> terms;

        @Data
        public static class Term {
            /**
             * 名称
             */
            private String title;
            /**
             * 简述
             */
            private String sketch;
            /**
             * 详情
             */
            private String detail;
        }
    }

    /**
     * 订阅特权
     */
    private List<GeneralConfiguration> privileges;
    /**
     * 取消策略
     */
    private List<GeneralConfiguration> cancelPolicies;
    /**
     * 取车说明
     */
    private List<GeneralConfiguration> pickupInstructions;
    /**
     * 还车说明
     */
    private List<GeneralConfiguration> returnInstructions;
    /**
     * 押金说明
     */
    private List<GeneralConfiguration> despositInstructions;

    @Data
    public static class GeneralConfiguration {
        /**
         * 名称
         */
        private String title;
        /**
         * 名称
         */
        private String sketch;
        /**
         * 详情
         */
        private String detail;
        /**
         * 图标
         */
        private String icon;
    }
}

对应的map

xml 复制代码
 <resultMap id="getCarInfoListMap" type="com.fy.middleground.subscribe.vo.app.CarInfoVO" autoMapping="true">
        <id column="id"/>
        <collection property="privileges" 
                    ofType="com.fy.middleground.subscribe.vo.app.CarInfoVO$GeneralConfiguration" autoMapping="true">
            <id column="title"/>
            <result property="title" column="legalTitle"/>
            <result property="sketch" column="legalSketch"/>
            <result property="detail" column="legalDetail"/>
            <result property="icon" column="legalIcon"/>
        </collection>
        <collection property="cars" ofType="com.fy.middleground.subscribe.vo.app.CarInfoVO$Car" autoMapping="true">
            <id column="carId"/>
        </collection>
    </resultMap>
相关推荐
Pomelo_刘金几秒前
Rust : 新版本 1.91.0 裸指针检测 Lint
后端·rust·编程语言
Pomelo_刘金1 分钟前
Rust : 新版本 1.93.0 深度解析
后端·rust·编程语言
无籽西瓜a2 分钟前
【西瓜带你学设计模式 | 第十九期 - 状态模式】状态模式 —— 状态流转与行为切换实现、优缺点与适用场景
java·后端·设计模式·状态模式·软件工程
Han.miracle2 分钟前
微服务注册中心实操:Eureka+Zookeeper对比+CAP定理详解
java·spring boot·spring
Pomelo_刘金3 分钟前
Rust:新版本 1.91.1 版本修复解析
后端·rust·编程语言
llm大模型算法工程师weng3 分钟前
Java面试核心突破:面向对象与设计模式
java·设计模式·面试
Pomelo_刘金4 分钟前
Rust:新版本 1.92.0 Never 类型更新
后端·rust·编程语言
Pomelo_刘金5 分钟前
Rust:新版本 1.94.0 深度解析
后端·rust·编程语言
weixin_520649875 分钟前
xml json ini 文件语法
xml·java·json
user_admin_god5 分钟前
AI编码OpenCode入门到入神
java·人工智能