package com.iformall.domain.po;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author gongbiao
 */
@Table(name = "wx_bill_other_deposit")
public class WxBillOtherDeposit implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    protected Long id;

    @Transient
    protected List<Long> ids;
    @Transient
    protected String sortColumns;

    public Long getId() {
        return id;
    }

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

    public String getSortColumns() {
        return sortColumns;
    }

    public List<Long> getIds() {
        return ids;
    }

    public void setIds(List<Long> ids) {
        this.ids = ids;
    }

    @Transient
    private String merchantName;

    public String getMerchantName() {
        return merchantName;
    }

    public void setMerchantName(String merchantName) {
        this.merchantName = merchantName;
    }

    @io.swagger.annotations.ApiModelProperty(value = "账单名称", name = "name")
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @io.swagger.annotations.ApiModelProperty(value = "账单备注", name = "comments")
    private String comments;

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    /*实际应收金额**/
    @io.swagger.annotations.ApiModelProperty(value = "实际应收金额", name = "receivePay")
    private Integer receivePay;
    /*实收金额**/
    @io.swagger.annotations.ApiModelProperty(value = "实收金额", name = "pay")
    private Integer pay;
    /*截止收款日期**/
    @io.swagger.annotations.ApiModelProperty(value = "截止收款日期", name = "receiveDate")
    private Date receiveDate;
    /*到账日期**/
    @io.swagger.annotations.ApiModelProperty(value = "到账日期", name = "payDate")
    private Date payDate;
    /*创建时间**/
    @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createtime")
    private Date createtime;
    /*逾期天数**/
    @io.swagger.annotations.ApiModelProperty(value = "逾期天数", name = "expiredDay")
    private Long expiredDay;
    /*租户**/
    @io.swagger.annotations.ApiModelProperty(value = "租户", name = "tenantId")
    private String tenantId;
    /*欠缴**/
    @io.swagger.annotations.ApiModelProperty(value = "欠缴", name = "owe")
    private Integer owe;
    /*账单状态1待缴2欠缴3已结清**/
    @io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期5已退还", name = "status")
    private Integer status;
    /*删除 是1否0**/
    @io.swagger.annotations.ApiModelProperty(value = "删除 是1否0", name = "isDel")
    private Integer isDel;
    /*商户ID**/
    @io.swagger.annotations.ApiModelProperty(value = "商户ID", name = "merchantId")
    private Long merchantId;
    /*账号ID**/
    @io.swagger.annotations.ApiModelProperty(value = "账号ID", name = "userId")
    private Long userId;
    /*商铺ID**/
    @io.swagger.annotations.ApiModelProperty(value = "商铺ID", name = "shopId")
    private Long shopId;
    /*更新时间**/
    @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updatetime")
    private Date updatetime;

    @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType")
    private Integer rentShopType;

    @io.swagger.annotations.ApiModelProperty(value = "退还金额", name = "returnPrice")
    private Integer returnPrice;

    public Integer getReceivePay() {
        return receivePay;
    }

    public void setReceivePay(Integer _receivePay) {
        receivePay = _receivePay;
    }

    public Integer getPay() {
        return pay;
    }

    public void setPay(Integer _pay) {
        pay = _pay;
    }

    public Date getReceiveDate() {
        return receiveDate;
    }

    public void setReceiveDate(Date _receiveDate) {
        receiveDate = _receiveDate;
    }

    public Date getPayDate() {
        return payDate;
    }

    public void setPayDate(Date _payDate) {
        payDate = _payDate;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date _createtime) {
        createtime = _createtime;
    }

    public Long getExpiredDay() {
        return expiredDay;
    }

    public void setExpiredDay(Long _expiredDay) {
        expiredDay = _expiredDay;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String _tenantId) {
        tenantId = _tenantId;
    }

    public Integer getOwe() {
        return owe;
    }

    public void setOwe(Integer _owe) {
        owe = _owe;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer _status) {
        status = _status;
    }

    public Integer getIsDel() {
        return isDel;
    }

    public void setIsDel(Integer _isDel) {
        isDel = _isDel;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long _merchantId) {
        merchantId = _merchantId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long _userId) {
        userId = _userId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long _shopId) {
        shopId = _shopId;
    }

    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date _updatetime) {
        updatetime = _updatetime;
    }

    public Integer getRentShopType() {
        return rentShopType;
    }

    public void setRentShopType(Integer rentShopType) {
        this.rentShopType = rentShopType;
    }

    public Integer getReturnPrice() {
        return returnPrice;
    }

    public void setReturnPrice(Integer returnPrice) {
        this.returnPrice = returnPrice;
    }

    public static enum Field {
        Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), ReceivePay_ASC("`receivePay` ASC"), ReceivePay_DESC("`receivePay` DESC"), Pay_ASC("`pay` ASC"), Pay_DESC("`pay` DESC"), ReceiveDate_ASC("`receiveDate` ASC"), ReceiveDate_DESC("`receiveDate` DESC"), PayDate_ASC("`payDate` ASC"), PayDate_DESC("`payDate` DESC"), Createtime_ASC("`createtime` ASC"), Createtime_DESC("`createtime` DESC"), ExpiredDay_ASC("`expiredDay` ASC"), ExpiredDay_DESC("`expiredDay` DESC"), TenantId_ASC("`tenantId` ASC"), TenantId_DESC("`tenantId` DESC"), Owe_ASC("`owe` ASC"), Owe_DESC("`owe` DESC"), Status_ASC("`status` ASC"), Status_DESC("`status` DESC"), IsDel_ASC("`isDel` ASC"), IsDel_DESC("`isDel` DESC"), MerchantId_ASC("`merchantId` ASC"), MerchantId_DESC("`merchantId` DESC"), UserId_ASC("`userId` ASC"), UserId_DESC("`userId` DESC"), ShopId_ASC("`shopId` ASC"), ShopId_DESC("`shopId` DESC"), Updatetime_ASC("`updatetime` ASC"), Updatetime_DESC("`updatetime` DESC");
        private String value;

        Field(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }

        public void setCol(String value) {
            this.value = value;
        }

        @Override
        public String toString() {
            return this.getValue();
        }
    }

    public void setSortColumns(Field... fields) {
        if (fields == null || fields.length == 0) {
            return;
        }
        for (int k = 0; k < fields.length; k++) {
            if (fields[k] == null) {
                return;
            }
        }
        StringBuilder sb = new StringBuilder(fields[0].toString());
        for (int k = 1; k < fields.length; k++) {
            sb.append(",");
            sb.append(fields[k].toString());
        }

    }

    public void setSortColumns(String sortColumns) {
        if (sortColumns == null || "".equals(sortColumns.trim())) {
            return;
        }
        if (sortColumns.contains(",")) {
            String[] cols = sortColumns.split(",");
            List<Field> fList = new ArrayList();
            for (int k = 0; k < cols.length; k++) {
                fList.add(Field.valueOf(cols[k]));
            }
            this.setSortColumns(fList.toArray(new Field[fList.size()]));
        } else {
            this.setSortColumns(Field.valueOf(sortColumns));
        }
    }
}
