package com.ssj.service.kmt.exercisesys.dto;

import com.alibaba.fastjson.annotation.JSONField;

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

/**
 * @author yrf
 * @time 2020/5/20 16:57
 */
public class DistributionTeacherDTO implements Serializable, Comparable<DistributionTeacherDTO> {

    private static final long serialVersionUID = -2974341943777847448L;

    private String teacherId;
    private String teacherName;
    private Integer salaryGiven;

    @JSONField(format = "yyyy.MM.dd")
    private Date salaryGivenTime;

    private Date lastSubmitTime;

    @JSONField(serialize = false)
    private Date createTime;

    public String getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(String teacherId) {
        this.teacherId = teacherId;
    }

    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    public Integer getSalaryGiven() {
        return salaryGiven;
    }

    public void setSalaryGiven(Integer salaryGiven) {
        this.salaryGiven = salaryGiven;
    }

    public Date getSalaryGivenTime() {
        return salaryGivenTime;
    }

    public void setSalaryGivenTime(Date salaryGivenTime) {
        this.salaryGivenTime = salaryGivenTime;
    }

    public Date getLastSubmitTime() {
        return lastSubmitTime;
    }

    public void setLastSubmitTime(Date lastSubmitTime) {
        this.lastSubmitTime = lastSubmitTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public int compareTo(DistributionTeacherDTO o) {
        if (this.createTime == null) {
            return -1;
        }
        if (o == null) {
            return -1;
        }
        if (this == o) {
            return 0;
        }
        if (o.getCreateTime() == null) {
            return 1;
        }
        if (o.getCreateTime().getTime() > this.getCreateTime().getTime()){
            return 1;
        } else if (o.getCreateTime().getTime() < this.getCreateTime().getTime()){
            return -1;
        } else{
            return 0;
        }
    }
}
