package com.cyksj.model.views;

import com.cyksj.model.entity.DistributeWaitingSendPoints;
import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.SearchBean;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;

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

/*
 *项目名: netflix
 *文件名: DistributeOrdersDetailView
 *创建者: JavaZou
 *创建时间:2022/12/12 15:36
 */
@Getter
@Setter
@SearchBean(tables = "distribute_waiting_send_points dp left join order_don od on od.id = dp.order_id and dp.is_vip = false" +
		" left join vip_order_don vod on vod.id = dp.order_id and dp.is_vip = true" +
		" inner join user u on u.id = dp.user_id" +
		" left join goods_don gd on gd.id = ifnull(od.goods_id,vod.goods_id)")
public class DistributeOrdersDetailView {
	@DbField("u.nickname")
	private String nickname;

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

	@DbField("dp.shared_id")
	@JsonIgnore
	private Long sharedId;

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

	@DbField("gd.title")
	private String platform;

	@DbField("if(od.id is null,vod.money,if(od.is_dp and od.ori_money != 0,od.ori_money,od.money))")
	private BigDecimal money;

	@DbField("ifnull(od.created_time,vod.created_time)")
	private Date orderTime;

	@DbField("dp.points")
	private BigDecimal points;

	@DbField("dp.is_rule")
	private Boolean isRule;

	@DbField("dp.send_status")
	private DistributeWaitingSendPoints.Status sendStatus;
}
