package com.tourism.webadmin.back.model;

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

import java.util.Map;

/**
 * 开发商分类管理实体对象。
 *
 * @author 吃饭睡觉
 * @date 2024-09-06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "tour_house_developers_type")
public class TourHouseDevelopersType extends BaseModel {

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

    /**
     * 开发商名称。
     */
    @TableField(value = "name")
    private String name;

    /**
     * 是否启用，0禁用，1启用。
     */
    @TableField(value = "enable")
    private Integer enable;

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

    @RelationDict(
            masterIdField = "id",
            slaveModelClass = TourHouseDevelopersType.class,
            slaveIdField = "id",
            slaveNameField = "name")
    @TableField(exist = false)
    private Map<String, Object> idDictMap;

    @RelationConstDict(
            masterIdField = "enable",
            constantDictClass = Enable.class)
    @TableField(exist = false)
    private Map<String, Object> enableDictMap;
}
