package com.cyksj.model.views;

import com.cyksj.model.entity.GoodsWholesaleOrderDon;
import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.SearchBean;
import lombok.Getter;
import lombok.Setter;

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

/**
 * 项目名: yhlxj
 * 文件名: GoodsWholesaleOrderView
 * 创建者: JavaZou
 * 创建时间:2024/8/26 14:51
 */
@Getter
@Setter
@SearchBean(tables = "goods_wholesale_order_don go left join goods_don_sku sku on sku.id = go.sku_id" +
		" left join goods_don g on g.id = go.goods_id " +
		" left join user u on u.id = go.user_id")
public class GoodsWholesaleOrderView {

	@DbField("go.id")
	private Long id;

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

	@DbField("go.sku_id")
	private Long skuId;

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

	@DbField("sku.spec_val")
	private String specVal;

	@DbField("go.num")
	private Integer num;

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

	@DbField("u.nickname")
	private String nickname;

	@DbField("go.order_no")
	private String orderNo;

	@DbField("go.transaction_id")
	private String transactionId;

	@DbField("go.money")
	private BigDecimal money;

	@DbField("go.balance")
	private BigDecimal balance;

	@DbField("go.status")
	private GoodsWholesaleOrderDon.Status status;

	@DbField("go.type")
	private GoodsWholesaleOrderDon.Type type;

	@DbField("go.pay_time")
	private Date payTime;

	@DbField("go.source")
	private String source;

	@DbField("select count(1) > 0 from goods_wholesale_user_account gwua where gwua.order_id = go.id")
	private Boolean isAccount;

	@DbField("go.created_time")
	private Date createdTime;
}
