Points.java
1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.topdraw.business.basicdata.points.domain;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* @author XiangHan
* @date 2021-10-22
*/
@Entity
@Data
@EntityListeners(AuditingEntityListener.class)
@Accessors(chain = true)
@Table(name="uc_points")
public class Points implements Serializable {
@Id
@Column(name = "id")
private Long id;
@Column(name = "user_id")
private Long userId;
// 积分类型,通用,绑定, 区分大小屏
@Column(name = "point_type")
private Integer pointType;
// 绑定对应的实体, 如何描述?
@Column(name = "target_no")
private String targetNo;
// 本月期初积分值
@Column(name = "begin_points")
private Integer beginPoints;
// 当前积分余额
@Column(name = "current_points")
private Integer currentPoints;
// 本月到期积分
@Column(name = "expire_points")
private Integer expirePoints;
// 积分类型:10:通用积分(跨屏) 11:定向积分(跨屏,绑定用途)20:通用积分(大屏) 21:定向积分(大屏,绑定用途)30:通用积分(小屏) 31:定向积分(小屏,绑定用途)
@CreatedDate
@Column(name = "create_time")
private Timestamp createTime;
// 最后修改时间
@LastModifiedDate
@Column(name = "update_time")
private Timestamp updateTime;
public void copy(Points source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}
}