package com.yd.dal.entity.practitioner.hiring;

import com.google.common.base.Strings;
import com.yd.util.CommonUtil;

import java.util.Date;

/**
 * @author xxy
 */
public class HiringListInfo implements Comparable<HiringListInfo> {

    /**
     * 经纪人基本信息id
     */
    private Long hiringBasicInfoId;

    /**
     * 姓名
     */
    private String name;

    /**
     * 手机号
     */
    private String mobileNo;

    /**
     * 报聘职级
     */
    private String practitionerLevel;

    /**
     * 辅导人
     */
    private String mentor;

    /**
     * 申请日期
     */
    private String applicationTime;

    private Long s1PractitionerId;
    private Long s2PractitionerId;
    private Long s3PractitionerId;

    /**
     * 获取 经纪人基本信息id
     *
     * @return hiringBasicInfoId 经纪人基本信息id
     */
    public Long getHiringBasicInfoId() {
        return this.hiringBasicInfoId;
    }

    /**
     * 设置 经纪人基本信息id
     *
     * @param hiringBasicInfoId 经纪人基本信息id
     */
    public void setHiringBasicInfoId(Long hiringBasicInfoId) {
        this.hiringBasicInfoId = hiringBasicInfoId;
    }

    /**
     * 获取 姓名
     *
     * @return name 姓名
     */
    public String getName() {
        return this.name;
    }

    /**
     * 设置 姓名
     *
     * @param name 姓名
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取 手机号
     *
     * @return mobileNo 手机号
     */
    public String getMobileNo() {
        return this.mobileNo;
    }

    /**
     * 设置 手机号
     *
     * @param mobileNo 手机号
     */
    public void setMobileNo(String mobileNo) {
        this.mobileNo = mobileNo;
    }

    /**
     * 获取 报聘职级
     *
     * @return practitionerLevel 报聘职级
     */
    public String getPractitionerLevel() {
        return this.practitionerLevel;
    }

    /**
     * 设置 报聘职级
     *
     * @param practitionerLevel 报聘职级
     */
    public void setPractitionerLevel(String practitionerLevel) {
        this.practitionerLevel = practitionerLevel;
    }

    /**
     * 获取 辅导人
     *
     * @return mentor 辅导人
     */
    public String getMentor() {
        return this.mentor;
    }

    /**
     * 设置 辅导人
     *
     * @param mentor 辅导人
     */
    public void setMentor(String mentor) {
        this.mentor = mentor;
    }

    /**
     * 获取 申请日期
     *
     * @return applicationTime 申请日期
     */
    public String getApplicationTime() {
        return this.applicationTime;
    }

    /**
     * 设置 申请日期
     *
     * @param applicationTime 申请日期
     */
    public void setApplicationTime(String applicationTime) {
        this.applicationTime = applicationTime;
    }

    public Long getS1PractitionerId() {
        return s1PractitionerId;
    }

    public void setS1PractitionerId(Long s1PractitionerId) {
        this.s1PractitionerId = s1PractitionerId;
    }

    public Long getS2PractitionerId() {
        return s2PractitionerId;
    }

    public void setS2PractitionerId(Long s2PractitionerId) {
        this.s2PractitionerId = s2PractitionerId;
    }

    public Long getS3PractitionerId() {
        return s3PractitionerId;
    }

    public void setS3PractitionerId(Long s3PractitionerId) {
        this.s3PractitionerId = s3PractitionerId;
    }

    @Override
    public String toString() {
        return "HiringListInfo{" +
                "hiringBasicInfoId=" + hiringBasicInfoId +
                ", name='" + name + '\'' +
                ", mobileNo='" + mobileNo + '\'' +
                ", practitionerLevel='" + practitionerLevel + '\'' +
                ", mentor='" + mentor + '\'' +
                ", applicationTime='" + applicationTime + '\'' +
                '}';
    }

    public boolean equals(Object obj) {
        HiringListInfo u = (HiringListInfo) obj;
        return this.hiringBasicInfoId.equals(u.getHiringBasicInfoId());
    }

    public int hashCode() {
        Long in = this.hiringBasicInfoId;
        return in.hashCode();
    }

    @Override
    public int compareTo(HiringListInfo o) {
        String orderDate1 = o.getApplicationTime();
        if(!Strings.isNullOrEmpty(applicationTime) && !Strings.isNullOrEmpty(orderDate1)){
            Date orderDateDT = CommonUtil.stringParseDate(applicationTime,"yyyy-MM-dd HH:mm:ss");
            Date orderDate1DT = CommonUtil.stringParseDate(orderDate1,"yyyy-MM-dd HH:mm:ss");
            if(orderDate1DT != null && orderDateDT != null){
                return orderDate1DT.compareTo(orderDateDT);
            }else{
                return  0;
            }
        }else{
            return 0;
        }
    }
}
