package com.eitc.common.core.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * Entity双控系统基类
 *
 * @author eitc
 */
@Data
public class EitcBaseEntity implements Serializable {
    private static final long serialVersionUID = 8887499842971074427L;

    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 删除标识：0正常，1已删除
     */
//    @Excel(name = "删除标识：0正常，1已删除")
    @ApiModelProperty(value = "删除标识：0正常，1已删除", hidden = true)
    @TableField(value = "is_del")
    @TableLogic(value = "0", delval = "unix_timestamp()")
    private Long isDel;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "创建时间", hidden = true)
    @TableField(value = "create_date", fill = FieldFill.INSERT)
    private Date createDate;

    /**
     * 创建人ID
     */
//    @Excel(name = "创建人ID")
    @ApiModelProperty(value = "创建人ID", hidden = true)
    @TableField(value = "create_user", fill = FieldFill.INSERT)
    private String createUser;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "更新时间", hidden = true)
    @TableField(value = "update_date", fill = FieldFill.INSERT_UPDATE)
    private Date updateDate;

    /**
     * 更新人
     */
//    @Excel(name = "更新人")
    @ApiModelProperty(value = "更新人", hidden = true)
    @TableField(value = "update_user", fill = FieldFill.INSERT_UPDATE)
    private String updateUser;

    @ApiModelProperty(value = "租户id", hidden = true)
    @TableField(value = "tenant_id")
    private String tenantId;

}
