package com.yida.data.common.core.entity.attendance;

import com.baomidou.mybatisplus.annotation.FieldFill;
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.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.time.LocalTime;

/**
 * 教职工考勤-考勤结果 Entity
 *
 * @author ZYJ
 * @date 2021-09-27 18:56:23
 */
@Data
@TableName("edu_attendance_staff_result")
public class EduAttendanceStaffResult {

    /**
     *
     */
    @ApiModelProperty(value = "")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    @TableField("staff_id")
    private Long staffId;

    /**
     * 学校id
     */
    @ApiModelProperty(value = "学校id")
    @TableField("school_id")
    private Long schoolId;

    /**
     * 考勤规则id
     */
    @ApiModelProperty(value = "考勤规则id")
    @TableField("rule_id")
    private Long ruleId;

    /**
     * 考勤规则时间段id
     */
    @ApiModelProperty(value = "考勤规则时间段id")
    @TableField("rule_time_id")
    private Long ruleTimeId;

    /**
     * 考勤结果，0-正常，1-迟到，2-早退,3-旷工，4-迟到早退，5-上班未在打卡时间段，6-下班未在打卡时间段
     */
    @ApiModelProperty(value = "考勤结果，0-正常，1-迟到，2-早退,3-旷工，4-迟到早退，5-上班未在打卡时间段，6-下班未在打卡时间段,7-上班未在打卡时间段|早退，8-上班迟到|下班未打卡")
    @TableField("status")
    private Integer status;

    /**
     * 上班考勤状态 0 正常 1 异常
     */
    @TableField("start_status")
    private Integer startStatus;
    /**
     * 下班考勤状态 0 正常 1 异常
     */
    @TableField("end_status")
    private Integer endStatus;

    /**
     * 考勤日期
     */
    @ApiModelProperty(value = "考勤日期")
    @TableField("attendance_date")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private LocalDate attendanceDate;

    @ApiModelProperty("上班因打卡时间")
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "HH:mm:ss")
    private LocalTime startStiTime;

    @ApiModelProperty("上班实际打卡时间")
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "HH:mm:ss")
    private LocalTime startRealTime;

    @ApiModelProperty("下班应打卡时间")
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "HH:mm:ss")
    private LocalTime endStiTime;

    @ApiModelProperty("下班实际打卡时间")
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "HH:mm:ss")
    private LocalTime endRealTime;

    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
