package com.cyksj.model.views;

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

import java.util.List;

/**
 * 项目名: yhlxj2
 * 文件名: CpsGoodsDonDistributeView
 * 创建者: JavaZou
 * 创建时间:2024/9/9 14:21
 */
@Getter
@Setter
@SearchBean(tables = "goods_don g left join user_plat_distribute_rate upr on upr.goods_id = g.id :distribute_id:" +
		" left join business_distribute_default_rate_config bddr on bddr.goods_id = g.id",
		where = "g.type = 1 and g.deleted is true and g.status is true and g.is_distribute is true")
public class CpsGoodsDonDistributeView {
	@DbField("g.id")
	private Long id;

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

	@DbField("g.type")
	private Integer type;

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

	@DbField("ifnull(upr.rate,bddr.rate)")
	private Integer rate;

	@JsonIgnore
	@DbField("g.is_sku_distribute")
	private Boolean isSkuDistribute;

	@DbIgnore
	private List<GoodsDonSku> skus;
}
