package com.cyksj.model.views;

import com.cyksj.model.entity.GoodsDon;
import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.DbIgnore;
import com.ejlchina.searcher.bean.SearchBean;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.List;

/*
 *项目名: yhlxj
 *文件名: YhShopGoodsFrontView
 *创建者: JavaZou
 *创建时间:2023/9/19 15:50
 */
@Getter
@Setter
@SearchBean(tables = "(select ys.goods_id,min(ys.price) as price from yh_shop_goods_sku ys left join goods_don_sku sku on sku.id = ys.sku_id where sku.status is true and ys.status is true and ys.deleted is true :condition: group by ys.goods_id) yg" +
		" inner join goods_don g on g.id = yg.goods_id",
		where = "g.deleted is true and g.status is true and g.is_distribute is true",
		orderBy = "g.sort_by asc, g.id")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class YhShopGoodsFrontView {
	@DbField("g.id")
	private Long id;

	/**
	 * 商品名称
	 */
	@DbField("g.title")
	private String title;

	/**
	 * 标签
	 */
	@DbField("g.tags")
	private String tags;

	/**
	 * 缩略图
	 */
	@DbField("g.logo")
	private String logo;

	/**
	 * 背景图
	 */
	@DbField("g.img")
	private String img;

	/**
	 * 视频封面
	 */
	@DbField("g.video_cover")
	private String videoCover;

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

	/**
	 * 类型
	 */
	@DbField("g.type")
	private Integer type;

	/**
	 * 分类
	 * 1、AI  2、流媒体
	 */
	@DbField("g.category")
	private Long category;

	@DbField("g.second_type")
	private Integer secondType;

	@DbField("g.special_type")
	private GoodsDon.SpecialType specialType;

	/**
	 * 是否是第三方平台
	 */
	@DbField("g.is_third_goods")
	private Boolean isThirdGoods;

	/**
	 * 店铺最低规格价格
	 */
	@DbField("yg.price")
	private BigDecimal price;

	/**
	 * 最低规格月份
	 */
	@DbField("g.min_months")
	private Integer months;

	/**
	 * 最低规格天数
	 */
	@DbField("g.min_days")
	private Integer days;

	/**
	 * 已售
	 */
	@DbField("g.virtual_sold")
	private Integer sold;

	@DbIgnore
	private BigDecimal specificPrice;

	@DbIgnore
	private Long specificSkuId;

	@DbField("g.pay_desc")
	private String payDesc;

	@DbField("g.buy_desc")
	private String buyDesc;

	/**
	 * 是否是特定价格平台
	 */
	@DbField("g.is_sp")
	private Boolean isSp;

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

	/**
	 * 购买通知信息
	 */
	@DbIgnore
	private String notifyMsg;

	@DbIgnore
	private List<YhShopGoodsSkuFrontView> skuList;

	@DbIgnore
	private GoodsDonSpecFrontView specs;

	@DbIgnore
	private OrderCommentFrontView comments;
}
