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;

@Table(name = "wx_merchant_tax")
public class WxMerchantTax 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;
	}
	
	
	
	/*租户ID**/
	@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
	private String tenantId;
	/*商户ID**/
	@io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId")
	private Long merchantId;
	/*纳税人类型1一般纳税人2小规模纳税人**/
	@io.swagger.annotations.ApiModelProperty(value="纳税人类型1一般纳税人2小规模纳税人",name="taxpayerType")
	private Integer taxpayerType;
	/*纳税证件类型1企业登记证2营业执照3组织机构代码证4税务登记证5银行开户许可证**/
	@io.swagger.annotations.ApiModelProperty(value="纳税证件类型1企业登记证2营业执照3组织机构代码证4税务登记证5银行开户许可证",name="taxPapersType")
	private Integer taxPapersType;
	/*纳税证件号码**/
	@io.swagger.annotations.ApiModelProperty(value="纳税证件号码",name="taxPapersNumber")
	private String taxPapersNumber;
	/*发票类型1增值税专用发票2普通发票3定额发票**/
	@io.swagger.annotations.ApiModelProperty(value="发票类型1增值税专用发票2普通发票3定额发票",name="invoiceType")
	private Integer invoiceType;
	/*购方名称**/
	@io.swagger.annotations.ApiModelProperty(value="购方名称",name="invoiceBuyer")
	private String invoiceBuyer;
	/*纳税人识别号**/
	@io.swagger.annotations.ApiModelProperty(value="纳税人识别号",name="taxpayerIdentifyNumber")
	private String taxpayerIdentifyNumber;
	/*开票地址及电话**/
	@io.swagger.annotations.ApiModelProperty(value="开票地址及电话",name="invoiceAddressPhone")
	private String invoiceAddressPhone;
	/*开户行及账号**/
	@io.swagger.annotations.ApiModelProperty(value="开户行及账号",name="bankAccountNumber")
	private String bankAccountNumber;
	/*开户名**/
	@io.swagger.annotations.ApiModelProperty(value="开户名",name="bankAccountPerson")
	private String bankAccountPerson;
	/*银行名称**/
	@io.swagger.annotations.ApiModelProperty(value="银行名称",name="bankName")
	private String bankName;
	/*银行账号**/
	@io.swagger.annotations.ApiModelProperty(value="银行账号",name="bankAccount")
	private String bankAccount;
	/*创建时间**/
	@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
	private Date createDate;
	/*更新时间**/
	@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate")
	private Date updateDate;
	public String  getTenantId() {
		return tenantId;
	}
	public void setTenantId(String _tenantId) {
		tenantId = _tenantId;
	}
	public Long  getMerchantId() {
		return merchantId;
	}
	public void setMerchantId(Long _merchantId) {
		merchantId = _merchantId;
	}
	public Integer  getTaxpayerType() {
		return taxpayerType;
	}
	public void setTaxpayerType(Integer _taxpayerType) {
		taxpayerType = _taxpayerType;
	}
	public Integer  getTaxPapersType() {
		return taxPapersType;
	}
	public void setTaxPapersType(Integer _taxPapersType) {
		taxPapersType = _taxPapersType;
	}
	public String  getTaxPapersNumber() {
		return taxPapersNumber;
	}
	public void setTaxPapersNumber(String _taxPapersNumber) {
		taxPapersNumber = _taxPapersNumber;
	}
	public Integer  getInvoiceType() {
		return invoiceType;
	}
	public void setInvoiceType(Integer _invoiceType) {
		invoiceType = _invoiceType;
	}
	public String  getInvoiceBuyer() {
		return invoiceBuyer;
	}
	public void setInvoiceBuyer(String _invoiceBuyer) {
		invoiceBuyer = _invoiceBuyer;
	}
	public String  getTaxpayerIdentifyNumber() {
		return taxpayerIdentifyNumber;
	}
	public void setTaxpayerIdentifyNumber(String _taxpayerIdentifyNumber) {
		taxpayerIdentifyNumber = _taxpayerIdentifyNumber;
	}
	public String  getInvoiceAddressPhone() {
		return invoiceAddressPhone;
	}
	public void setInvoiceAddressPhone(String _invoiceAddressPhone) {
		invoiceAddressPhone = _invoiceAddressPhone;
	}
	public String  getBankAccountNumber() {
		return bankAccountNumber;
	}
	public void setBankAccountNumber(String _bankAccountNumber) {
		bankAccountNumber = _bankAccountNumber;
	}
	public String  getBankAccountPerson() {
		return bankAccountPerson;
	}
	public void setBankAccountPerson(String _bankAccountPerson) {
		bankAccountPerson = _bankAccountPerson;
	}
	public String  getBankName() {
		return bankName;
	}
	public void setBankName(String _bankName) {
		bankName = _bankName;
	}
	public String  getBankAccount() {
		return bankAccount;
	}
	public void setBankAccount(String _bankAccount) {
		bankAccount = _bankAccount;
	}
	public Date  getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date _createDate) {
		createDate = _createDate;
	}
	public Date  getUpdateDate() {
		return updateDate;
	}
	public void setUpdateDate(Date _updateDate) {
		updateDate = _updateDate;
	}



	public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
			,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
			,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC")
			,TaxpayerType_ASC("`taxpayerType` ASC"),TaxpayerType_DESC("`taxpayerType` DESC")
			,TaxPapersType_ASC("`taxPapersType` ASC"),TaxPapersType_DESC("`taxPapersType` DESC")
			,TaxPapersNumber_ASC("`taxPapersNumber` ASC"),TaxPapersNumber_DESC("`taxPapersNumber` DESC")
			,InvoiceType_ASC("`invoiceType` ASC"),InvoiceType_DESC("`invoiceType` DESC")
			,InvoiceBuyer_ASC("`invoiceBuyer` ASC"),InvoiceBuyer_DESC("`invoiceBuyer` DESC")
			,TaxpayerIdentifyNumber_ASC("`taxpayerIdentifyNumber` ASC"),TaxpayerIdentifyNumber_DESC("`taxpayerIdentifyNumber` DESC")
			,InvoiceAddressPhone_ASC("`invoiceAddressPhone` ASC"),InvoiceAddressPhone_DESC("`invoiceAddressPhone` DESC")
			,BankAccountNumber_ASC("`bankAccountNumber` ASC"),BankAccountNumber_DESC("`bankAccountNumber` DESC")
			,BankAccountPerson_ASC("`bankAccountPerson` ASC"),BankAccountPerson_DESC("`bankAccountPerson` DESC")
			,BankName_ASC("`bankName` ASC"),BankName_DESC("`bankName` DESC")
			,BankAccount_ASC("`bankAccount` ASC"),BankAccount_DESC("`bankAccount` DESC")
			,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC")
			,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` 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));
		}
	}
}
