package com.tourism.webadmin.back.model;

import com.baomidou.mybatisplus.annotation.*;
import com.tourism.webadmin.back.model.constant.Enable;
import com.tourism.webadmin.back.model.constant.Hotspot;
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_area_menu")
public class TourHouseAreaMenu extends BaseModel {

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

    /**
     * 父级id。
     */
    @TableField(value = "parent_id")
    private Long parentId;

    /**
     * 菜单等级。
     */
    @TableField(value = "level_num")
    private Integer levelNum;

    /**
     * 菜单名称。
     */
    @TableField(value = "level_name")
    private String levelName;

    /**
     * 显示顺序。
     */
    @TableField(value = "show_order")
    private Integer showOrder;

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

    /**
     * 租售类型：0：出售 1：租赁。
     */
    @TableField(value = "type")
    private Integer type;

    /**
     * 是否热点，0非热点，1热点。
     */
    @TableField(value = "is_hotspot")
    private Integer isHotspot;

    /**
     * 热门排序。
     */
    @TableField(value = "hot_order")
    private Integer hotOrder;

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

    @RelationDict(
            masterIdField = "parentId",
            slaveModelClass = TourHouseAreaMenu.class,
            slaveIdField = "id",
            slaveNameField = "levelName")
    @TableField(exist = false)
    private Map<String, Object> parentIdDictMap;

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

    @RelationConstDict(
            masterIdField = "isHotspot",
            constantDictClass = Hotspot.class)
    @TableField(exist = false)
    private Map<String, Object> isHotspotDictMap;

    @RelationGlobalDict(
            masterIdField = "levelNum",
            dictCode = "HouseAreaLevelNum")
    @TableField(exist = false)
    private Map<String, Object> levelNumDictMap;

    @RelationGlobalDict(
            masterIdField = "type",
            dictCode = "IsSaleOrRent")
    @TableField(exist = false)
    private Map<String, Object> typeDictMap;
}
