package cn.com.oa.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

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

/**
 * 考勤班别表
 * @TableName hr_attendance_shift_segment
 */
@TableName(value ="hr_attendance_shift_segment")
@Data
public class AttendanceShiftSegment implements Serializable {
    /**
     * 班别id
     */
    @TableId
    private Long segmentId;

    /**
     * 班别代码
     */
    private String segmentCode;

    /**
     * 班别名称
     */
    private String segmentName;

    /**
     * 考勤类型
     */
    private Long attTypeId;

    /**
     * 考勤规则id
     */
    private Long attRuleId;

    /**
     * 上班班段,每个班段用英文分号隔开,每个班段中的上下班时间用英文逗号隔开,如:08:30,12:00;14:00,18:00;
     */
    private String workTime;

    /**
     * 上班班段时长,每个班段时长用英文分号隔开,如:3.5;4.5;
     */
    private String intervalTime;

    /**
     * 班别颜色
     */
    private String segmentColer;

    /**
     * 工作日,英文逗号隔开1—7分别对应星期一到星期日
     */
    private String workDays;

    /**
     * 班别用途
     */
    private String segmentUse;

    /**
     * 班别状态,0:停用,1在用
     */
    private String segmentStatus;

    /**
     * 是否默认
     */
    private String isDefault;

    /**
     * 创建人
     */
    private Long createUser;

    /**
     * 创建时间
     */
    private Date createDate;

    /**
     * 公司id
     */
    private Long unitId;

    @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;
        }
        AttendanceShiftSegment other = (AttendanceShiftSegment) that;
        return (this.getSegmentId() == null ? other.getSegmentId() == null : this.getSegmentId().equals(other.getSegmentId()))
            && (this.getSegmentCode() == null ? other.getSegmentCode() == null : this.getSegmentCode().equals(other.getSegmentCode()))
            && (this.getSegmentName() == null ? other.getSegmentName() == null : this.getSegmentName().equals(other.getSegmentName()))
            && (this.getAttTypeId() == null ? other.getAttTypeId() == null : this.getAttTypeId().equals(other.getAttTypeId()))
            && (this.getAttRuleId() == null ? other.getAttRuleId() == null : this.getAttRuleId().equals(other.getAttRuleId()))
            && (this.getWorkTime() == null ? other.getWorkTime() == null : this.getWorkTime().equals(other.getWorkTime()))
            && (this.getIntervalTime() == null ? other.getIntervalTime() == null : this.getIntervalTime().equals(other.getIntervalTime()))
            && (this.getSegmentColer() == null ? other.getSegmentColer() == null : this.getSegmentColer().equals(other.getSegmentColer()))
            && (this.getWorkDays() == null ? other.getWorkDays() == null : this.getWorkDays().equals(other.getWorkDays()))
            && (this.getSegmentUse() == null ? other.getSegmentUse() == null : this.getSegmentUse().equals(other.getSegmentUse()))
            && (this.getSegmentStatus() == null ? other.getSegmentStatus() == null : this.getSegmentStatus().equals(other.getSegmentStatus()))
            && (this.getIsDefault() == null ? other.getIsDefault() == null : this.getIsDefault().equals(other.getIsDefault()))
            && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getUnitId() == null ? other.getUnitId() == null : this.getUnitId().equals(other.getUnitId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSegmentId() == null) ? 0 : getSegmentId().hashCode());
        result = prime * result + ((getSegmentCode() == null) ? 0 : getSegmentCode().hashCode());
        result = prime * result + ((getSegmentName() == null) ? 0 : getSegmentName().hashCode());
        result = prime * result + ((getAttTypeId() == null) ? 0 : getAttTypeId().hashCode());
        result = prime * result + ((getAttRuleId() == null) ? 0 : getAttRuleId().hashCode());
        result = prime * result + ((getWorkTime() == null) ? 0 : getWorkTime().hashCode());
        result = prime * result + ((getIntervalTime() == null) ? 0 : getIntervalTime().hashCode());
        result = prime * result + ((getSegmentColer() == null) ? 0 : getSegmentColer().hashCode());
        result = prime * result + ((getWorkDays() == null) ? 0 : getWorkDays().hashCode());
        result = prime * result + ((getSegmentUse() == null) ? 0 : getSegmentUse().hashCode());
        result = prime * result + ((getSegmentStatus() == null) ? 0 : getSegmentStatus().hashCode());
        result = prime * result + ((getIsDefault() == null) ? 0 : getIsDefault().hashCode());
        result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getUnitId() == null) ? 0 : getUnitId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", segmentId=").append(segmentId);
        sb.append(", segmentCode=").append(segmentCode);
        sb.append(", segmentName=").append(segmentName);
        sb.append(", attTypeId=").append(attTypeId);
        sb.append(", attRuleId=").append(attRuleId);
        sb.append(", workTime=").append(workTime);
        sb.append(", intervalTime=").append(intervalTime);
        sb.append(", segmentColer=").append(segmentColer);
        sb.append(", workDays=").append(workDays);
        sb.append(", segmentUse=").append(segmentUse);
        sb.append(", segmentStatus=").append(segmentStatus);
        sb.append(", isDefault=").append(isDefault);
        sb.append(", createUser=").append(createUser);
        sb.append(", createDate=").append(createDate);
        sb.append(", unitId=").append(unitId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}