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_property")
public class WxBillProperty 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;
	
	/*租金合同ID**/
	@io.swagger.annotations.ApiModelProperty(value="物业合同ID",name="propertyContractId")
	private Long propertyContractId;
	/*实际应收金额**/
	@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欠缴4已结清**/
	@io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期", name = "status")
	private Integer status;
	/*是否删除 是1否0 未到期不显示**/
	@io.swagger.annotations.ApiModelProperty(value="是否删除 是1否0 未到期不显示",name="isDel")
	private Integer isDel;
	/*应收金额**/
	@io.swagger.annotations.ApiModelProperty(value="应收金额",name="needPay")
	private Integer needPay;
	/*商户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="starttime")
	private Date starttime;

	@io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime")
	private Date endtime;

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

	@io.swagger.annotations.ApiModelProperty(value = "营业额", name = "revenue")
	private Integer revenue;

	@io.swagger.annotations.ApiModelProperty(value = "滞纳金费率", name = "latePayRatio")
	private Integer latePayRatio;

	@io.swagger.annotations.ApiModelProperty(value = "滞纳金时间", name = "latePayTime")
	private Date latePayTime;

	@io.swagger.annotations.ApiModelProperty(value = "滞纳金总额", name = "latePayPrice")
	private Integer latePayPrice;

	@io.swagger.annotations.ApiModelProperty(value = "账期", name = "period")
	private Integer period;

	@io.swagger.annotations.ApiModelProperty(value = "预览账单0否1是", name = "isPreview")
	private Integer isPreview;

    @io.swagger.annotations.ApiModelProperty(value = "商铺信息", name = "shopInfo")
    private String shopInfo;

	@io.swagger.annotations.ApiModelProperty(value = "支付方式：见枚举EnumBillPayWay", name = "payWay")
	private Integer payWay;

	@io.swagger.annotations.ApiModelProperty(value = "滞纳金状态", name = "latePayStatus")
	private Integer latePayStatus;

	public Integer getLatePayStatus() {
		return latePayStatus;
	}

	public void setLatePayStatus(Integer latePayStatus) {
		this.latePayStatus = latePayStatus;
	}

	public Integer getPayWay() {
		return payWay;
	}

	public void setPayWay(Integer payWay) {
		this.payWay = payWay;
	}

    public String getShopInfo() {
        return shopInfo;
    }

    public void setShopInfo(String shopInfo) {
        this.shopInfo = shopInfo;
    }

	public Integer getIsPreview() {
		return isPreview;
	}

	public void setIsPreview(Integer isPreview) {
		this.isPreview = isPreview;
	}

	public Date getStarttime() {
		return starttime;
	}

	public void setStarttime(Date starttime) {
		this.starttime = starttime;
	}

	public Date getEndtime() {
		return endtime;
	}

	public void setEndtime(Date endtime) {
		this.endtime = endtime;
	}


	public Long getPropertyContractId() {
		return propertyContractId;
	}

	public void setPropertyContractId(Long propertyContractId) {
		this.propertyContractId = propertyContractId;
	}

	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 Integer  getNeedPay() {
		return needPay;
	}
	public void setNeedPay(Integer _needPay) {
		needPay = _needPay;
	}
	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 String getMerchantName() {
		return merchantName;
	}

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

	public Integer getRentShopType() {
		return rentShopType;
	}

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

	public Integer getRevenue() {
		return revenue;
	}

	public void setRevenue(Integer revenue) {
		this.revenue = revenue;
	}

	public Integer getLatePayRatio() {
		return latePayRatio;
	}

	public void setLatePayRatio(Integer latePayRatio) {
		this.latePayRatio = latePayRatio;
	}

	public Date getLatePayTime() {
		return latePayTime;
	}

	public void setLatePayTime(Date latePayTime) {
		this.latePayTime = latePayTime;
	}

	public Integer getLatePayPrice() {
		return latePayPrice;
	}

	public void setLatePayPrice(Integer latePayPrice) {
		this.latePayPrice = latePayPrice;
	}

	public Integer getPeriod() {
		return period;
	}

	public void setPeriod(Integer period) {
		this.period = period;
	}

	public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
			,RentContractId_ASC("`propertyContractId` ASC"),RentContractId_DESC("`propertyContractId` 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")
			,NeedPay_ASC("`needPay` ASC"),NeedPay_DESC("`needPay` 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")
			,Period_ASC("`period` ASC")
	;
		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());
		}
		this.sortColumns = sb.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));
		}
	}
}
