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;

/**
 * 项目名: yhlxj2
 * 文件名: UserMirrorShopOrderView
 * 创建者: JavaZou
 * 创建时间:2024/11/12 15:30
 */
@Getter
@Setter
@SearchBean(tables = "(select o.id,o.goods_id,o.money,o.created_time from order_don o inner join user_mirror_shop_order_relate uor on uor.order_id = o.id :mid: where o.status not in ('close','noPayment') :time:) od" +
		" left join goods_don g on g.id = od.goods_id" +
		" inner join user_mirror_shop_distribute_waiting_send_points dp on dp.order_id = od.id",
		groupBy = "od.goods_id,g.title,date_format(od.created_time,'%Y-%m-%d')")
public class UserMirrorShopOrderView {

	@DbField("od.goods_id")
	private Long goodsId;

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

	@DbField("cast(sum(od.money)/100 as decimal(10,2))")
	private BigDecimal distributeOrderMoney;

	@DbField("count(od.id)")
	private Integer orders;

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