package com.xinyilu.system.domain.dto;

import com.xinyilu.common.custominterface.Insert;
import com.xinyilu.common.custominterface.Update;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Objects;

/**
 * @Description
 * @Author 纪寒
 * @Date 2022-08-25 11:21:38
 * @Version 1.0
 */
@Data
public class ItemStudentScoreDTO implements Serializable {
    private static final long serialVersionUID = -2670208317750478563L;

    /**
     * 主键id
     */
    @NotNull(message = "主键id不能为空")
    private Long id;

    /**
     * 项目id
     */
    @NotNull(message = "测试项目id不能为空", groups = {Insert.class, Update.class})
    private Long testItemId;

    /**
     * 项目编号
     */
    private String itemCode;

    /**
     * 项目名称
     */
    private String itemName;

    /**
     * 测试项目类型id
     */
    private Long scoreDictId;

    /**
     * 测试成绩数值
     */
    private BigDecimal itemScore;

    /**
     * 测试成绩文本
     */
    private String scoreDictValue;

    /**
     * 测试成绩数值
     */
    private BigDecimal itemFraction;

    /**
     * 综合评价
     */
    private String syntheticalAssess;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ItemStudentScoreDTO scoreDTO = (ItemStudentScoreDTO) o;
        return Objects.equals(testItemId, scoreDTO.testItemId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(testItemId);
    }
}
