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;

/**
 * 项目名: yhlxj11111111
 * 文件名: DistributeWaitingPointsOrderDetailView
 * 创建者: JavaZou
 * 创建时间:2025/8/27 11:20
 */
@Getter
@Setter
@SearchBean(tables = "(select * from distribute_waiting_send_points where user_id = :uid:) dw" +
		" inner join order_don o on o.id = dw.order_id" +
		" left join goods_don_sku sku on sku.id = o.sku_id")
public class DistributeWaitingPointsOrderDetailView {

	@DbField("dw.user_id")
	@JsonIgnore
	private Long userId;

	/**
	 * 首单订单ID
	 */
	@DbField("dw.order_id")
	private Long orderId;

	/**
	 * 规格
	 */
	@DbField("sku.spec_val")
	private String specVal;

	/**
	 * 订单金额
	 */
	@DbField("o.money")
	private BigDecimal orderMoney;

	@DbField("dw.send_status")
	private DistributeWaitingSendPoints.Status status;

	/**
	 * 返现提成
	 */
	@DbField("TRUNCATE(dw.points/1000,2)")
	private BigDecimal reMoney = BigDecimal.ZERO;
}
