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;

/**
 * 项目名: yhlxj2
 * 文件名: GoodsDonSubsidyDetailView
 * 创建者: JavaZou
 * 创建时间:2024/4/11 14:44
 */
@Getter
@Setter
@SearchBean(tables = "goods_don_sku_subsidy gs inner join goods_don_sku sku on gs.sku_id = sku.id inner join goods_don g on sku.goods_id = g.id",
		where = "gs.status is true and gs.deleted is true and sku.status is true and g.deleted is true"
		, groupBy = "g.id,g.title,g.tags,g.virtual_sold,g.sort_by",
		orderBy = "g.sort_by asc, g.id")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GoodsDonSubsidyDetailView {
	@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.match_img")
	private String matchImg;


	/**
	 * 是否贴片 false
	 */
	@DbField("g.is_patch")
	private Boolean isPatch;

	/**
	 * H5标签
	 */
	@DbField("g.mobile_tags")
	private String mobileTags;

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

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

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

	/**
	 * 最低规格价格
	 */
	@DbField("min(gs.price)")
	private BigDecimal price;

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

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

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

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

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

	@DbIgnore
	private List<GoodsDonSkuSubsidyDetailView> skuList;

	@DbIgnore
	private GoodsDonSpecFrontView specs;

	@DbIgnore
	private OrderCommentFrontView comments;
}
