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

import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EPlanFeedback;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @Description :计划反馈
 * @Reference :
 * @Author : jason.niu
 * @CreateDate : 2019-09-17
 * @Modify:
 **/
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "APS_PLAN_FEEDBACK")
@Api("工作反馈")
public class PlanFeedback extends BaseAPS {

    private static final long serialVersionUID = 2520555825093741381L;
    @Column(name="WORK_ID")
    @ApiParam(value ="工作")
    @FieldAnnotation(property = false)
    private Long workId;

    public Work getWork() {
        return BeanRelation.get(this, EPlanFeedback.Work);
    }

    public void setWork(Work work) {
        this.workId = work != null ? work.getId() : 0l;
        BeanRelation.set(this, EPlanFeedback.Work, work);
    }
}
