package com.ssm.manage.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * 打卡记录 (SQL 视图)
 */
@Table(name = "clock_in_record")
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class ClockInRecord {
    @Id
    @Column(name = "id")
    private Long id;

    /**
     * 员工 ID
     * <p>
     *     {@link StaffTemporary#getId()} 的外键，外键是通过 SQL 视图查询生成的，并不一定准确
     * </p>
     */
    @Column(name = "staff_id")
    @ApiModelProperty(name = "staffId", value = "员工 ID")
    private Long staffId;

    /**
     * 黑名单 ID
     * <p>
     *     {@link BlackList#getId()} 的外键
     * </p>
     */
    @Column(name = "black_id")
    @ApiModelProperty(name = "blackId", value = "黑名单 ID")
    private Long blackId;

    /**
     * 员工名字
     */
    @Column(name = "staff_name")
    @ApiModelProperty(name = "staffName", value = "员工名字")
    private String staffName;

    /**
     * 员工编码
     */
    @Column(name = "staff_num")
    @ApiModelProperty(name = "staffNum", value = "员工编码")
    private String staffNum;

    /**
     * 性别 0男/1女
     */
    @Column(name = "sex")
    @ApiModelProperty(name = "sex", value = "性别 0男/1女")
    private Integer sex;

    /**
     * 手机号
     */
    @Column(name = "mobile_phone")
    @ApiModelProperty(name = "mobilePhone", value = "手机号")
    private String mobilePhone;

    /**
     * 身份证
     */
    @Column(name = "identity_card")
    @ApiModelProperty(name = "identityCard", value = "身份证")
    private String identityCard;

    /**
     * 上班打卡时间
     */
    @Column(name = "clock_in_time")
    @ApiModelProperty(name = "clockInTime", value = "上班打卡时间")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date clockInTime;

    /**
     * 下班打卡时间
     */
    @Column(name = "clock_in_after_time")
    @ApiModelProperty(name = "clock_in_after_time", value = "下班打卡时间")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date clockInAfterTime;

    /**
     * 企业ID
     */
    @Column(name = "store_id")
    @ApiModelProperty(name = "storeId", value = "企业ID")
    private Long storeId;

    /**
     * 部门编码
     */
    @Column(name = "dept_num")
    @ApiModelProperty(name = "deptNum", value = "部门编码")
    private String deptNum;

    /**
     * 部门名称
     */
    @Column(name = "dept_name")
    @ApiModelProperty(name = "deptName", value = "部门名称")
    private String deptName;

    /**
     * 设备编码
     */
    @Column(name = "equipment_num")
    @ApiModelProperty(name = "equipmentNum", value = "设备编码")
    private String equipmentNum;

    /**
     * 设备名称
     */
    @Column(name = "equipment_name")
    @ApiModelProperty(name = "equipmentName", value = "设备名称")
    private String equipmentName;

    /**
     * 验证方式
     */
    @Column(name = "verify")
    @ApiModelProperty(name = "verify", value = "验证方式")
    private String verify;

    /**
     * 是否推送北森
     */
    @Column(name = "is_send_beisen")
    @ApiModelProperty(name = "isBeisen", value = "是否推送北森")
    private Boolean isSendBeisen;
}
