package com.wx.application.base;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @author zj
 * @description : 实体基类 ---------------------------------
 * @since 2017-10-27
 */
@Data
public class BaseEntity<FIDTYPE> {

    @TableId(value = "id", type = IdType.AUTO)
    private FIDTYPE id;// 物理主键

    @TableField(exist = false)
    @JsonIgnore
    private List<FIDTYPE> ids;

    @JsonIgnore
    @TableField(value = "is_remove", fill = FieldFill.INSERT)
    @TableLogic
    private Boolean remove;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;
}
