package com.mosty.common.core.business.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mosty.common.core.business.entity.vo.SysDeptVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
 * 部门表
 * @TableName sys_dept
 */
@TableName(value ="sys_dept")
@Data
public class SysDept implements Serializable {
    /**
     * 部门id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 部门代码
     */
    @TableField(value = "org_code")
    private String orgCode;

    /**
     * 部门名称
     */
    @TableField(value = "org_name")
    private String orgName;

    /**
     * 根节点开始的id路径
     */
    @TableField(value = "root_path")
    private String rootPath;

    /**
     * 部门类型
     */
    @TableField(value = "org_type")
    private String orgType;

    /**
     * 部门等级
     */
    @TableField(value = "org_level")
    private String orgLevel;

    /**
     * 部门业务类型
     */
    @TableField(value = "org_biz_type")
    private String orgBizType;

    /**
     * 部门顺序号
     */
    @TableField(value = "org_no")
    private String orgNo;

    /**
     * 上级部门主键
     */
    @TableField(value = "parent_id")
    private Long parentId;

    /**
     * 部门名称拼音首字母
     */
    @TableField(value = "bmpyszm")
    private String bmpyszm;

    /**
     * 部门简称
     */
    @TableField(value = "org_jc")
    private String orgJc;

    /**
     * 部门全称
     */
    @TableField(value = "org_qc")
    private String orgQc;

    /**
     * 部门地址
     */
    @TableField(value = "address")
    private String address;

    /**
     * 部门电话
     */
    @TableField(value = "link_tel")
    private String linkTel;

    /**
     * 部门联系人
     */
    @TableField(value = "link_man")
    private String linkMan;

    /**
     * 部门联系人电话
     */
    @TableField(value = "link_man_tel")
    private String linkManTel;

    /**
     * 部门主页
     */
    @TableField(value = "web_url")
    private String webUrl;

    /**
     * 部门邮箱
     */
    @TableField(value = "email")
    private String email;

    /**
     * 部门所属行政区划
     */
    @TableField(value = "xzqh")
    private String xzqh;

    /**
     * 备注
     */
    @TableField(value = "bz")
    private String bz;

    /**
     * 注销标志0正常 1.注销
     */
    @TableField(value = "xt_zxbz")
    private Integer xtZxbz;

    /**
     * 注销原因
     */
    @TableField(value = "xt_zxyy")
    private String xtZxyy;

    /**
     * 采集时间
     */
    @TableField(value = "xt_cjsj")
    private Date xtCjsj;

    /**
     * 录入时间
     */
    @TableField(value = "xt_lrsj")
    private Date xtLrsj;

    /**
     * 录入人姓名
     */
    @TableField(value = "xt_lrrxm")
    private String xtLrrxm;

    /**
     * 录入人id
     */
    @TableField(value = "xt_lrrid")
    private Long xtLrrid;

    /**
     * 录入人部门
     */
    @TableField(value = "xt_lrrbm")
    private String xtLrrbm;

    /**
     * 录入人部门id
     */
    @TableField(value = "xt_lrrbmid")
    private String xtLrrbmid;

    /**
     * 录入人部门id
     */
    @TableField(value = "xt_lrip")
    private String xtLrip;

    /**
     * 最后修改时间
     */
    @TableField(value = "xt_zhxgsj")
    private Date xtZhxgsj;

    /**
     * 最后修改人姓名
     */
    @TableField(value = "xt_zhxgrxm")
    private String xtZhxgrxm;

    /**
     * 最后修改人id
     */
    @TableField(value = "xt_zhxgid")
    private Long xtZhxgid;

    /**
     * 最后修改人部门
     */
    @TableField(value = "xt_zhxgrbm")
    private String xtZhxgrbm;

    /**
     * 最后修改人部门id
     */
    @TableField(value = "xt_zhxgrbmid")
    private Long xtZhxgrbmid;

    /**
     * 最后修改人ip
     */
    @TableField(value = "xt_zhxgrip")
    private String xtZhxgrip;

    /**
     * 子部门集合
     */
    @ApiModelProperty(value = "子部门集合")
    @TableField(exist = false)
    private List<SysDept> childDeptList;

