package com.xinelu.manage.domain.sysarea;

import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
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 javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
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 BaseDomain implements Serializable {
    private static final long serialVersionUID = -7082314399349945860L;
    /**
     * 主键id
     */
    @NotNull(message = "主键id不能为空", groups = {Update.class})
    private Long id;

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

    /**
     * 区域编码
     */
    @ApiModelProperty(value = "区域编码")
    @Excel(name = "区域编码")
    @NotBlank(message = "区域编码不能为空", groups = {Insert.class, Update.class})
    private String areaCode;

    /**
     * 区域名称
     */
    @ApiModelProperty(value = "区域名称")
    @Excel(name = "区域名称")
    @NotBlank(message = "区域名称不能为空", groups = {Insert.class, Update.class})
    private String areaName;

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

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

    /**
     * 偏远地区标识，0：否，1：是
     */
    @ApiModelProperty(value = "偏远地区标识")
    @Excel(name = "偏远地区标识")
    @NotNull(message = "偏远地区标识不能为空", groups = {Insert.class, Update.class})
    private Integer remoteSigns;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    @Excel(name = "排序")
    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();
    }
}
