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 = "TAExamCourseClazz对象", description = "参考课程班级维度分析表")
public class TAExamCourseClazz 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 = "clazz_id")
    private Long clazzId;

    @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 = "college_name")
    private String collegeName;

    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 getClazzId() {
        return clazzId;
    }

    public void setClazzId(Long clazzId) {
        this.clazzId = clazzId;
    }

    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 String getCollegeName() {
        return collegeName;
    }

    public void setCollegeName(String collegeName) {
        this.collegeName = collegeName;
    }
}
