package com.yida.data.common.core.entity.apply;


import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;

import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * JPA通用字段实体类
 *
 * @author ZYJ
 * @date 2020/9/9
 */
@SuppressWarnings("WeakerAccess")
@Getter
@Setter
@ToString
@Data
public class JpaBaseDomain implements Serializable {

    private static final long serialVersionUID = -6490416924124915764L;


    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;

    /**
     * 创建人id
     */
    private Long createId;

    /**
     * 创建人名称
     */
//    private String createName;

    /**
     * 最后修改时间
     */
    @TableField(fill = FieldFill.UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateDate;

    /**
     * 最后修改人id
     */
    private Long updateId;

    /**
     * 删除状态 0:未删除, 1:已删除
     */
    @TableLogic(value = "0", delval = "1")
    private Integer delFlag;


}
