package com.zcloud.modules.oa.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
 * (OaDepartment)表实体类
 *
 * @author fangjiakai
 * @since 2023-10-17 14:08:59
 */
@Data
@TableName("oa_department")
public class OaDepartmentEntity implements Serializable,Comparable<OaDepartmentEntity> {
    private static final long serialVersionUID = 1L;
    //主键
    @TableId
    @ApiModelProperty(value = "主键")
    private String departmentId;
    //父ID
    @ApiModelProperty(value = "父ID")
    private String parentId;
    //所属企业
    @ApiModelProperty(value = "所属企业")
    private String corpinfoId;
    //名称
     @ApiModelProperty(value = "名称")
    private String name;
    //负责人
    @ApiModelProperty(value = "负责人")
    private String headman;
    //电话
    @ApiModelProperty(value = "电话")
    private String phone;
    @ApiModelProperty(value = "openid")
    private String openid;
    //部门级别
    @ApiModelProperty(value = "部门级别")
    private String level;
    //创建人
    @ApiModelProperty(value = "创建人")
    private String createor;
    //创建时间
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private String createTime;
    //修改人
    @ApiModelProperty(value = "修改人")
    private String operator;
    //修改时间
    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String operatTime;

     // 排序
    @ApiModelProperty(value = "排序")
    private Integer orderBy;
    //是否删除
    @TableLogic
    @ApiModelProperty(value = "是否删除")
    @TableField(fill = FieldFill.INSERT)
    private Integer isDelete;

    @Override
    public int compareTo(OaDepartmentEntity o) {
        return this.getOrderBy()-o.getOrderBy();
    }

    @TableField(exist=false)
    private List<OaDepartmentEntity> list=new ArrayList<>();
}

