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

import cn.com.countrygarden.bi.main.util.DateDeserializer;
import cn.com.countrygarden.bi.main.util.DateSerializer;
import cn.com.countrygarden.bi.main.util.DateTimeDeserializer;
import cn.com.countrygarden.bi.main.util.DateTimeSerializer;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;

@Table(name = "resident_contract")
public class ResidentContract {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(name = "organ_id")
    private String organId;

    @Column(name = "organ_name")
    private String organName;

    @Column(name = "comm_id")
    private String commId;

    @Column(name = "comm_name")
    private String commName;

    @Column(name = "nc_system_number")
    private String ncSystemNumber;

    @JsonSerialize(using = DateSerializer.class)
    @JsonDeserialize(using = DateDeserializer.class)
    @Column(name = "sign_time")
    private Date signTime;

    @Column(name = "contract_code")
    private String contractCode;

    @Column(name = "contract_type")
    private String contractType;

    @Transient
    private String contractTypeName;
    @Transient
    private String contractParentCode;

    @Column(name = "party_b")
    private String partyB;

    @Column(name = "taxpayer_number")
    private String taxpayerNumber;

    private String address;

    private String phone;

    private String bank;

    private String account;

    @JsonSerialize(using = DateSerializer.class)
    @JsonDeserialize(using = DateDeserializer.class)
    @Column(name = "start_date")
    private Date startDate;

    @JsonSerialize(using = DateSerializer.class)
    @JsonDeserialize(using = DateDeserializer.class)
    @Column(name = "end_date")
    private Date endDate;

    @Column(name = "fixed_amount")
    private BigDecimal fixedAmount;

    @Column(name = "float_amount")
    private String floatAmount;

    @Column(name = "payment_method")
    private String paymentMethod;

    @Transient
    private String paymentMethodName;

    private String status;

    private String remark;

    private String bipApprovalNumber;

    private Boolean isFinalSigned;

    @Column(name = "gmt_create",updatable = false)
    @JsonSerialize(using = DateTimeSerializer.class)
    @JsonDeserialize(using = DateTimeDeserializer.class)
    private Date gmtCreate;

    @Column(name = "created_by",updatable = false)
    private String createdBy;

    @Column(name = "gmt_modified")
    @JsonSerialize(using = DateTimeSerializer.class)
    @JsonDeserialize(using = DateTimeDeserializer.class)
    private Date gmtModified;

    @Column(name = "modified_by")
    private String modifiedBy;

    @Transient
    private Integer payments;

    @Transient
    private Integer paidPayments;

    /**
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return organ_id
     */
    public String getOrganId() {
        return organId;
    }

    /**
     * @param organId
     */
    public void setOrganId(String organId) {
        this.organId = organId == null ? null : organId.trim();
    }

    /**
     * @return organ_name
     */
    public String getOrganName() {
        return organName;
    }

    /**
     * @param organName
     */
    public void setOrganName(String organName) {
        this.organName = organName == null ? null : organName.trim();
    }

    /**
     * @return comm_id
     */
    public String getCommId() {
        return commId;
    }

    /**
     * @param commId
     */
    public void setCommId(String commId) {
        this.commId = commId == null ? null : commId.trim();
    }

    /**
     * @return comm_name
     */
    public String getCommName() {
        return commName;
    }

    /**
     * @param commName
     */
    public void setCommName(String commName) {
        this.commName = commName == null ? null : commName.trim();
    }

    /**
     * @return nc_system_number
     */
    public String getNcSystemNumber() {
        return ncSystemNumber;
    }

    /**
     * @param ncSystemNumber
     */
    public void setNcSystemNumber(String ncSystemNumber) {
        this.ncSystemNumber = ncSystemNumber == null ? null : ncSystemNumber.trim();
    }

    /**
     * @return sign_time
     */
    public Date getSignTime() {
        return signTime;
    }

    /**
     * @param signTime
     */
    public void setSignTime(Date signTime) {
        this.signTime = signTime;
    }

    /**
     * @return contract_code
     */
    public String getContractCode() {
        return contractCode;
    }

    /**
     * @param contractCode
     */
    public void setContractCode(String contractCode) {
        this.contractCode = contractCode == null ? null : contractCode.trim();
    }

    /**
     * @return contract_type
     */
    public String getContractType() {
        return contractType;
    }

    /**
     * @param contractType
     */
    public void setContractType(String contractType) {
        this.contractType = contractType == null ? null : contractType.trim();
    }

    /**
     * @return party_b
     */
    public String getPartyB() {
        return partyB;
    }

    /**
     * @param partyB
     */
    public void setPartyB(String partyB) {
        this.partyB = partyB == null ? null : partyB.trim();
    }

