package org.springblade.modules.investment.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import org.springblade.modules.investment.config.CustomDecimalSerialize;

/**
 * 项目资金信息
 *
 * @TableName iba_project_fund
 */
@TableName(value = "iba_project_fund")
@Data
public class IbaProjectFund {
    /**
     *
     */
    @TableId
    private Long id;

    /**
     * 项目id
     */
    private Long projectId;

    /**
     * 年份
     */
    private String year;

    /**
     * 流入-通行费
     */
    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal tollInflow;

    /**
     * 流入-其他
     */
    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal otherInflow;

    /**
     * 流出-建设期总投资额
     */
    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal constructInvestOutflow;

    /**
     * 流出-建设期各年份投入比例
     */
    private String constructProportionOutflow;

    /**
     * 流出-借贷本金偿还
     */

    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal borrowPrincipalOutflow;

    /**
     * 流出-借贷利息偿还
     */

    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal borrowInterestOutflow;

    /**
     * 流出-经营成本-养护、小修费
     */

    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal operateMaintainOutflow;

    /**
     * 流出-经营成本-大修费
     */

    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal operateOverhaulOutflow;

    /**
     * 流出-经营成本-资本性支出
     */

    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal operateCapitalOutflow;

    /**
     * 流出-经营成本-运营管理费
     */

    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal operateOperationOutflow;

    /**
     * 流出-经营成本-其他费用
     */

    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal operateOtherOutflow;

    /**
     * 流出-运营期税金
     */

    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal operationTaxesOutflow;

    /**
     * 流出-其他费用
     */

    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal otherOutflow;

    /**
     * 是否删除（0-未删除，1-删除）
     */
    private Integer isDeleted;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人
     */
    private String createUser;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 修改人
     */
    private String updateUser;


    /**
     * 流入统计
     */
    @TableField(exist = false)
    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal inflowTotal;

    /**
     * 流出统计
     */
    @TableField(exist = false)
    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal outflowTotal;

