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;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;

/**
 * 旅游项目日历价格实体对象。
 *
 * @author 吃饭睡觉
 * @date 2024-09-06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "tour_tourism_date_price")
public class TourismDatePrice extends BaseModel {

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

    /**
     * 旅游项目信息。
     */
    @TableField(value = "project_id")
    private String projectId;

    /**
     * 出发日期。
     */
    @TableField(value = "departure_date")
    private Date departureDate;

    /**
     * 成人价格。
     */
    @TableField(value = "adult_price")
    private BigDecimal adultPrice;

    /**
     * 儿童价格。
     */
    @TableField(value = "children_price")
    private BigDecimal childrenPrice;

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

    /**
     * departureDate 范围过滤起始值(>=)。
     */
    @TableField(exist = false)
    private String departureDateStart;

    /**
     * 预定日期。
     */
    @TableField(exist = false)
    private Date orderDate;

    /**
     * departureDate 范围过滤结束值(<=)。
     */
    @TableField(exist = false)
    private String departureDateEnd;

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

    @RelationDict(
            masterIdField = "projectId",
            equalOneToOneRelationField = "tourismProject",
            slaveModelClass = TourismProject.class,
            slaveIdField = "id",
            slaveNameField = "projectTitle")
    @TableField(exist = false)
    private Map<String, Object> projectIdDictMap;

    @TableField(exist = false)
    private Date nowDate;
}
