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 = "TAExamCourseDifficult对象", description = "考试课程，各难度题目得分率表（难度题得分率、中等难度题得分率、简单题得分率）")
public class TAExamCourseDifficult 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_id")
    private Long examId;

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

    @ApiModelProperty(value = "试卷类型")
    @TableField(value = "paper_type")
    private String paperType;

    @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 = "college_id")
    private Long collegeId;

    @ApiModelProperty(value = "学校id（冗余）")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "school_id")
    private Long schoolId;

    @ApiModelProperty(value = "难度类型")
    @TableField(value = "interpret")
    private String interpret;

    @ApiModelProperty(value = "该难度题目数量")
    @TableField(value = "count")
    private Integer count;

    @ApiModelProperty(value = "难度范围")
    @TableField(value = "scope")
    private String scope;

    @ApiModelProperty(value = "各难度题在全校的平均得分率")
    @TableField(value = "sch_avg_score_rate")
    private BigDecimal schAvgScoreRate;

    @ApiModelProperty(value = "各难度题在学院的平均得分率")
    @TableField(value = "col_avg_score_rate")
    private BigDecimal colAvgScoreRate;

    public Long getPaperId() {
        return paperId;
    }

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

    public String getPaperType() {
        return paperType;
    }

    public void setPaperType(String paperType) {
        this.paperType = paperType;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getId() {
        return id;
    }

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

    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 getCollegeId() {
        return collegeId;
    }

    public void setCollegeId(Long collegeId) {
        this.collegeId = collegeId;
    }

    public Long getSchoolId() {
        return schoolId;
    }

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

    public String getInterpret() {
        return interpret;
    }

    public void setInterpret(String interpret) {
        this.interpret = interpret;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

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

    public void setSchAvgScoreRate(BigDecimal schAvgScoreRate) {
        this.schAvgScoreRate = schAvgScoreRate;
    }

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

    public void setColAvgScoreRate(BigDecimal colAvgScoreRate) {
        this.colAvgScoreRate = colAvgScoreRate;
    }
}
