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.util.Date;

/**
 * 项目名: yhlxj
 * 文件名: CouponUsedDetailView
 * 创建者: JavaZou
 * 创建时间:2024/4/16 17:05
 */
@Getter
@Setter
@SearchBean(tables = "(select id,name from coupon where deleted is true :cid:) c inner join coupon_user cu on cu.coupon_id = c.id inner join user u on u.id = cu.user_id" +
		" inner join order_don o on o.coupon_user_id = cu.id and o.status not in ('close','noPayment','refund')" +
		" left join goods_don g on g.id = o.goods_id" +
		" left join goods_don_sku sku on sku.id = o.sku_id")
public class CouponUsedDetailView {

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

	@DbField("c.id")
	private Long couponId;

	@DbField("c.name")
	private String name;

	@DbField("u.id")
	private Long userId;

	@DbField("u.nickname")
	private String nickname;

	@DbField("o.order_no")
	private String orderNo;

	@DbField("cu.created_time")
	private Date receiptTime;

	@DbField("sku.id")
	private Long skuId;

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

	@DbField("g.id")
	private Long goodsId;

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

	@DbField("o.created_time")
	private Date usedTime;
}
