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.util.Date;
import java.util.Map;

/**
 * 开团申请列表实体对象。
 *
 * @author 吃饭睡觉
 * @date 2024-09-06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "tour_project_group_purchase_apply")
public class TourProjectGroupPurchaseApply extends BaseModel {

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

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

    /**
     * 用户Id。
     */
    @TableField(value = "tour_user_id")
    private Long tourUserId;

    /**
     * 申请时间。
     */
    @TableField(value = "apply_time")
    private Date applyTime;

    /**
     * 是否处理(0:未处理 1:已处理)。
     */
    @TableField(value = "is_handle")
    private Integer isHandle;

    /**
     * 备注。
     */
    @TableField(value = "remark")
    private String remark;

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

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

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

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

    @RelationOneToOne(
            masterIdField = "tourUserId",
            slaveModelClass = TourUser.class,
            slaveIdField = "userId")
    @TableField(exist = false)
    private TourUser tourUser;

    @RelationGlobalDict(
            masterIdField = "isHandle",
            dictCode = "IsHandle")
    @TableField(exist = false)
    private Map<String, Object> isHandleDictMap;
}
