package com.cyksj.model.views;

import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.DbIgnore;
import com.ejlchina.searcher.bean.SearchBean;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;

/**
 * 项目名: yhlxj
 * 文件名: GoodsWholesaleFrontView
 * 创建者: JavaZou
 * 创建时间:2024/8/26 17:46
 */
@Getter
@Setter
@SearchBean(tables = "goods_wholesale gw" +
		" inner join goods_don g on g.id = gw.goods_id and g.status is true and g.deleted is true" +
		" inner join goods_don_sku sku on sku.id = gw.sku_id and sku.status is true",
		where = "gw.status is true and gw.deleted is true",
		orderBy = "gw.sorted asc")
public class GoodsWholesaleFrontView {
	@DbField("gw.id")
	private Long id;

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

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

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

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

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

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

	@DbField("gw.sku_name")
	private String skuName;

	@DbField("sku.price")
	private BigDecimal price;

	@DbField("ifnull(gw.picture,sku.picture)")
	private String picture;

	@DbField("gw.config")
	private String config;

	@DbField("gw.is_return")
	private Boolean isReturn;

	@DbIgnore
	private Integer total;

	@DbField("gw.sorted")
	private Integer sorted;
}
