package com.cyksj.model.manage.views;

import com.cyksj.model.entity.OrderDon;
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
 *文件名: CorpWxOrderDonView
 *创建者: JavaZou
 *创建时间:2023/4/28 10:19
 */
@Getter
@Setter
@SearchBean(tables = "order_don o left join goods_don_sku sku on o.sku_id = sku.id " +
		"left join goods_don g on g.id = sku.goods_id " +
		"left join groups_relation gr on gr.id = o.relation_id " +
		"left join user u on u.id = o.user_id")
public class CorpWxOrderDonView {
	@DbField("o.id")
	private Long id;

	@DbField("o.relation_id")
	private Long relationId;

	@DbField("g.type")
	private Integer goodsDonType;

	@DbField("g.second_type")
	private Integer secondType;

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

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

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

	@DbField("gr.account")
	private String account;

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

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

	@DbField("sku.months")
	private Integer months;

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

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

	@DbField("o.balance")
	private BigDecimal balance;

	@DbField("o.refund_money")
	private BigDecimal refundMoney;

	@DbField("o.status")
	private OrderDon.Status status;

	@DbField("o.type")
	private OrderDon.Type type;

	@DbField("o.order_type")
	private Integer orderType;

	@DbField("o.num")
	private Integer num;

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

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

	@DbField("select gr.expiry_time from groups_relation gr where gr.id = o.relation_id and gr.user_id = o.user_id and o.status not in ('close','noPayment','refund')")
	private Date expiryTime;

	@DbField("o.pay_title")
	private String payTitle;

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

	@DbField("sku.num")
	private Integer skuNum;
}
