package com.cyksj.model.views;

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

/**
 * 项目名: yhlxj
 * 文件名: UserSkuDistributeView
 * 创建者: JavaZou
 * 创建时间:2023/11/14 13:59
 */
@Getter
@Setter
@SearchBean(tables = "goods_don gd left join goods_don_sku sku on sku.goods_id = gd.id" +
		" left join user_plat_sku_distribute_rate up on sku.id = up.sku_id :dis_id:" +
		" left join business_distribute_default_sku_rate_config bdc on bdc.sku_id = sku.id",
		where = "gd.deleted is true and gd.status is true and gd.is_distribute is true and gd.is_sku_distribute is true and sku.status is true")
public class UserSkuDistributeView {
	@DbField("up.id")
	private Long id;

	@DbField("gd.id")
	private Long goodsId;

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

	@DbField("sku.id")
	private Long skuId;

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

	@DbField("sku.is_mirror")
	private Boolean isMirror;

	@DbField("ifnull(up.rate,bdc.rate)")
	private Integer rate;

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

	@DbField("ifnull(up.second_rate,bdc.second_rate)")
	private Integer secondRate;
}
