package com.cyksj.model.views;

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

/*
 *项目名: netflix
 *文件名: BusinessDistributeRateView
 *创建者: JavaZou
 *创建时间:2023/4/19 14:21
 */
@Getter
@Setter
@SearchBean(tables = "goods_don g left join business_distribute_default_rate_config bc on g.id = bc.goods_id",
		where = "g.deleted is true and g.status is true and g.is_distribute is true",
		orderBy = "g.id")
public class BusinessDistributeRateView {
	@DbField("bc.id")
	private Long id;

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

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

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

	/**
	 * 默认选择一个分类
	 */
	@DbField("select gc.name from goods_don_category_relate gcr inner join goods_don_category gc on gc.id = gcr.category where gcr.goods_id = g.id order by gc.id limit 1")
	private String categoryName;

	@DbField("bc.rate")
	private Integer rate = 0;

	@DbField("bc.second_rate")
	private Integer secondRate = 0;
}
