package com.cyksj.model.views;

import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.SearchBean;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 项目名: yhlxj
 * 文件名: UserInvoiceApplyRecordView
 * 创建者: JavaZou
 * 创建时间:2024/12/13 15:45
 */
@Getter
@Setter
@SearchBean(tables = "user_invoice_apply_record uar inner join user_invoice_order_relate uor on uor.record_id = uar.id" +
		" left join order_don o on o.id = uor.order_id and uor.type = 1" +
		" left join upgrade_order_don uod on uod.id = uor.order_id and uor.type = 2" +
		" left join vip_order_don vod on vod.id = uor.order_id and uor.type = 3"
		, groupBy = "uar.id,uar.user_id,uar.money,uar.zfb_payment,uar.head,uar.tax_no,uar.bank,uar.bank_no,uar.email,uar.status,uar.invoice_img,uar.created_time,uar.update_time")
public class UserInvoiceApplyRecordView {

	@DbField("uar.id")
	private Long id;

	@DbField("uar.user_id")
	private Long userId;

	@DbField("uar.money")
	private BigDecimal money;

	/**
	 * 支付宝支付主体
	 */
	@DbField("uar.zfb_payment")
	private String zfbPayment;

	/**
	 * 发票头部信息
	 */
	@DbField("uar.head")
	private String head;

	/**
	 * 税号
	 */
	@DbField("uar.tax_no")
	private String taxNo;

	/**
	 * 银行
	 */
	@DbField("uar.bank")
	private String bank;

	/**
	 * 银行
	 */
	@DbField("uar.bank_no")
	private String bankNo;

	@DbField("uar.email")
	private String email;

	@DbField("uar.file_name")
	private String fileName;

	/**
	 * 0待开票 1已上传 2已发送
	 */
	@DbField("uar.status")
	private Integer status;

	/**
	 * 发票
	 */
	@DbField("uar.invoice_img")
	private String invoiceImg;

	@DbField("group_concat(ifnull(o.order_no,ifnull(uod.order_no,vod.order_no)))")
	private String orderNoStr;

	@DbField("uar.created_time")
	private Date createdTime;

	@DbField("uar.update_time")
	private Date updateTime;
}
