package com.tourism.webadmin.back.model;

import com.baomidou.mybatisplus.annotation.*;
import com.tourism.common.core.annotation.RelationOneToOne;
import lombok.Data;

/**
 * 买卖房与顾问的关联表实体对象。
 *
 * @author 吃饭睡觉
 * @date 2024-09-06
 */
@Data
@TableName(value = "tour_house_advisor_relation")
public class TourHouseAdvisorRelation {

    /**
     * 主键。
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 顾问id。
     */
    @TableField(value = "advisor_id")
    private Long advisorId;

    /**
     * 房屋id。
     */
    @TableField(value = "house_id")
    private Long houseId;

    @RelationOneToOne(
            masterIdField = "advisorId",
            slaveModelClass = TourHouseAdvisorInfo.class,
            slaveIdField = "id")
    @TableField(exist = false)
    private TourHouseAdvisorInfo tourHouseAdvisorInfo;

    @RelationOneToOne(
            masterIdField = "houseId",
            slaveModelClass = TourHouseSaleInfo.class,
            slaveIdField = "id")
    @TableField(exist = false)
    private TourHouseSaleInfo tourHouseSaleInfo;
}
