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_record")
public class AttendanceRecord {

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

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

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

    @ApiModelProperty(value = "")
    @TableField("user_name")
    private String userName;

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

    /**
     * 校区id
     */
    @ApiModelProperty(value = "校区id")
    @TableField("campus_id")
    private Long campusId;

    /**
     * 校区id
     */
    @ApiModelProperty(value = "校区id")
    @TableField("campus_name")
    private String campusName;

    @ApiModelProperty(value = "年级id")
    @TableField("section_id")
    private Long sectionId;

    @ApiModelProperty(value = "年级id")
    @TableField("section_name")
    private String sectionName;

    /**
     * 年级id
     */
    @ApiModelProperty(value = "年级id")
    @TableField("grade_id")
    private Long gradeId;

    /**
     * 年级名称
     */
    @ApiModelProperty(value = "年级名称")
    @TableField("grade_name")
    private String gradeName;

    /**
     * 班级id
     */
    @ApiModelProperty(value = "班级id")
    @TableField("class_id")
    private Long classId;

    /**
     * 班级名称
     */
    @ApiModelProperty(value = "班级名称")
    @TableField("class_name")
    private String className;

    /**
     * 宿舍id
     */
    @ApiModelProperty(value = "宿舍id")
    @TableField("dorm_id")
    private Long dormId;

    /**
     * 宿舍名称
     */
    @ApiModelProperty(value = "宿舍名称")
    @TableField("dorm_name")
    private String dormName;

    /**
     * 考勤时宿舍-寝室id
     */
    @ApiModelProperty(value = "考勤时宿舍-寝室id")
    @TableField("dorm_room_id")
    private Long dormRoomId;

    /**
     * 考勤时宿舍-寝室名称
     */
    @ApiModelProperty(value = "考勤时宿舍-寝室名称")
    @TableField("dorm_room_name")
    private String dormRoomName;

    /**
     * 考勤设备id
     */
    @ApiModelProperty(value = "考勤设备id")
    @TableField("device_id")
    private Long deviceId;


    /**
     * 考勤设备Name
     */
    @ApiModelProperty(value = "考勤设备Name")
    @TableField("device_name")
    private String deviceName;


    /**
     * 考勤wifiid
     */
    @ApiModelProperty(value = "考勤wifiid")
    @TableField("wifi_id")
    private Long wifiId;


    /**
     * 考勤wifiName
     */
    @ApiModelProperty(value = "考勤wifiName")
    @TableField("wifi_name")
    private String wifiName;

    /**
     * 考勤范围ID
     */
    @ApiModelProperty(value = "考勤范围ID")
    @TableField("address_id")
    private Long addressId;

    /**
     * 范围名称
     */
    @ApiModelProperty(value = "范围名称")
    @TableField("address_name")
    private Long addressName;


    /**
     * 记录生成时间
     */
    @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("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("pic_url")
    private String picUrl;

    /**
     * 考勤结果，0-正常，1-异常
     */
    @ApiModelProperty(value = "考勤结果，0-正常，1-异常")
    @TableField("status")
    private Integer status;

    /**
     * 0-进，1-出
     */
    @ApiModelProperty(value = "0-进，1-出")
    @TableField("scope")
    private Integer scope;

    /**
     * 0-进，1-出
     */
    @ApiModelProperty(value = "0-校门，1-宿舍")
    @TableField("zone")
    private Integer zone;

    /**
     * 该次考勤比较的规则中正常考勤时间
     */
    @ApiModelProperty(value = "该次考勤比较的规则中正常考勤时间")
    @TableField("sti_time")
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "HH:mm:ss")
    private LocalTime stiTime;

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

    /**
     * 匹配的考勤时间id
     */
    @ApiModelProperty(value = "匹配的考勤时间id")
    @TableField("rule_time_id")
    private Long ruleTimeId;

    /**
     * 考勤时间段类型：0上班时间，1下班时间
     */
    @ApiModelProperty(value = "考勤时间段类型：0上班时间，1下班时间")
    @TableField("rule_time_type")
    private Integer ruleTimeType;

    /**
     * 设备侧元数据ID
     */
    @ApiModelProperty(value = "设备侧元数据ID")
    @TableField("original_record_id")
    private String originalRecordId;
}