package cn.estsh.i3plus.pojo.wms.bean;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * @Description : 附件表
 * @Reference :
 * @Author : jessica.chen
 * @CreateDate : 2019-11-26 14:21
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="WMS_FILE",
        uniqueConstraints = {@UniqueConstraint(columnNames = {"FILE_NAME", "REF_SRC", "REF_TYPE"})})
@Api("附件信息")
public class WmsFile extends BaseBean{

    private static final long serialVersionUID = 9214639813072592712L;
    @Column(name="FILE_NAME")
    @ApiParam("文件名称")
    private String fileName;

    @Column(name="FILE_SIZE")
    @ApiParam(value = "文件大小(KB)", example = "0")
    private Integer fileSize = 0;

    @Column(name="FILE_TYPE")
    @ApiParam("文件类型")
    private String fileType;

    @Column(name="RESOURCE_ID")
    @ApiParam("资源编号")
    private String resourceId;

    @Column(name="FILE_URL")
    @ApiParam("下载地址")
    private String fileUrl;

    @Column(name="REF_SRC")
    @ApiParam("关联单据编号")
    private String refSrc;

    @Column(name = "REF_TYPE")
    @ApiParam(value = "关联单据类型")
    private String refType;

    @Transient
    @ApiParam("预览前缀")
    public String previewPrefix;
}