package com.cyksj.model.views;

import com.cyksj.model.entity.VipOrderDon;
import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.DbIgnore;
import com.ejlchina.searcher.bean.SearchBean;
import lombok.Getter;
import lombok.Setter;

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

/**
 * 项目名: yhlxj2
 * 文件名: CmsVipOrderDonView
 * 创建者: JavaZou
 * 创建时间:2025/5/13 15:49
 */
@Getter
@Setter
@SearchBean(tables = "vip_order_don o left join user u on u.id = o.user_id",
		where = ":condition:"
)
public class CmsVipOrderDonView {
	@DbField("o.id")
	private Long id;

	@DbIgnore
	private String channel;

	@DbField("o.order_no")
	private String orderNo;

	@DbField("o.order_type")
	private Integer orderType;

	@DbField("o.transaction_id")
	private String transactionId;

	@DbField("o.user_id")
	private Long userId;

	@DbField("u.nickname")
	private String nickname;

	@DbField("case when u.login_phone != '' then 'phone' when u.email != '' then 'email' when u.open_id != '' then 'wechat' else 'wechat' end")
	private String register;

	/**
	 * 登录注册手机号
	 */
	@DbField("u.login_phone")
	private String loginPhone;

	/**
	 * 登录注册邮箱
	 */
	@DbField("u.email")
	private String email;

	@DbField("o.num")
	private Integer num;

	@DbField("o.money")
	private BigDecimal money;

	/**
	 * 实际抵扣金额
	 */
	@DbField("o.actually_deduct_money")
	private BigDecimal actuallyDeductMoney = BigDecimal.ZERO;

	@DbField("o.balance")
	private BigDecimal balance;

	@DbField("o.refund_money")
	private BigDecimal refundMoney;

	@DbField("o.refund_balance")
	private BigDecimal refundBalance;

	@DbField("o.refund_desc")
	private String refundDesc;

	@DbField("o.status")
	private VipOrderDon.Status status;

	@DbField("o.type")
	private VipOrderDon.Type type;

	@DbField("o.popularize_id")
	private Long popularizeId;

	@DbField("o.pay_time")
	private Date payTime;

	@DbField("o.pay_title")
	private String payTitle;

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

	/**
	 * 银河币
	 */
	@DbIgnore
	private BigDecimal galaxyCoin;

	/**
	 * 银河币抵扣金额
	 */
	@DbIgnore
	private BigDecimal galaxyCoinDeductMoney;
}
