package com.storlead.user.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.storlead.framework.mybatis.entity.SysBaseField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * <p>
 * 部门表
 * <p>
 *
 * @Author Steve
 * @Since  2019-01-22
 */
@Data
@TableName("dept")
public class DeptEntity extends SysBaseField {
    private static final long serialVersionUID = 1L;

	/**ID*/
	@TableId(type = IdType.INPUT)
	private Long id;

	@ApiModelProperty(value = "部门名称")
	private String name;

	@ApiModelProperty(value = "所属公司id")
	private Long companyId;

	@ApiModelProperty(value = "子公司")
	private Long subCompanyId;

	@ApiModelProperty(value = "父机构ID")
	private Long pid;

	@ApiModelProperty(value = "部门领导")
	private Long managerId;

	@ApiModelProperty(value = "部门分管领导")
	private String subManagerIds;

	@ApiModelProperty(value = "路由code")
	private String routeCode;

	@ApiModelProperty(value = "数据来源")
	private Integer dataSource;

	@ApiModelProperty(value = "部门负责人")
	private String leaderName;

	@ApiModelProperty(value = "部门路由名称")
	private String deptNameRoute;

	@ApiModelProperty(value = "部门岗位职责")
	private String deptJobDes;

	/**
	 * 重写equals方法
	 */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
			return true;
		}
        if (o == null || getClass() != o.getClass()) {
			return false;
		}
        if (!super.equals(o)) {
			return false;
		}
        DeptEntity depart = (DeptEntity) o;
        return Objects.equals(id, depart.id) &&
                Objects.equals(pid, depart.pid) &&
				Objects.equals(name, depart.name) &&
				Objects.equals(subCompanyId, depart.subCompanyId);
    }

    /**
     * 重写hashCode方法
     */
    @Override
    public int hashCode() {

        return Objects.hash(super.hashCode(), id, pid, name,
				subCompanyId);
    }
}
