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

import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EFurnacePlan;
import com.fasterxml.jackson.annotation.JsonBackReference;
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;
import java.util.List;

/**
 * @Description :炉资源计划信息，用来关联组在一起的工作计划
 * @Reference :
 * @Author : jason.niu
 * @CreateDate : 2019-10-22
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="APS_FURNACE_PLAN")
@Api("炉资源计划")
public class FurnacePlan extends BaseAPS {

    private static final long serialVersionUID = 6816465736285211114L;
    @Column(name="CAPACITY", columnDefinition = "decimal(18,8)")
    @ApiParam(value ="已占用的能力")
    private Double capacity;

    @JsonBackReference
    public List<WorkPlan> getWorkPlans() { return BeanRelation.list(this, EFurnacePlan.WorkPlans); }
}
