package com.qiaoba.api.system.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qiaoba.common.base.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 部门信息 sys_dept
 *
 * @author ailanyin
 * @version 1.0
 * @since 2022-09-22 04:20:28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_dept")
public class SysDept extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 部门ID
     */
    @TableId
    private String deptId;

    /**
     * 父部门ID
     */
    @NotBlank(message = "parentId不能为空")
    private String parentId;

    /**
     * 祖级列表
     */
    private String ancestors;

    /**
     * 部门名称
     */
    @NotBlank(message = "部门名称不能为空")
    @Size(max = 20, message = "部门名称最大长度: {max}")
    private String deptName;

    /**
     * 显示顺序
     */
    @Min(value = 1, message = "排序最小允许: {value}")
    @Max(value = Integer.MAX_VALUE, message = "排序最大允许: {value}")
    private Integer orderNum;

    /**
     * 负责人
     */
    @Size(max = 20, message = "负责人名称过长")
    private String leader;

    /**
     * 联系电话
     */
    @Size(max = 20, message = "手机号过长")
    private String phone;

    /**
     * 邮箱
     */
    @Size(max = 30, message = "邮箱号过长")
    private String email;

    /**
     * 部门状态:0停用,1正常
     */
    @NotBlank(message = "状态不能为空")
    private String status;

}
