package com.cyksj.model.views;

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

import java.util.Date;

/*
 *项目名: netflix
 *文件名: ExchangeCodeView
 *创建者: JavaZou
 *创建时间:2022/11/7 16:25
 */
@Getter
@Setter
@SearchBean(tables = "exchange_code ec left join user u on u.id = ec.user_id" +
		" left join goods_don gd on ec.goods_id = gd.id" +
		" left join goods_don_sku gdk on gdk.id = ec.sku_id",
where = "ec.type = 0")
public class ExchangeCodeView {
	@DbField("ec.id")
	private Long id;

	@DbField("ec.code")
	private String code;

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

	@DbField("ec.sku_id")
	private Long skuId;

	/**
	 * 平台名称
	 */
	@DbField("gd.title")
	private String title;

	/**
	 * 规格名称,金额
	 */
	@DbField("concat(gdk.spec_val,'',cast(gdk.price/100 as decimal(10,2)))")
	private String specVal;

	/**
	 * 使用状态
	 */
	@DbField("ec.use_status")
	private Boolean useStatus;

	/**
	 * 使用时间
	 */
	@DbField("ec.use_time")
	private Date useTime;

	/**
	 * 使用人id
	 */
	@DbField("ec.user_id")
	private Long userId;

	@DbField("ec.operator")
	private String operator;

	/**
	 * 用户昵称
	 */
	@DbField("u.nickname")
	private String nickName;

	/**
	 * 生成日期
	 */
	@DbField("ec.created_time")
	private Date createdTime;
}
