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 = "TAExamCourseCollegeInspect对象", description = "参考课程考查学院维度分析表")
public class TAExamCourseCollegeInspect 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_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 = "college_id")
    private Long collegeId;

    @ApiModelProperty(value = "最高分")
    @TableField(value = "max_score")
    private BigDecimal maxScore;

    @ApiModelProperty(value = "最低分")
    @TableField(value = "min_score")
    private BigDecimal minScore;

    @ApiModelProperty(value = "平均分")
    @TableField(value = "avg_score")
    private BigDecimal avgScore;

    @ApiModelProperty(value = "实际参考人数")
    @TableField(value = "reality_count")
    private Integer realityCount;

    @ApiModelProperty(value = "缺考人数")
    @TableField(value = "absent_count")
    private Integer absentCount;

    @ApiModelProperty(value = "总人数")
    @TableField(value = "total_count")
    private Integer totalCount;

    @ApiModelProperty(value = "上四分位数")
    @TableField(value = "upper_quartile")
    private BigDecimal upperQuartile;

    @ApiModelProperty(value = "中位数")
    @TableField(value = "median")
    private BigDecimal median;

    @ApiModelProperty(value = "下四分位数")
    @TableField(value = "lower_quartile")
    private BigDecimal lowerQuartile;

    @ApiModelProperty(value = "众数")
    @TableField(value = "mode")
    private String mode;

    @ApiModelProperty(value = "标准差")
    @TableField(value = "standard_deviation")
    private BigDecimal standardDeviation;

    @ApiModelProperty(value = "相对位置")
    @TableField(value = "relative_position")
    private BigDecimal relativePosition;

    public Long getSchoolId() {
        return schoolId;
    }

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

    public String getCourseName() {
        return courseName;
    }

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

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

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

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

    public void setMaxScore(BigDecimal maxScore) {
        this.maxScore = maxScore;
    }

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

    public void setMinScore(BigDecimal minScore) {
        this.minScore = minScore;
    }

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

    public void setAvgScore(BigDecimal avgScore) {
        this.avgScore = avgScore;
    }

    public Integer getRealityCount() {
        return realityCount;
    }

    public void setRealityCount(Integer realityCount) {
        this.realityCount = realityCount;
    }

    public Integer getAbsentCount() {
        return absentCount;
    }

    public void setAbsentCount(Integer absentCount) {
        this.absentCount = absentCount;
    }

    public Integer getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }

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

    public void setUpperQuartile(BigDecimal upperQuartile) {
        this.upperQuartile = upperQuartile;
    }

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

    public void setMedian(BigDecimal median) {
        this.median = median;
    }

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

    public void setLowerQuartile(BigDecimal lowerQuartile) {
        this.lowerQuartile = lowerQuartile;
    }

    public String getMode() {
        if (Objects.isNull(mode)) {
            return "";
        } else {
            return mode;
        }
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

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

    public void setStandardDeviation(BigDecimal standardDeviation) {
        this.standardDeviation = standardDeviation;
    }

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

    public void setRelativePosition(BigDecimal relativePosition) {
        this.relativePosition = relativePosition;
    }
}
