package com.ynfy.buss.exam.userexam.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ynfy.buss.exam.userexamquestion.entity.UserExamQuestion;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @Description: 用户考试表
 * @Author: jeecg-boot
 * @Date: 2023-03-05
 * @Version: V1.0
 */
@Data
@TableName("user_exam")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "user_exam对象", description = "用户考试表")
public class UserExam implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
    /**
     * 用户ID
     */
    @Excel(name = "用户ID", width = 15)
    @ApiModelProperty(value = "用户ID")
    private String userId;
    /**
     * 考试id
     */
    @Excel(name = "考试id", width = 15)
    @ApiModelProperty(value = "考试id")
    private String examId;
    /**
     * 试卷id
     */
    @Excel(name = "试卷id", width = 15)
    @ApiModelProperty(value = "试卷id")
    private String paperId;
    /**
     * 用户时长
     */
    @Excel(name = "用户时长", width = 15)
    @ApiModelProperty(value = "用户时长")
    private Integer userTime;
    /**
     * 用户得分
     */
    @Excel(name = "用户得分", width = 15)
    @ApiModelProperty(value = "用户得分")
    private Integer userScore;
    /**
     * 交卷时间
     */
    @Excel(name = "交卷时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "交卷时间")
    private Date commitTime;
    /**
     * 状态
     */
    @Excel(name = "状态", width = 15)
    @ApiModelProperty(value = "状态")
    private Integer state;
    /**
     * 创建日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**
     * 更新日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private String createBy;

    /**
     * 截止时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "截止时间")
    private Date limitTime;

    /**
     * 及格分
     */
    @Excel(name = "及格分", width = 15)
    @ApiModelProperty(value = "及格分")
    private Integer qualifyScore;

    /**
     * 试卷总分
     */
    @Excel(name = "试卷总分", width = 15)
    @ApiModelProperty(value = "试卷总分")
    private Integer totalScore;

    /**
     * 是否通过
     */
    @Excel(name = "是否通过", width = 15)
    @ApiModelProperty(value = "是否通过")
    @Dict(dicCode = "exam_result")
    private Integer passed;

    /**
     * 是否有主观题
     */
    @Excel(name = "是否有主观题", width = 15)
    @ApiModelProperty(value = "是否有主观题")
    private Boolean hasSubjective;

    /**
     * 主观题得分
     */
    @Excel(name = "主观题得分", width = 15)
    @ApiModelProperty(value = "主观题得分")
    private Integer subjectiveScore;

    /**
     * 客观题得分
     */
    @Excel(name = "客观题得分", width = 15)
    @ApiModelProperty(value = "客观题得分")
    private Integer objectiveScore;

    /**
     * 阅卷人
     */
    @Excel(name = "阅卷人", width = 15)
    @ApiModelProperty(value = "阅卷人")
    private String previewUser;

    /**
     * 阅卷时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "阅卷时间")
    private Date previewTime;

    @TableField(exist = false)
    private List<UserExamQuestion> userExamQuestionList;

    @TableField(exist = false)
    private Boolean leaveOn;

    @TableField(exist = false)
    private Integer totalLeaveTimes;

    @ApiModelProperty(value = "考试结果展示类型 1：成绩 2：成绩+试卷明细")
    @TableField(exist = false)
    private Integer examResultShowtype;

    @ApiModelProperty(value = "展示截止时间")
    @TableField(exist = false)
    private Integer showDeadline;

    @TableField(exist = false)
    private Integer leaveTime;

    @TableField(exist = false)
    private String userName;

    @TableField(exist = false)
    private String realName;
}
