package cn.com.countrygarden.bi.main.model.excontract;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.math.BigDecimal;

public class ContractTarget {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    private String targetName;

    private String code;

    private Integer evaluateId;

    private Integer parentTargetId;

    private int occurNum;

    private double deductScore;

    private BigDecimal deductMoney;

    private String createBy;

    private String createDate;

    private String updateBy;

    private String updateDate;

    private int isDelete;

    public int getOccurNum() {
        return occurNum;
    }

    public void setOccurNum(int occurNum) {
        this.occurNum = occurNum;
    }

    public double getDeductScore() {
        return deductScore;
    }

    public void setDeductScore(double deductScore) {
        this.deductScore = deductScore;
    }

    public int getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(int isDelete) {
        this.isDelete = isDelete;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTargetName() {
        return targetName;
    }

    public void setTargetName(String targetName) {
        this.targetName = targetName == null ? null : targetName.trim();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code == null ? null : code.trim();
    }

    public Integer getEvaluateId() {
        return evaluateId;
    }

    public void setEvaluateId(Integer evaluateId) {
        this.evaluateId = evaluateId;
    }

    public Integer getParentTargetId() {
        return parentTargetId;
    }

    public void setParentTargetId(Integer parentTargetId) {
        this.parentTargetId = parentTargetId;
    }

    public BigDecimal getDeductMoney() {
        if(deductMoney == null) return new BigDecimal(0);
        return deductMoney;
    }

    public void setDeductMoney(BigDecimal deductMoney) {
        this.deductMoney = deductMoney;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateDate() {
        if (createDate != null && createDate.length() == 21) createDate = createDate.substring(0, 19);
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateDate() {
        if (updateDate != null && updateDate.length() == 21) updateDate = updateDate.substring(0, 19);
        return updateDate;
    }

    public void setUpdateDate(String updateDate) {
        this.updateDate = updateDate;
    }
}