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>
相关推荐
寻星探路4 小时前
【深度长文】万字攻克网络原理:从 HTTP 报文解构到 HTTPS 终极加密逻辑
java·开发语言·网络·python·http·ai·https
想用offer打牌5 小时前
MCP (Model Context Protocol) 技术理解 - 第二篇
后端·aigc·mcp
曹牧6 小时前
Spring Boot:如何测试Java Controller中的POST请求?
java·开发语言
KYGALYX6 小时前
服务异步通信
开发语言·后端·微服务·ruby
掘了7 小时前
「2025 年终总结」在所有失去的人中,我最怀念我自己
前端·后端·年终总结
爬山算法7 小时前
Hibernate(90)如何在故障注入测试中使用Hibernate?
java·后端·hibernate
kfyty7257 小时前
集成 spring-ai 2.x 实践中遇到的一些问题及解决方案
java·人工智能·spring-ai
猫头虎7 小时前
如何排查并解决项目启动时报错Error encountered while processing: java.io.IOException: closed 的问题
java·开发语言·jvm·spring boot·python·开源·maven
李少兄7 小时前
在 IntelliJ IDEA 中修改 Git 远程仓库地址
java·git·intellij-idea