lrj
4 天以前 9f8395fab13ca4b230a0f7d62636e209745c91d4
backend/src/main/java/com/rongyichuang/activity/entity/ActivityPlayerRating.java
@@ -2,6 +2,7 @@
import com.rongyichuang.common.entity.BaseEntity;
import jakarta.persistence.*;
import org.hibernate.annotations.Where;
import java.math.BigDecimal;
@@ -11,6 +12,7 @@
 */
@Entity
@Table(name = "t_activity_player_rating")
@Where(clause = "state = 1")
public class ActivityPlayerRating extends BaseEntity {
    /**
@@ -26,6 +28,12 @@
    private Long activityPlayerId;
    /**
     * 阶段ID
     */
    @Column(name = "stage_id", nullable = false)
    private Long stageId;
    /**
     * 选手ID
     */
    @Column(name = "player_id", nullable = false)
@@ -34,44 +42,51 @@
    /**
     * 评委ID
     */
    @Column(name = "judge_id", nullable = false)
    @Column(name = "judge_id")
    private Long judgeId;
    /**
     * 评分方案ID
     */
    @Column(name = "rating_scheme_id", nullable = false)
    @Column(name = "rating_scheme_id")
    private Long ratingSchemeId;
    /**
     * 总分
     */
    @Column(name = "total_score", precision = 10, scale = 2)
    @Column(name = "total_score", precision = 19, scale = 2)
    private BigDecimal totalScore;
    /**
     * 反馈信息
     */
    @Column(name = "feedback", columnDefinition = "TEXT")
    private String feedback;
    /**
     * 评分状态:0-未评分,1-已评分
     */
    @Column(name = "status", nullable = false)
    private Integer status = 0;
    @Column(name = "rating_state", nullable = false)
    private Integer ratingState = 0;
    /**
     * 评分备注
     * 状态:1-正常,0-删除
     */
    @Column(name = "remark", length = 500)
    private String remark;
    @Column(name = "state", nullable = false)
    private Integer state = 1;
    // 构造函数
    public ActivityPlayerRating() {}
    public ActivityPlayerRating(Long activityId, Long activityPlayerId, Long playerId,
    public ActivityPlayerRating(Long activityId, Long activityPlayerId, Long stageId, Long playerId,
                               Long judgeId, Long ratingSchemeId) {
        this.activityId = activityId;
        this.activityPlayerId = activityPlayerId;
        this.stageId = stageId;
        this.playerId = playerId;
        this.judgeId = judgeId;
        this.ratingSchemeId = ratingSchemeId;
        this.status = 0;
        this.state = 0;
    }
    // Getter和Setter方法
@@ -89,6 +104,14 @@
    public void setActivityPlayerId(Long activityPlayerId) {
        this.activityPlayerId = activityPlayerId;
    }
    public Long getStageId() {
        return stageId;
    }
    public void setStageId(Long stageId) {
        this.stageId = stageId;
    }
    public Long getPlayerId() {
@@ -123,21 +146,32 @@
        this.totalScore = totalScore;
    }
    public String getFeedback() {
        return feedback;
    }
    public void setFeedback(String feedback) {
        this.feedback = feedback;
    }
    public Integer getState() {
        return state;
    }
    public void setState(Integer state) {
        this.state = state;
    }
    // 为了兼容性,保留status相关方法
    public Integer getStatus() {
        return status;
        return state;
    }
    public void setStatus(Integer status) {
        this.status = status;
        this.state = status;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    @Override
    public String toString() {
@@ -145,12 +179,13 @@
                "id=" + getId() +
                ", activityId=" + activityId +
                ", activityPlayerId=" + activityPlayerId +
                ", stageId=" + stageId +
                ", playerId=" + playerId +
                ", judgeId=" + judgeId +
                ", ratingSchemeId=" + ratingSchemeId +
                ", totalScore=" + totalScore +
                ", status=" + status +
                ", remark='" + remark + '\'' +
                ", feedback='" + feedback + '\'' +
                ", state=" + state +
                '}';
    }
}