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

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

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

/**
 * 考勤结果 Entity
 *
 * @author wjm
 * @date 2021-09-15 09:56:24
 */
@Data
@TableName("edu_attendance_result")
public class EduAttendanceResult {

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

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

    /**
     *
     */
    @ApiModelProperty(value = "")
    @TableField(value = "create_id", fill = FieldFill.INSERT)
    private Long createId;

    /**
     *
     */
    @ApiModelProperty(value = "")
    @TableField(value = "update_date", fill = FieldFill.UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateDate;

    /**
     *
     */
    @ApiModelProperty(value = "")
    @TableField(value = "update_id", fill = FieldFill.UPDATE)
    private Long updateId;

    /**
     *
     */
    @ApiModelProperty(value = "")
    private Long studentId;

    @ApiModelProperty(value = "宿舍id")
    private Long dormId;

    @ApiModelProperty("宿舍名称")
    private String dormName;

    @ApiModelProperty(value = "寝室id")
    private Long dormRoomId;

    @ApiModelProperty("寝室名称")
    private String dormRoomName;

    private Long schoolId;

    private Long campusId;

    private Long gradeId;

    private String gradeName;

    private Long classId;

    private String className;

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

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

    @ApiModelProperty(value = "产生该结果的第一条进出记录")
    @TableField("record_id")
    private Long recordId;
    /**
     * 考勤结果，100-正常， 201-迟到，202-早退，203-迟到早退，204-旷课,205-请假, 211-晚归，212-异常晚归，213-旷宿，214-已被核查但学生还未归寝
     */
    @ApiModelProperty(value = "考勤结果，100-正常，201-迟到，202-早退，203-迟到早退，204-旷课,205-请假,206-上班未打卡|下班正常,207-上班未打卡|下班早退,208-上班未打卡|下班未在有效打卡时间段内,209-上班未在有效打卡时间段内|下班早退,210-上班迟到|下班未打卡,211-晚归，212-异常晚归，213-旷宿，214-已被核查但学生还未归寝")
    @TableField("status")
    private Integer status;
    @ApiModelProperty(value = "开始时间考勤结果1正常，0异常，空未打卡")
    @TableField("begin_status")
    private Integer beginStatus;
    @ApiModelProperty(value = "结束时间考勤结果1正常，0异常，空未打卡")
    @TableField("end_status")
    private Integer endStatus;

    /**
     * 核查时间
     */
    @ApiModelProperty(value = "核查时间")
    @TableField("verify_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime verifyTime;

    /**
     * 核查人
     */
    @ApiModelProperty(value = "核查人")
    @TableField("verify_id")
    private Long verifyId;

    /**
     * 核查状态，0-未核查，1-已核查
     */
    @ApiModelProperty(value = "核查状态，0-未核查，1-已核查")
    @TableField("verify_status")
    private Integer verifyStatus;

    @ApiModelProperty("考勤日期")
    @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 inTime;

    @ApiModelProperty("未到记录是否确认,0-否，1-是")
    private Integer notArriveConfirm;

    @ApiModelProperty("上一次推送时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastPushTime;

    @ApiModelProperty("推送状态. 0: 未推送, 1: 已推送")
    private String pushStatus;

    @ApiModelProperty("学生姓名")
    private transient String stuName;

    @ApiModelProperty("头像")
    private transient String picUrl;

    @ApiModelProperty("学号")
    private transient String stuNo;

    @ApiModelProperty("类型:1宿舍考勤，0上学考勤")
    private transient Integer type;
}
