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
 * 文件名: UserInvoiceOrderViews
 * 创建者: JavaZou
 * 创建时间:2024/12/13 17:23
 */
@Getter
@Setter
@SearchBean(tables = "user_invoice_order_relate uor 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 " +
		" left join goods_don g on (g.id = o.goods_id or g.id = uod.goods_id or g.id = vod.goods_id)" +
		" left join goods_don_sku sku on (sku.id = o.sku_id or sku.id = uod.sku_id)")
public class UserInvoiceOrderViews {

	@DbField("uor.record_id")
	private Long recordId;

	@DbField("uor.type")
	private Integer type;

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

	@DbField("ifnull(o.money,ifnull(uod.money,vod.money))")
	private BigDecimal money;

	@DbField("g.title")
	private String title;

	@DbField("sku.spec_val")
	private String specVal;

	@DbField("g.logo")
	private String logo;

	@DbField("ifnull(o.pay_time,ifnull(uod.pay_time,vod.pay_time))")
	private Date payTime;
}
