package com.qmth.teachcloud.report.business.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.teachcloud.common.contant.SystemConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Objects;

/**
 * <p>
 * 基础考生作答记录详情表
 * </p>
 *
 * @author wangliang
 * @since 2021-06-01
 */
@ApiModel(value = "TBAnswer对象", description = "基础考生作答记录详情表")
public class TBAnswer implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "考生作答记录详情id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id")
    private Long id;

    @ApiModelProperty(value = "考试记录id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "exam_record_id")
    private Long examRecordId;

    @ApiModelProperty(value = "题号类型（客观题、主观题）")
    @TableField(value = "number_type")
    private String numberType;

    @ApiModelProperty(value = "大题号")
    @TableField(value = "main_number")
    private String mainNumber;

    @ApiModelProperty(value = "小题号")
    @TableField(value = "sub_number")
    private String subNumber;

    @ApiModelProperty(value = "考生作答答案")
    @TableField(value = "answer")
    private String answer;

    @ApiModelProperty(value = "分数")
    @TableField(value = "score")
    private BigDecimal score;

    @ApiModelProperty(value = "作答轨迹")
    @TableField(value = "path")
    private String path;

    @ApiModelProperty(value = "作答时间")
    @TableField(value = "time")
    private Long time;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getExamRecordId() {
        return examRecordId;
    }

    public void setExamRecordId(Long examRecordId) {
        this.examRecordId = examRecordId;
    }

    public String getNumberType() {
        return numberType;
    }

    public void setNumberType(String numberType) {
        this.numberType = numberType;
    }

    public String getMainNumber() {
        return mainNumber;
    }

    public void setMainNumber(String mainNumber) {
        this.mainNumber = mainNumber;
    }

    public String getSubNumber() {
        return subNumber;
    }

    public void setSubNumber(String subNumber) {
        this.subNumber = subNumber;
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    public BigDecimal getScore() {
        if (Objects.nonNull(score)) {
            return score.setScale(SystemConstant.CALCULATE_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return score;
        }
    }

    public void setScore(BigDecimal score) {
        this.score = score;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public Long getTime() {
        return time;
    }

    public void setTime(Long time) {
        this.time = time;
    }
}