    /**
     * 是否包含下级
     */
    @ApiModelProperty(value = "是否包含下级")
    @TableField(exist = false)
    private boolean hasChildren;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysDept other = (SysDept) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getOrgCode() == null ? other.getOrgCode() == null : this.getOrgCode().equals(other.getOrgCode()))
                && (this.getOrgName() == null ? other.getOrgName() == null : this.getOrgName().equals(other.getOrgName()))
                && (this.getOrgType() == null ? other.getOrgType() == null : this.getOrgType().equals(other.getOrgType()))
                && (this.getOrgLevel() == null ? other.getOrgLevel() == null : this.getOrgLevel().equals(other.getOrgLevel()))
                && (this.getOrgBizType() == null ? other.getOrgBizType() == null : this.getOrgBizType().equals(other.getOrgBizType()))
                && (this.getOrgNo() == null ? other.getOrgNo() == null : this.getOrgNo().equals(other.getOrgNo()))
                && (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
                && (this.getBmpyszm() == null ? other.getBmpyszm() == null : this.getBmpyszm().equals(other.getBmpyszm()))
                && (this.getOrgJc() == null ? other.getOrgJc() == null : this.getOrgJc().equals(other.getOrgJc()))
                && (this.getOrgQc() == null ? other.getOrgQc() == null : this.getOrgQc().equals(other.getOrgQc()))
                && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
                && (this.getLinkTel() == null ? other.getLinkTel() == null : this.getLinkTel().equals(other.getLinkTel()))
                && (this.getLinkMan() == null ? other.getLinkMan() == null : this.getLinkMan().equals(other.getLinkMan()))
                && (this.getLinkManTel() == null ? other.getLinkManTel() == null : this.getLinkManTel().equals(other.getLinkManTel()))
                && (this.getWebUrl() == null ? other.getWebUrl() == null : this.getWebUrl().equals(other.getWebUrl()))
                && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
                && (this.getXzqh() == null ? other.getXzqh() == null : this.getXzqh().equals(other.getXzqh()))
                && (this.getBz() == null ? other.getBz() == null : this.getBz().equals(other.getBz()))
                && (this.getXtZxbz() == null ? other.getXtZxbz() == null : this.getXtZxbz().equals(other.getXtZxbz()))
                && (this.getXtZxyy() == null ? other.getXtZxyy() == null : this.getXtZxyy().equals(other.getXtZxyy()))
                && (this.getXtCjsj() == null ? other.getXtCjsj() == null : this.getXtCjsj().equals(other.getXtCjsj()))
                && (this.getXtLrsj() == null ? other.getXtLrsj() == null : this.getXtLrsj().equals(other.getXtLrsj()))
                && (this.getXtLrrxm() == null ? other.getXtLrrxm() == null : this.getXtLrrxm().equals(other.getXtLrrxm()))
                && (this.getXtLrrid() == null ? other.getXtLrrid() == null : this.getXtLrrid().equals(other.getXtLrrid()))
                && (this.getXtLrrbm() == null ? other.getXtLrrbm() == null : this.getXtLrrbm().equals(other.getXtLrrbm()))
                && (this.getXtLrrbmid() == null ? other.getXtLrrbmid() == null : this.getXtLrrbmid().equals(other.getXtLrrbmid()))
                && (this.getXtLrip() == null ? other.getXtLrip() == null : this.getXtLrip().equals(other.getXtLrip()))
                && (this.getXtZhxgsj() == null ? other.getXtZhxgsj() == null : this.getXtZhxgsj().equals(other.getXtZhxgsj()))
                && (this.getXtZhxgrxm() == null ? other.getXtZhxgrxm() == null : this.getXtZhxgrxm().equals(other.getXtZhxgrxm()))
                && (this.getXtZhxgid() == null ? other.getXtZhxgid() == null : this.getXtZhxgid().equals(other.getXtZhxgid()))
                && (this.getXtZhxgrbm() == null ? other.getXtZhxgrbm() == null : this.getXtZhxgrbm().equals(other.getXtZhxgrbm()))
                && (this.getXtZhxgrbmid() == null ? other.getXtZhxgrbmid() == null : this.getXtZhxgrbmid().equals(other.getXtZhxgrbmid()))
                && (this.getXtZhxgrip() == null ? other.getXtZhxgrip() == null : this.getXtZhxgrip().equals(other.getXtZhxgrip()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getOrgCode() == null) ? 0 : getOrgCode().hashCode());
        result = prime * result + ((getOrgName() == null) ? 0 : getOrgName().hashCode());
        result = prime * result + ((getOrgType() == null) ? 0 : getOrgType().hashCode());
        result = prime * result + ((getOrgLevel() == null) ? 0 : getOrgLevel().hashCode());
        result = prime * result + ((getOrgBizType() == null) ? 0 : getOrgBizType().hashCode());
        result = prime * result + ((getOrgNo() == null) ? 0 : getOrgNo().hashCode());
        result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode());
        result = prime * result + ((getBmpyszm() == null) ? 0 : getBmpyszm().hashCode());
        result = prime * result + ((getOrgJc() == null) ? 0 : getOrgJc().hashCode());
        result = prime * result + ((getOrgQc() == null) ? 0 : getOrgQc().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getLinkTel() == null) ? 0 : getLinkTel().hashCode());
        result = prime * result + ((getLinkMan() == null) ? 0 : getLinkMan().hashCode());
        result = prime * result + ((getLinkManTel() == null) ? 0 : getLinkManTel().hashCode());
        result = prime * result + ((getWebUrl() == null) ? 0 : getWebUrl().hashCode());
        result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
        result = prime * result + ((getXzqh() == null) ? 0 : getXzqh().hashCode());
        result = prime * result + ((getBz() == null) ? 0 : getBz().hashCode());
        result = prime * result + ((getXtZxbz() == null) ? 0 : getXtZxbz().hashCode());
        result = prime * result + ((getXtZxyy() == null) ? 0 : getXtZxyy().hashCode());
        result = prime * result + ((getXtCjsj() == null) ? 0 : getXtCjsj().hashCode());
        result = prime * result + ((getXtLrsj() == null) ? 0 : getXtLrsj().hashCode());
        result = prime * result + ((getXtLrrxm() == null) ? 0 : getXtLrrxm().hashCode());
        result = prime * result + ((getXtLrrid() == null) ? 0 : getXtLrrid().hashCode());
        result = prime * result + ((getXtLrrbm() == null) ? 0 : getXtLrrbm().hashCode());
        result = prime * result + ((getXtLrrbmid() == null) ? 0 : getXtLrrbmid().hashCode());
        result = prime * result + ((getXtLrip() == null) ? 0 : getXtLrip().hashCode());
        result = prime * result + ((getXtZhxgsj() == null) ? 0 : getXtZhxgsj().hashCode());
        result = prime * result + ((getXtZhxgrxm() == null) ? 0 : getXtZhxgrxm().hashCode());
        result = prime * result + ((getXtZhxgid() == null) ? 0 : getXtZhxgid().hashCode());
        result = prime * result + ((getXtZhxgrbm() == null) ? 0 : getXtZhxgrbm().hashCode());
        result = prime * result + ((getXtZhxgrbmid() == null) ? 0 : getXtZhxgrbmid().hashCode());
        result = prime * result + ((getXtZhxgrip() == null) ? 0 : getXtZhxgrip().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", orgCode=").append(orgCode);
        sb.append(", orgName=").append(orgName);
        sb.append(", orgType=").append(orgType);
        sb.append(", orgLevel=").append(orgLevel);
        sb.append(", orgBizType=").append(orgBizType);
        sb.append(", orgNo=").append(orgNo);
        sb.append(", parentId=").append(parentId);
        sb.append(", bmpyszm=").append(bmpyszm);
        sb.append(", orgJc=").append(orgJc);
        sb.append(", orgQc=").append(orgQc);
        sb.append(", address=").append(address);
        sb.append(", linkTel=").append(linkTel);
        sb.append(", linkMan=").append(linkMan);
        sb.append(", linkManTel=").append(linkManTel);
        sb.append(", webUrl=").append(webUrl);
        sb.append(", email=").append(email);
        sb.append(", xzqh=").append(xzqh);
        sb.append(", bz=").append(bz);
        sb.append(", xtZxbz=").append(xtZxbz);
        sb.append(", xtZxyy=").append(xtZxyy);
        sb.append(", xtCjsj=").append(xtCjsj);
        sb.append(", xtLrsj=").append(xtLrsj);
        sb.append(", xtLrrxm=").append(xtLrrxm);
        sb.append(", xtLrrid=").append(xtLrrid);
        sb.append(", xtLrrbm=").append(xtLrrbm);
        sb.append(", xtLrrbmid=").append(xtLrrbmid);
        sb.append(", xtLrip=").append(xtLrip);
        sb.append(", xtZhxgsj=").append(xtZhxgsj);
        sb.append(", xtZhxgrxm=").append(xtZhxgrxm);
        sb.append(", xtZhxgid=").append(xtZhxgid);
        sb.append(", xtZhxgrbm=").append(xtZhxgrbm);
        sb.append(", xtZhxgrbmid=").append(xtZhxgrbmid);
        sb.append(", xtZhxgrip=").append(xtZhxgrip);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}