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;

/**
 * 项目名: yhlxj
 * 文件名: DistributePlatOrderDonBrokenLineView
 * 创建者: JavaZou
 * 创建时间:2023/11/17 18:05
 */
@Getter
@Setter
@SearchBean(tables = "(select order_id from distribute_waiting_send_points dp :sid:) dp inner join order_don od on od.id = dp.order_id",
		where = "od.status not in ('noPayment','close','refund')",
		groupBy = "od.goods_id,date_format(od.created_time,'%Y-%m-%d')")
public class DistributePlatOrderDonBrokenLineView {
	@DbField("od.goods_id")
	private Long goodsId;

	/**
	 * 平台名称
	 */
	@DbField("select title from goods_don where id = od.goods_id")
	private String goodsTitle;

	/**
	 * 当前日期订单金额
	 */
	@DbField("cast(sum(od.money)/100 as decimal(10,2))")
	private BigDecimal money;

	/**
	 * 日期
	 */
	@DbField("date_format(od.created_time,'%Y-%m-%d')")
	private String date;
}
