package com.ff.weijinxiao.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ff.weijinxiao.util.jsonfilter.DateSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 仓库表
 */
@Data
@Entity
@Table(name = "tb_warehouse")
public class WareHouse implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "tid")
    private Integer id;

    @Column(name = "name")
    @ApiModelProperty(value = "仓库名")
    private String name;

    @Column(name = "address")
    @ApiModelProperty(value = "仓库地址")
    private String address;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")//json序列化实体类处理
    private Date createTime;

    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")//json序列化实体类处理
    private Date modifyTime;

    @Column(name = "uid")
    @ApiModelProperty(value = "创建者uid")
    private String uid;

    @Transient
    @ApiModelProperty(value = "创建者姓名")
    private String userName;

    @Column(name = "isAvailable")
    @ApiModelProperty(value = "是否有效 0=有效  1=无效")
    private Integer isAvailable = 0;

    // 150107717600090149862155037101291
    @Column(name = "onlyID")
    @ApiModelProperty(value = "onlyID")
    private String onlyID;

}
