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;

/*
 *项目名: netflix
 *文件名: PersonDistributeBrokenLineView
 *创建者: JavaZou
 *创建时间:2023/3/8 14:40
 */
@Getter
@Setter
@SearchBean(tables = "distribute_waiting_send_points dw left join order_don od on od.id = dw.order_id"
		, where = ":userId: and od.is_distribute is true and dw.send_status not in ('not_exist','close')"
		, groupBy = "od.goods_id,date_format(od.created_time,'%Y-%m-%d')")
public class PersonDistributeBrokenLineView {
	@DbField("od.goods_id")
	private Long goodsId;

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

	/**
	 * 当前日期订单数
	 */
	@DbField("count(od.id)")
	private Integer orderNum;

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

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