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

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.annotation.DynamicField;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil;
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.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @Description :容器类型
 * @Reference :
 * @Author : gcj
 * @CreateDate : 2019-11-07 16:06
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "WMS_CONTAINER_TYPE")
@Api("容器类型")
public class WmsContainerType extends BaseBean {
    private static final long serialVersionUID = 4849044986767609347L;
    @ApiParam(value = "容器类型代码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String ctCode;

    @Column(name = "CT_NAME")
    @ApiParam(value = "容器类型名称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String ctName;

    @Column(name = "USE_LIMIT")
    @ApiParam(value = "使用期限")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private Integer useLimit;

    @Column(name = "IS_RECYCLE")
    @ApiParam(value = "是否回收")
    @AnnoOutputColumn(refClass = WmsEnumUtil.TRUE_OR_FALSE.class, refForeignKey = "value", value = "description")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, dataSrc = "TRUE_OR_FALSE")
    private Integer isRecycle;

    @Column(name = "LIMIT_UOM")
    @ApiParam(value = "期限单位")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private String limitUom;
}
