package com.qmth.themis.business.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.themis.business.bean.admin.OrgSummaryBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

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

/**
 * <p>
 * 超管统计表
 * </p>
 *
 * @author wangliang
 * @since 2023-10-27
 */
@ApiModel(value = "TEOrgSummary对象", description = "超管统计表")
public class TEOrgSummary implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "机构ID，全局为0")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "org_id")
    private Long orgId = 0L;

    @ApiModelProperty(value = "在线人数")
    private Integer onlineCount = 0;

    @ApiModelProperty(value = "考试人数")
    private Integer examCount = 0;

    @ApiModelProperty(value = "完成考试次数")
    private Integer finishCount = 0;

    @ApiModelProperty(value = "完成考试人数")
    private Integer finishStudentCount = 0;

    public TEOrgSummary() {

    }

    public TEOrgSummary(Long orgId, Integer onlineCount, Integer examCount, Integer finishCount, Integer finishStudentCount) {
        this.orgId = orgId;
        this.onlineCount = Objects.isNull(onlineCount) ? 0 : onlineCount;
        this.examCount = Objects.isNull(examCount) ? 0 : examCount;
        this.finishCount = Objects.isNull(finishCount) ? 0 : finishCount;
        this.finishStudentCount = Objects.isNull(finishStudentCount) ? 0 : finishStudentCount;
    }

    public TEOrgSummary(Long orgId, OrgSummaryBean orgSummaryBean) {
        this.orgId = orgId;
        this.onlineCount = orgSummaryBean.getOnlineCount();
        this.examCount = orgSummaryBean.getExamCount();
        this.finishCount = orgSummaryBean.getFinishCount();
        this.finishStudentCount = orgSummaryBean.getFinishStudentCount();
    }

    public TEOrgSummary(Long orgId) {
        this.orgId = orgId;
    }


    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    public Integer getOnlineCount() {
        return onlineCount;
    }

    public void setOnlineCount(Integer onlineCount) {
        this.onlineCount = onlineCount;
    }

    public Integer getExamCount() {
        return examCount;
    }

    public void setExamCount(Integer examCount) {
        this.examCount = examCount;
    }

    public Integer getFinishCount() {
        return finishCount;
    }

    public void setFinishCount(Integer finishCount) {
        this.finishCount = finishCount;
    }

    public Integer getFinishStudentCount() {
        return finishStudentCount;
    }

    public void setFinishStudentCount(Integer finishStudentCount) {
        this.finishStudentCount = finishStudentCount;
    }
}