    /**
     * 成本统计
     */
    @TableField(exist = false)
    @JsonSerialize(using = CustomDecimalSerialize.class)
    private BigDecimal costTotal;


    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        IbaProjectFund other = (IbaProjectFund) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getProjectId() == null ? other.getProjectId() == null : this.getProjectId().equals(other.getProjectId()))
                && (this.getYear() == null ? other.getYear() == null : this.getYear().equals(other.getYear()))
                && (this.getTollInflow() == null ? other.getTollInflow() == null : this.getTollInflow().equals(other.getTollInflow()))
                && (this.getOtherInflow() == null ? other.getOtherInflow() == null : this.getOtherInflow().equals(other.getOtherInflow()))
                && (this.getConstructInvestOutflow() == null ? other.getConstructInvestOutflow() == null : this.getConstructInvestOutflow().equals(other.getConstructInvestOutflow()))
                && (this.getConstructProportionOutflow() == null ? other.getConstructProportionOutflow() == null : this.getConstructProportionOutflow().equals(other.getConstructProportionOutflow()))
                && (this.getBorrowPrincipalOutflow() == null ? other.getBorrowPrincipalOutflow() == null : this.getBorrowPrincipalOutflow().equals(other.getBorrowPrincipalOutflow()))
                && (this.getBorrowInterestOutflow() == null ? other.getBorrowInterestOutflow() == null : this.getBorrowInterestOutflow().equals(other.getBorrowInterestOutflow()))
                && (this.getOperateMaintainOutflow() == null ? other.getOperateMaintainOutflow() == null : this.getOperateMaintainOutflow().equals(other.getOperateMaintainOutflow()))
                && (this.getOperateOverhaulOutflow() == null ? other.getOperateOverhaulOutflow() == null : this.getOperateOverhaulOutflow().equals(other.getOperateOverhaulOutflow()))
                && (this.getOperateCapitalOutflow() == null ? other.getOperateCapitalOutflow() == null : this.getOperateCapitalOutflow().equals(other.getOperateCapitalOutflow()))
                && (this.getOperateOperationOutflow() == null ? other.getOperateOperationOutflow() == null : this.getOperateOperationOutflow().equals(other.getOperateOperationOutflow()))
                && (this.getOperateOtherOutflow() == null ? other.getOperateOtherOutflow() == null : this.getOperateOtherOutflow().equals(other.getOperateOtherOutflow()))
                && (this.getOperationTaxesOutflow() == null ? other.getOperationTaxesOutflow() == null : this.getOperationTaxesOutflow().equals(other.getOperationTaxesOutflow()))
                && (this.getOtherOutflow() == null ? other.getOtherOutflow() == null : this.getOtherOutflow().equals(other.getOtherOutflow()))
                && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
                && (this.getUpdateUser() == null ? other.getUpdateUser() == null : this.getUpdateUser().equals(other.getUpdateUser()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getProjectId() == null) ? 0 : getProjectId().hashCode());
        result = prime * result + ((getYear() == null) ? 0 : getYear().hashCode());
        result = prime * result + ((getTollInflow() == null) ? 0 : getTollInflow().hashCode());
        result = prime * result + ((getOtherInflow() == null) ? 0 : getOtherInflow().hashCode());
        result = prime * result + ((getConstructInvestOutflow() == null) ? 0 : getConstructInvestOutflow().hashCode());
        result = prime * result + ((getConstructProportionOutflow() == null) ? 0 : getConstructProportionOutflow().hashCode());
        result = prime * result + ((getBorrowPrincipalOutflow() == null) ? 0 : getBorrowPrincipalOutflow().hashCode());
        result = prime * result + ((getBorrowInterestOutflow() == null) ? 0 : getBorrowInterestOutflow().hashCode());
        result = prime * result + ((getOperateMaintainOutflow() == null) ? 0 : getOperateMaintainOutflow().hashCode());
        result = prime * result + ((getOperateOverhaulOutflow() == null) ? 0 : getOperateOverhaulOutflow().hashCode());
        result = prime * result + ((getOperateCapitalOutflow() == null) ? 0 : getOperateCapitalOutflow().hashCode());
        result = prime * result + ((getOperateOperationOutflow() == null) ? 0 : getOperateOperationOutflow().hashCode());
        result = prime * result + ((getOperateOtherOutflow() == null) ? 0 : getOperateOtherOutflow().hashCode());
        result = prime * result + ((getOperationTaxesOutflow() == null) ? 0 : getOperationTaxesOutflow().hashCode());
        result = prime * result + ((getOtherOutflow() == null) ? 0 : getOtherOutflow().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getUpdateUser() == null) ? 0 : getUpdateUser().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", projectId=").append(projectId);
        sb.append(", year=").append(year);
        sb.append(", tollInflow=").append(tollInflow);
        sb.append(", otherInflow=").append(otherInflow);
        sb.append(", constructInvestOutflow=").append(constructInvestOutflow);
        sb.append(", constructProportionOutflow=").append(constructProportionOutflow);
        sb.append(", borrowPrincipalOutflow=").append(borrowPrincipalOutflow);
        sb.append(", borrowInterestOutflow=").append(borrowInterestOutflow);
        sb.append(", operateMaintainOutflow=").append(operateMaintainOutflow);
        sb.append(", operateOverhaulOutflow=").append(operateOverhaulOutflow);
        sb.append(", operateCapitalOutflow=").append(operateCapitalOutflow);
        sb.append(", operateOperationOutflow=").append(operateOperationOutflow);
        sb.append(", operateOtherOutflow=").append(operateOtherOutflow);
        sb.append(", operationTaxesOutflow=").append(operationTaxesOutflow);
        sb.append(", otherOutflow=").append(otherOutflow);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", createTime=").append(createTime);
        sb.append(", createUser=").append(createUser);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", updateUser=").append(updateUser);
        sb.append("]");
        return sb.toString();
    }
}