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 = "TAExamCourseRecordMod对象", description = "参考课程考生考查点模块维度表")
public class TAExamCourseRecordMod 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 = "school_id")
    private Long schoolId;

    @ApiModelProperty(value = "基础考生成绩表id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "exam_record_id")
    private Long examRecordId;

    @ApiModelProperty(value = "试卷id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "paper_id")
    private Long paperId;

    @ApiModelProperty(value = "考试id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "exam_id")
    private Long examId;

    @ApiModelProperty(value = "课程编号")
    @TableField(value = "course_code")
    private String courseCode;

    @ApiModelProperty(value = "课程名称")
    @TableField(value = "course_name")
    private String courseName;

    @ApiModelProperty(value = "考生id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "student_id")
    private Long studentId;

    @ApiModelProperty(value = "考号")
    @TableField(value = "student_code")
    private String studentCode;

    @ApiModelProperty(value = "考查模块名称")
    @TableField(value = "module_type")
    private String moduleType;

    @ApiModelProperty(value = "该考生在该模块的总得分（实际分）")
    @TableField(value = "total_score")
    private BigDecimal totalScore;

    @ApiModelProperty(value = "该学生在该考查模块的整体掌握率（total_score/full_score）")
    @TableField(value = "score_rate")
    private BigDecimal scoreRate;

    @ApiModelProperty(value = "考查模块在试卷中的总分(实际分)")
    @TableField(value = "full_score")
    private BigDecimal fullScore;

    @ApiModelProperty(value = "该学生在该模块掌握的熟练度（score_rate）")
    @TableField(value = "proficiency")
    private String proficiency;

    @ApiModelProperty(value = "该学生在该模块的得分在学院排名(赋分)")
    @TableField(value = "col_rank")
    private Integer colRank;

    @ApiModelProperty(value = "百分等级数")
    @TableField(value = "percent_grade")
    private Integer percentGrade;

    @ApiModelProperty(value = "等级(不确定百分等级、排名等级、得分率等级)")
    @TableField(value = "level")
    private String level;

    @ApiModelProperty(value = "考生所属考查学院id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "inspect_college_id")
    private Long inspectCollegeId;

    @ApiModelProperty(value = "考生所属考查学院名称")
    @TableField(value = "inspect_college_name")
    private String inspectCollegeName;

    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 Long getPaperId() {
        return paperId;
    }

    public void setPaperId(Long paperId) {
        this.paperId = paperId;
    }

    public String getModuleType() {
        return moduleType;
    }

    public void setModuleType(String moduleType) {
        this.moduleType = moduleType;
    }

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

    public void setTotalScore(BigDecimal totalScore) {
        this.totalScore = totalScore;
    }

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

    public void setScoreRate(BigDecimal scoreRate) {
        this.scoreRate = scoreRate;
    }

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

    public void setFullScore(BigDecimal fullScore) {
        this.fullScore = fullScore;
    }

    public String getProficiency() {
        return proficiency;
    }

    public void setProficiency(String proficiency) {
        this.proficiency = proficiency;
    }

    public Integer getColRank() {
        return colRank;
    }

    public void setColRank(Integer colRank) {
        this.colRank = colRank;
    }

    public Integer getPercentGrade() {
        return percentGrade;
    }

    public void setPercentGrade(Integer percentGrade) {
        this.percentGrade = percentGrade;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public Long getExamId() {
        return examId;
    }

    public void setExamId(Long examId) {
        this.examId = examId;
    }

    public String getCourseCode() {
        return courseCode;
    }

    public void setCourseCode(String courseCode) {
        this.courseCode = courseCode;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public Long getInspectCollegeId() {
        return inspectCollegeId;
    }

    public void setInspectCollegeId(Long inspectCollegeId) {
        this.inspectCollegeId = inspectCollegeId;
    }

    public String getInspectCollegeName() {
        return inspectCollegeName;
    }

    public void setInspectCollegeName(String inspectCollegeName) {
        this.inspectCollegeName = inspectCollegeName;
    }

    public Long getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(Long schoolId) {
        this.schoolId = schoolId;
    }

    public String getStudentCode() {
        return studentCode;
    }

    public void setStudentCode(String studentCode) {
        this.studentCode = studentCode;
    }

    public Long getStudentId() {
        return studentId;
    }

    public void setStudentId(Long studentId) {
        this.studentId = studentId;
    }
}
