package com.hdkj.lt.core.bizms.modle.po.fault;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.hdkj.lt.base.model.entity.FhzgBaseEntity;
import com.hdkj.lt.base.serializer.BigDecimalSerializer;
import lombok.Data;

import java.math.BigDecimal;

/**
 *
 * @TableName fhzg_fault_breaker_svg_after
 */
@TableName(value ="fhzg_fault_breaker_svg_after")
@Data
public class FhzgFaultBreakerSvgAfter extends FhzgBaseEntity {

    /**
     * 转供方案ID(fhzg_fault_transfer_scheme.id)
     */
    private Long schemeId;

    /**
     * 转供后有功
     */
    @JsonSerialize(using = BigDecimalSerializer.Keep6DecimalSerializer.class)
    private BigDecimal afterP;

    /**
     * 转供后无功
     */
    @JsonSerialize(using = BigDecimalSerializer.Keep6DecimalSerializer.class)
    private BigDecimal afterQ;

    /**
     * 转供后电流
     */
    @JsonSerialize(using = BigDecimalSerializer.Keep2DecimalSerializer.class)
    private BigDecimal afterI;

    /**
     * 起点开关ID
     */
    private String startSwitchId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        FhzgFaultBreakerSvgAfter other = (FhzgFaultBreakerSvgAfter) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSchemeId() == null ? other.getSchemeId() == null : this.getSchemeId().equals(other.getSchemeId()))
            && (this.getAfterP() == null ? other.getAfterP() == null : this.getAfterP().equals(other.getAfterP()))
            && (this.getAfterQ() == null ? other.getAfterQ() == null : this.getAfterQ().equals(other.getAfterQ()))
            && (this.getAfterI() == null ? other.getAfterI() == null : this.getAfterI().equals(other.getAfterI()))
            && (this.getStartSwitchId() == null ? other.getStartSwitchId() == null : this.getStartSwitchId().equals(other.getStartSwitchId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSchemeId() == null) ? 0 : getSchemeId().hashCode());
        result = prime * result + ((getAfterP() == null) ? 0 : getAfterP().hashCode());
        result = prime * result + ((getAfterQ() == null) ? 0 : getAfterQ().hashCode());
        result = prime * result + ((getAfterI() == null) ? 0 : getAfterI().hashCode());
        result = prime * result + ((getStartSwitchId() == null) ? 0 : getStartSwitchId().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(", schemeId=").append(schemeId);
        sb.append(", afterP=").append(afterP);
        sb.append(", afterQ=").append(afterQ);
        sb.append(", afterI=").append(afterI);
        sb.append(", startSwitchId=").append(startSwitchId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
