guang
2023-04-24 6044ac660b623034eaf0d7d8512aff99463458d1
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
package com.hx.other.service.model;
 
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Index;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
 
import java.io.Serializable;
import java.util.Date;
 
/**
 * 基础实体类
 * @Author: cmg
 * @Data: 2023-04-19
 */
@Data
public class BaseEntity implements Serializable {
 
    @Column(type = MySqlTypeConstant.VARCHAR, length = 64, isKey=true, comment="标识", isNull=false)
    private String id;
 
    @Column(comment="是否删除", isNull = false, length = 2, type = MySqlTypeConstant.INT)
    private Integer isDel = NO;
 
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @Column(comment="创建时间",type = MySqlTypeConstant.DATETIME, isNull = false)
    private Date createTime = new Date();
 
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @Column(comment="更新时间",type = MySqlTypeConstant.DATETIME)
    private Date editTime = new Date();
 
    ///////////////////////////////////////////////////////
    /**数字0*/
    public static final Integer NO = 0;
    /**数字1*/
    public static final Integer YES = 1;
}