package com.ssm.manage.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@Table(name = "routing")
public class Routing implements Serializable {
    /**
     * 会员编码
     */
    @Id
    private Long id;

    /**
     * 会员名称
     */
    @Column(name = "member_name")
    private String memberName;

    /**
     * 操作、权限、类型
     */
    @Column(name = "type")
    private Long type;

    /**
     * 上级编号
     */
    @Column(name = "superior_id")
    private Long superiorId;

    /**
     * 上级名称
     */
    @Column(name = "superior_name")
    private String superiorName;

    /**
     * 路径
     */
    @Column(name = "path")
    private String path;

    /**
     * 建立人（用户名称（用户编码）），来源于员工档案
     */
    @Column(name = "founder_staff")
    private String founderStaff;

    /**
     * 建立时间
     */
    @Column(name = "founder_datetime")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date founderDatetime;

    /**
     * 最近修改人（用户名称（用户编码）），来源于员工档案
     */
    @Column(name = "modify_by")
    private String modifyBy;

    /**
     * 最近修改时间
     */
    @Column(name = "modify_datetime")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date modifyDatetime;

    /**
     *
     */
    @Column(name = "component")
    private String component;

    /**
     *
     */
    @Column(name = "path_index")
    private String pathIndex;


    //<getset>


    public String getPathIndex() {
        return pathIndex;
    }

    public void setPathIndex(String pathIndex) {
        this.pathIndex = pathIndex;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public Long getType() {
        return type;
    }

    public void setType(Long type) {
        this.type = type;
    }

    public Long getSuperiorId() {
        return superiorId;
    }

    public void setSuperiorId(Long superiorId) {
        this.superiorId = superiorId;
    }

    public String getSuperiorName() {
        return superiorName;
    }

    public void setSuperiorName(String superiorName) {
        this.superiorName = superiorName;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getFounderStaff() {
        return founderStaff;
    }

    public void setFounderStaff(String founderStaff) {
        this.founderStaff = founderStaff;
    }

    public Date getFounderDatetime() {
        return founderDatetime;
    }

    public void setFounderDatetime(Date founderDatetime) {
        this.founderDatetime = founderDatetime;
    }

    public String getModifyBy() {
        return modifyBy;
    }

    public void setModifyBy(String modifyBy) {
        this.modifyBy = modifyBy;
    }

    public Date getModifyDatetime() {
        return modifyDatetime;
    }

    public void setModifyDatetime(Date modifyDatetime) {
        this.modifyDatetime = modifyDatetime;
    }

    public String getComponent() {
        return component;
    }

    public void setComponent(String component) {
        this.component = component;
    }
    //</getset>


    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Routing other = (Routing) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getMemberName() == null ? other.getMemberName() == null : this.getMemberName().equals(other.getMemberName()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getSuperiorId() == null ? other.getSuperiorId() == null : this.getSuperiorId().equals(other.getSuperiorId()))
            && (this.getSuperiorName() == null ? other.getSuperiorName() == null : this.getSuperiorName().equals(other.getSuperiorName()))
            && (this.getPath() == null ? other.getPath() == null : this.getPath().equals(other.getPath()))
            && (this.getFounderStaff() == null ? other.getFounderStaff() == null : this.getFounderStaff().equals(other.getFounderStaff()))
            && (this.getFounderDatetime() == null ? other.getFounderDatetime() == null : this.getFounderDatetime().equals(other.getFounderDatetime()))
            && (this.getModifyBy() == null ? other.getModifyBy() == null : this.getModifyBy().equals(other.getModifyBy()))
            && (this.getModifyDatetime() == null ? other.getModifyDatetime() == null : this.getModifyDatetime().equals(other.getModifyDatetime()))
            && (this.getComponent() == null ? other.getComponent() == null : this.getComponent().equals(other.getComponent()))
            && (this.getPathIndex() == null ? other.getPathIndex() == null : this.getPathIndex().equals(other.getPathIndex()))
                ;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getMemberName() == null) ? 0 : getMemberName().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getSuperiorId() == null) ? 0 : getSuperiorId().hashCode());
        result = prime * result + ((getSuperiorName() == null) ? 0 : getSuperiorName().hashCode());
        result = prime * result + ((getPath() == null) ? 0 : getPath().hashCode());
        result = prime * result + ((getFounderStaff() == null) ? 0 : getFounderStaff().hashCode());
        result = prime * result + ((getFounderDatetime() == null) ? 0 : getFounderDatetime().hashCode());
        result = prime * result + ((getModifyBy() == null) ? 0 : getModifyBy().hashCode());
        result = prime * result + ((getModifyDatetime() == null) ? 0 : getModifyDatetime().hashCode());
        result = prime * result + ((getComponent() == null) ? 0 : getComponent().hashCode());
        result = prime * result + ((getPathIndex() == null) ? 0 : getPathIndex().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(", memberName=").append(memberName);
        sb.append(", type=").append(type);
        sb.append(", superiorId=").append(superiorId);
        sb.append(", superiorName=").append(superiorName);
        sb.append(", path=").append(path);
        sb.append(", founderStaff=").append(founderStaff);
        sb.append(", founderDatetime=").append(founderDatetime);
        sb.append(", modifyBy=").append(modifyBy);
        sb.append(", modifyDatetime=").append(modifyDatetime);
        sb.append(", component=").append(component);
        sb.append(", pathIndex=").append(pathIndex);
        sb.append("]");
        return sb.toString();
    }
}
