package com.zcloud.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @TableName sys_dictionaries
 */
@Data
@TableName("sys_dictionaries")
public class SysDictionariesEntity implements Serializable,Comparable<SysDictionariesEntity> {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @TableId
    @ApiModelProperty(value = "主键")
    private String dictionariesId;

    /**
     * 父id
     */
    @ApiModelProperty(value = "父ID")
    private String parentId;

    /**
     * 名称
     */
    @ApiModelProperty(value = "字典名称")
    private String name;

    /**
     * 编码
     */
    @ApiModelProperty(value = "字典编码")
    private String bianma;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    private Integer orderBy;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String descr;

    //子集数量
    @TableField(exist=false)
    @ApiModelProperty(value = "子集数量")
    private Integer hasChildren;

    /**
     * ztree属性
     */
    @TableField(exist=false)
    @ApiModelProperty(value = "子集列表")
    private List<SysDictionariesEntity> list=new ArrayList<>();
    @Override
    public int compareTo(SysDictionariesEntity o) {
        return this.getOrderBy()-o.getOrderBy();
    }
}
