| | |
| | | package com.rongyichuang.activity.entity; |
| | | |
| | | import com.rongyichuang.common.entity.BaseEntity; |
| | | import com.rongyichuang.rating.entity.RatingScheme; |
| | | import jakarta.persistence.*; |
| | | import org.hibernate.annotations.CreationTimestamp; |
| | | import org.hibernate.annotations.UpdateTimestamp; |
| | | import org.hibernate.annotations.Where; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | |
| | | |
| | | @Entity |
| | | @Table(name = "t_activity") |
| | | public class Activity { |
| | | |
| | | @Id |
| | | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| | | private Long id; |
| | | @Where(clause = "state = 1") |
| | | public class Activity extends BaseEntity { |
| | | |
| | | @Column(name = "pid", nullable = false) |
| | | private Long pid = 0L; |
| | |
| | | @Column(name = "player_max") |
| | | private Integer playerMax; |
| | | |
| | | /** |
| | | * 状态:1-正常,0-删除 |
| | | */ |
| | | @Column(name = "state", nullable = false) |
| | | private Integer state = 1; |
| | | |
| | | @Column(name = "create_time", nullable = false, updatable = false) |
| | | @CreationTimestamp |
| | | private LocalDateTime createTime; |
| | | |
| | | @Column(name = "create_user_id") |
| | | private Long createUserId; |
| | | |
| | | @Column(name = "update_time", nullable = false) |
| | | @UpdateTimestamp |
| | | private LocalDateTime updateTime; |
| | | |
| | | @Column(name = "update_user_id") |
| | | private Long updateUserId; |
| | | |
| | | @Version |
| | | @Column(name = "version", nullable = false) |
| | | private Long version = 0L; |
| | | |
| | | // 关联评分模板 |
| | | @ManyToOne(fetch = FetchType.LAZY) |
| | |
| | | } |
| | | |
| | | // Getters and Setters |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getPid() { |
| | | return pid; |
| | |
| | | this.playerMax = playerMax; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public LocalDateTime getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(LocalDateTime createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Long getCreateUserId() { |
| | | return createUserId; |
| | | } |
| | | |
| | | public void setCreateUserId(Long createUserId) { |
| | | this.createUserId = createUserId; |
| | | } |
| | | |
| | | public LocalDateTime getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(LocalDateTime updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public Long getUpdateUserId() { |
| | | return updateUserId; |
| | | } |
| | | |
| | | public void setUpdateUserId(Long updateUserId) { |
| | | this.updateUserId = updateUserId; |
| | | } |
| | | |
| | | public Long getVersion() { |
| | | return version; |
| | | } |
| | | |
| | | public void setVersion(Long version) { |
| | | this.version = version; |
| | | } |
| | | |
| | | public RatingScheme getRatingScheme() { |
| | | return ratingScheme; |
| | | } |
| | |
| | | this.parent = parent; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | // 业务方法 |
| | | public boolean isCompetition() { |
| | | public boolean isMainActivity() { |
| | | return pid == 0; |
| | | } |
| | | |