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.Index;
import javax.persistence.Table;

/**
 * @Description : 自动化策略明细表
 * @Reference :
 * @Author : jimmy.zeng
 * @CreateDate : 2020-06-20 16:51
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "WMS_AUTO_STRATEGY_DETAIL", indexes = {
        @Index(columnList = "AUTO_STRATEGY_NO"),
        @Index(columnList = "STRATEGY_ITEM_NO")
})
@Api("自动化策略明细表")
public class WmsAutoStrategyDetail extends BaseBean {
    private static final long serialVersionUID = 6855278572650548519L;

    @Column(name = "AUTO_STRATEGY_NO")
    @ApiParam(value = "自动化策略编码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String autoStrategyNo;

    @Column(name = "STRATEGY_ITEM_NO")
    @ApiParam(value = "策略项编码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String strategyItemNo;

    @Column(name = "STRATEGY_ITEM_NAME")
    @ApiParam(value = "策略项名称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String strategyItemName;

    @Column(name = "STRATEGY_ITEM_SPEC")
    @ApiParam(value = "策略项描述")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String strategyItemSpec;

    @Column(name = "FILTER_CONDITION")
    @ApiParam(value = "过滤条件")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String filterCondition;

    @Column(name = "SORT_CONDITION")
    @ApiParam(value = "排序条件")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String sortCondition;

    @Column(name = "STRATEGY_ACTION")
    @ApiParam(value = "动作")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    @AnnoOutputColumn(refClass = WmsEnumUtil.STRATEGY_ACTION_TYPE.class, refForeignKey = "value", value = "description", hidden = true)
    private Integer strategyAction;

    @Column(name = "STRATEGY_METHOD")
    @ApiParam(value = "方法")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String strategyMethod;

    @Column(name = "SCRIPT_NO")
    @ApiParam(value = "脚本编号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String scriptNo;

}
