package com.cyksj.model.views;

import com.cyksj.model.dto.RealGoodsConfigDto;
import com.cyksj.model.entity.GoodsDon;
import com.cyksj.model.entity.GoodsDonSpec;
import com.cyksj.model.entity.HomeManagementConfig;
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.Date;
import java.util.List;

/*
 *项目名: netflix
 *文件名: HomeManagementFrontView
 *创建者: JavaZou
 *创建时间:2023/8/18 9:36
 */
@Getter
@Setter
@SearchBean(tables = "(select * from home_management_config where status is true and deleted is true) hc left join goods_don g on g.id = hc.goods_id",
		where = ":condition:",
		orderBy = "hc.sorted asc")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class HomeManagementFrontView {
	@DbField("hc.id")
	private Long homeManageConfigId;

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

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

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

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

	@DbField("g.is_owns")
	private Boolean isOwns;

	@DbField("hc.url")
	private String url;

	@DbField("hc.type")
	private HomeManagementConfig.Type type;

	@DbField("hc.ad_type")
	private HomeManagementConfig.AdType adType;

	@DbField("hc.is_shop")
	private Boolean isShop;

	@DbField("hc.rg_type")
	private HomeManagementConfig.RgType rgType;

	@DbField("hc.rg_price")
	private BigDecimal rgPrice;

	@DbField("hc.rg_sub_title")
	private String rgSubTitle;

	@DbField("hc.pic")
	private String pic;

	@DbField("hc.tag")
	private String tag;

	/**
	 * 跳转类型
	 */
	@DbField("hc.jump_type")
	private Integer jumpType;

	/**
	 * 跳转平台
	 */
	@DbField("hc.plat_sku_ids")
	private String platSkuIds;

	/**
	 * 跳转平台
	 */
	@DbField("hc.jump_title")
	private String jumpTitle;

	/**
	 * 跳转规格
	 */
	@DbField("hc.jump_spec_val")
	private String jumpSpecVal;
	/**
	 * 商品标签
	 */
	@DbField("g.tags")
	private String goodsTags;

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

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

	@DbField("g.match_img")
	private String matchImg;


	/**
	 * 渠道优惠折扣
	 */
	@DbIgnore
	private BigDecimal channelDiscount;

	/**
	 * 优惠价格
	 */
	@DbIgnore
	private BigDecimal discountPrice;

	/**
	 * 优惠折扣
	 */
	@DbIgnore
	private BigDecimal discount;

	/**
	 * 满减金额
	 */
	@DbIgnore
	private BigDecimal reduceMoney;

	/**
	 * 优惠券有效结束时间
	 */
	@DbIgnore
	private Date validEndTime;

	/**
	 * 优惠券id
	 */
	@DbIgnore
	private Long couponId;

	/**
	 * 支付来源
	 * 0全无 1.优惠券 2.渠道 3特定价格
	 */
	@DbIgnore
	private Integer source = 0;

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

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

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

	/**
	 * 最低规格价格
	 */
	@DbField("g.min_price")
	private BigDecimal price = BigDecimal.ZERO;;

	/**
	 * 最低规格月份
	 */
	@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.is_sp")
	private Boolean isSp;

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

	@DbIgnore
	private List<GoodsDonSkuFrontView> skuList;

	@DbIgnore
	private GoodsDonSpec specs;

	@DbIgnore
	private OrderCommentFrontView comments;

	@DbIgnore
	private List<RealGoodsConfigDto> subInfoList;

	/**
	 * gpt赠送天卡活动标识 默认false
	 */
	@DbIgnore
	private Boolean isGptGift = false;
}