    /**
     * @return taxpayer_number
     */
    public String getTaxpayerNumber() {
        return taxpayerNumber;
    }

    /**
     * @param taxpayerNumber
     */
    public void setTaxpayerNumber(String taxpayerNumber) {
        this.taxpayerNumber = taxpayerNumber == null ? null : taxpayerNumber.trim();
    }

    /**
     * @return address
     */
    public String getAddress() {
        return address;
    }

    /**
     * @param address
     */
    public void setAddress(String address) {
        this.address = address == null ? null : address.trim();
    }

    /**
     * @return phone
     */
    public String getPhone() {
        return phone;
    }

    /**
     * @param phone
     */
    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    /**
     * @return bank
     */
    public String getBank() {
        return bank;
    }

    /**
     * @param bank
     */
    public void setBank(String bank) {
        this.bank = bank == null ? null : bank.trim();
    }

    /**
     * @return account
     */
    public String getAccount() {
        return account;
    }

    /**
     * @param account
     */
    public void setAccount(String account) {
        this.account = account == null ? null : account.trim();
    }

    /**
     * @return start_date
     */
    public Date getStartDate() {
        return startDate;
    }

    /**
     * @param startDate
     */
    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    /**
     * @return end_date
     */
    public Date getEndDate() {
        return endDate;
    }

    /**
     * @param endDate
     */
    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    /**
     * @return fixed_amount
     */
    public BigDecimal getFixedAmount() {
        return fixedAmount;
    }

    /**
     * @param fixedAmount
     */
    public void setFixedAmount(BigDecimal fixedAmount) {
        this.fixedAmount = fixedAmount;
    }

    /**
     * @return float_amount
     */
    public String getFloatAmount() {
        return floatAmount;
    }

    /**
     * @param floatAmount
     */
    public void setFloatAmount(String floatAmount) {
        this.floatAmount = floatAmount == null ? null : floatAmount.trim();
    }

    /**
     * @return payment_method
     */
    public String getPaymentMethod() {
        return paymentMethod;
    }

    /**
     * @param paymentMethod
     */
    public void setPaymentMethod(String paymentMethod) {
        this.paymentMethod = paymentMethod == null ? null : paymentMethod.trim();
    }

    /**
     * @return status
     */
    public String getStatus() {
        return status;
    }

    /**
     * @param status
     */
    public void setStatus(String status) {
        this.status = status == null ? null : status.trim();
    }

    /**
     * @return remark
     */
    public String getRemark() {
        return remark;
    }

    /**
     * @param remark
     */
    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }

    public String getBipApprovalNumber() {
        return bipApprovalNumber;
    }

    public void setBipApprovalNumber(String bipApprovalNumber) {
        this.bipApprovalNumber = bipApprovalNumber;
    }

    public Boolean getFinalSigned() {
        return isFinalSigned;
    }

    public void setFinalSigned(Boolean finalSigned) {
        isFinalSigned = finalSigned;
    }

    /**
     * @return gmt_create
     */
    public Date getGmtCreate() {
        return gmtCreate;
    }

    /**
     * @param gmtCreate
     */
    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    /**
     * @return created_by
     */
    public String getCreatedBy() {
        return createdBy;
    }

    /**
     * @param createdBy
     */
    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy == null ? null : createdBy.trim();
    }

    /**
     * @return gmt_modified
     */
    public Date getGmtModified() {
        return gmtModified;
    }

    /**
     * @param gmtModified
     */
    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    /**
     * @return modified_by
     */
    public String getModifiedBy() {
        return modifiedBy;
    }

    /**
     * @param modifiedBy
     */
    public void setModifiedBy(String modifiedBy) {
        this.modifiedBy = modifiedBy == null ? null : modifiedBy.trim();
    }

    public String getContractTypeName() {
        return contractTypeName;
    }

    public void setContractTypeName(String contractTypeName) {
        this.contractTypeName = contractTypeName;
    }

    public String getPaymentMethodName() {
        return paymentMethodName;
    }

    public void setPaymentMethodName(String paymentMethodName) {
        this.paymentMethodName = paymentMethodName;
    }

    public String getContractParentCode() {
        return contractParentCode;
    }

    public void setContractParentCode(String contractParentCode) {
        this.contractParentCode = contractParentCode;
    }

    public Integer getPayments() {
        return payments;
    }

    public void setPayments(Integer payments) {
        this.payments = payments;
    }

    public Integer getPaidPayments() {
        return paidPayments;
    }

    public void setPaidPayments(Integer paidPayments) {
        this.paidPayments = paidPayments;
    }
}