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>
相关推荐
于先生吖几秒前
Java+SpringBoot 无人健身房物联网系统完整源码实现
java·spring boot·物联网
johnrui19 分钟前
SpringBoot-JdbcTemplate
java·spring boot·后端
码云社区22 分钟前
JAVA二手车交易二手车市场系统源码支持微信小程序+微信公众号+H5+APP
java·开发语言·微信小程序·二手交易·闲置回收
crescent_悦22 分钟前
C++:The Largest Generation
java·开发语言·c++
indexsunny35 分钟前
互联网大厂Java面试实战:从Spring Boot到微服务的技术问答解析
java·spring boot·redis·微服务·消息队列·电商
Victor3561 小时前
MongoDB(72)如何创建用户和角色?
后端
Victor3561 小时前
MongoDB(71)如何启用MongoDB身份验证?
后端
想打游戏的程序猿1 小时前
工具与协议层——Agent 如何连接世界
后端·ai编程
希望永不加班2 小时前
SpringBoot 过滤器(Filter)与请求链路梳理
java·spring boot·后端·spring
Lyyaoo.2 小时前
【JAVA基础面经】抽象类/方法与接口
java·开发语言