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;

/*
 *项目名: netflix
 *文件名: GiftCardUserPayFrontView
 *创建者: JavaZou
 *创建时间:2023/8/29 17:33
 * 购买的礼品卡
 */
@Getter
@Setter
@SearchBean(tables = "(select * from gift_card_user_record where is_pay is true :condition:) gr left join user u on u.id = gr.user_id" +
		" left join user u2 on u2.id = gr.to_user_id" +
		" left join goods_don g on gr.gc_goods_id = g.id" +
		" left join goods_don_sku sku on sku.id = gr.gc_sku_id")
public class GiftCardUserPayFrontView {
	@DbField("gr.id")
	private Long id;

	@DbField("gr.gc_type")
	private Integer gcType;

	@DbField("gr.gc_detail")
	private String gcDetail;

	/**
	 * 赠送人
	 */
	@DbField("u.nickname")
	private String donor;

	@DbField("gr.cash")
	private BigDecimal cash;

	@DbField("gr.gc_goods_id")
	private Long gcGoodsId;

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

	@DbField("gr.gc_sku_id")
	private Long gcSkuId;

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

	@DbField("gr.remain_cash")
	private BigDecimal remainCash;

	@DbField("gr.is_send")
	private Boolean isSend;

	@DbField("gr.rc")
	private String code;

	@DbField("gr.pay_time")
	private Date payTime;

	@DbField("gr.received_time")
	private Date receivedTime;

	/**
	 * 默认未使用
	 */
	@DbField("gr.is_used")
	private Boolean isUsed;

	@DbField("gr.type")
	private String gcShowType;

	@DbField("gr.img")
	private String gcImg;

	@DbField("if(user_id in :uid:,1,2)")
	private Integer type;

	@DbField("u2.nickname")
	private String toNickname;
}
