package com.xinelu.manage.domain.sysarea;

import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;

/**
 * 区域对象 sys_area
 *
 * @author jihan
 * @date 2022-09-02
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "区域对象", description = "sys_area")
public class SysArea extends BaseEntity implements Serializable {
    private static final long serialVersionUID = -7082314399349945860L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 父级id
     */
    @ApiModelProperty(value = "父级id")
    private Long parentId;

    /**
     * 区域编码
     */
    @ApiModelProperty(value = "区域编码")
    private String areaCode;

    /**
     * 区域名称
     */
    @ApiModelProperty(value = "区域名称")
    private String areaName;

    /**
     * 区域级别
     */
    @ApiModelProperty(value = "区域级别")
    private Integer areaLevel;

    /**
     * 当前区域所属上级区域编码，即：父级区域编码
     */
    @ApiModelProperty(value = "当前区域所属上级区域编码")
    private String parentCode;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    private Long sort;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("parentId", getParentId())
                .append("areaCode", getAreaCode())
                .append("areaName", getAreaName())
                .append("areaLevel", getAreaLevel())
                .append("sort", getSort())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}