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

import java.util.Date;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;

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

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

/**
 * @date 2023-08-09 11:37:25
 */
@Data
@TableName("attendance_result")
public class AttendanceResult {

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

    /**
     * 0-固定上下班时间模式，1自由打卡模式
     */
    @ApiModelProperty(value = "0-固定上下班时间模式，1自由打卡模式")
    @TableField("att_type")
    private Integer attType;

    /**
     *
     */
    @ApiModelProperty(value = "")
    @TableField("user_type")
    private Integer userType;

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

    /**
     * 学校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缺卡
     */
    @ApiModelProperty(value = "考勤结果，0-正常，1-迟到，2-早退,3-旷工，4-迟到早退，5缺卡,6请假,7晚归，8异常晚归")
    @TableField("status")
    private Integer status;

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

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

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

    /**
     * 上班考勤结果
     */
    @ApiModelProperty(value = "上班考勤结果")
    @TableField("start_status")
    private Integer startStatus;


    /**
     * 迟到分钟数
     */
    @ApiModelProperty(value = "迟到分钟数")
    @TableField("start_late_time")
    private Long startLateTime;

    /**
     * 上班打卡照片
     */
    @ApiModelProperty(value = "上班打卡照片")
    @TableField("start_pic_url")
    private String startPicUrl;

    /**
     * 早退分钟数
     */
    @ApiModelProperty(value = "早退分钟数")
    @TableField("end_leave_time")
    private Long endLeaveTime;

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

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

    /**
     * 下班考勤结果
     */
    @ApiModelProperty(value = "下班考勤结果")
    @TableField("end_status")
    private Integer endStatus;


    /**
     * 下班打卡照片
     */
    @ApiModelProperty(value = "下班打卡照片")
    @TableField("end_pic_url")
    private String endPicUrl;

    /**
     *
     */
    @ApiModelProperty(value = "")
    @TableField("create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     *
     */
    @ApiModelProperty(value = "")
    @TableField("update_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;


    private transient String campusName;
    private transient String sectionName;
    private transient String gradeName;
    private transient String className;

}