package com.cyksj.model.views;

import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.DbIgnore;
import com.ejlchina.searcher.bean.SearchBean;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author zwhui
 * @date 2024/4/24 15:20
 */
@Data
@SearchBean(tables = "renew_upgrade_package up left join goods_don g on up.goods_id = g.id " +
        " left join goods_don_sku sku on sku.id = up.sku_id"
        , where = "up.deleted = true :sku:",
        orderBy = "up.update_time desc")
public class RenewUpgradePackageView {
    @DbField("up.id")
    private Long id;

    /**
     * 套餐名称
     */
    @DbField("up.name")
    private String name;

    /**
     * 商品id
     */
    @DbField("up.goods_id")
    private Long goodsId;

    /**
     * 商品名称
     */
    @DbField("g.title")
    private String goodsName;

    /**
     * 商品规格id
     */
    @DbField("up.sku_id")
    private Long skuId;

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

    /**
     * 升级规格
     */
    @DbField("up.upgrade_sku_ids")
    private String upgradeSkuIds;

    /**
     * 商品规格名称
     */
    @DbIgnore
    private String upgradeSpecVal;


    /**
     * 备注
     */
    @DbField("up.remark")
    private String remark;


    @DbField("up.discount")
    private BigDecimal discount;

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

    /**
     * true 上架 / false 下架
     */
    @DbField("up.status")
    private Boolean status;

	/**
	 * true 存在 / false 删除
	 */
	@DbField("up.deleted")
	private Boolean deleted;

	@DbField("up.created_time")
	private Date createdTime;

	@DbField("up.update_time")
	private Date updateTime;
}
