package com.tourism.webadmin.back.model;

import com.baomidou.mybatisplus.annotation.*;
import com.tourism.common.core.annotation.*;
import com.tourism.common.core.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 游记与项目关联实体对象。
 *
 * @author 吃饭睡觉
 * @date 2024-09-06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "tour_travel_notes_project_relation")
public class TourTravelNotesProjectRelation extends BaseModel {

    /**
     * Id主键。
     */
    @TableId(value = "id")
    private String id;

    /**
     * 游记id。
     */
    @TableField(value = "travel_notes_id")
    private String travelNotesId;

    /**
     * 项目id。
     */
    @TableField(value = "project_id")
    private String projectId;

    /**
     * 逻辑删除标记字段(1: 正常 -1: 已删除)。
     */
    @TableLogic
    @TableField(value = "data_state")
    private Integer dataState;

    @RelationOneToOne(
            masterIdField = "travelNotesId",
            slaveModelClass = TourTourismProjectTravelNotes.class,
            slaveIdField = "id")
    @TableField(exist = false)
    private TourTourismProjectTravelNotes tourTourismProjectTravelNotes;

    @RelationOneToOne(
            masterIdField = "projectId",
            slaveModelClass = TourismProject.class,
            slaveIdField = "id")
    @TableField(exist = false)
    private TourismProject tourismProject;
}
