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

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

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

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

@Data
@ApiModel("考勤记录实体")
public class EduAttendanceRecord {

    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("用户id")
    private Long studentId;

    @ApiModelProperty("学校id")
    private Long schoolId;

    private Long campusId;

    private Long gradeId;

    private String gradeName;

    private Long classId;

    private String className;

    @ApiModelProperty("0上学，1宿舍")
    private Integer type;

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

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

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

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

    @ApiModelProperty("设备id")
    private Long deviceId;

    @ApiModelProperty("进出时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty("创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;

    @ApiModelProperty("图片url")
    private String picUrl;

    @ApiModelProperty("考勤结果，-1-宿管添加的考勤记录，0-正常，1-迟到，10-上学未在打卡时间段,2-早退，20-下学未在打卡时间段，3-未到,4-晚归，5-异常晚归，6-旷宿")
    private Integer status;

    @ApiModelProperty("0-进，1-出")
    private Integer scope;

    @ApiModelProperty("考勤类型，0-校门，1-宿舍")
    private Integer zone;

    @ApiModelProperty("正常时间")
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "HH:mm:ss")
    private LocalTime stiTime;

    @ApiModelProperty("规则id")
    private Long ruleId;

    @ApiModelProperty("该条记录使用的考勤时间段")
    private Long ruleTimeId;

    @ApiModelProperty("考勤时间段类型：0开始时间，1结束时间")
    private Integer ruleTimeType;

    private transient String deviceName;
}
