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.Getter;
import lombok.Setter;

import java.math.BigDecimal;

/**
 * 项目名: yhlxj
 * 文件名: DistributeUserRankView
 * 创建者: JavaZou
 * 创建时间:2024/7/23 17:30
 */
@Getter
@Setter
@SearchBean(tables = "user_distribute_rank_statistics_record udsr left join user u on u.id = udsr.user_id",
		where = "udsr.is_present is true")
public class DistributeUserRankView {

	@DbIgnore
	private Integer rankId;

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

	@DbField("concat(LEFT(ifnull(u.nickname,udsr.nickname),1),'*',RIGHT(ifnull(u.nickname,udsr.nickname),1))")
	private String nickname;

	@DbField("ifnull(u.headimgurl,udsr.headimgurl)")
	private String headimgurl;

	@DbField("udsr.orders")
	private Integer orders = 0;

	@DbField("udsr.statistics_start_time")
	private String statisticsStartTime;

	@DbField("udsr.money")
	private BigDecimal money = BigDecimal.ZERO;

	@DbField("udsr.reward_type")
	private Integer rewardType;

	@DbField("udsr.reward")
	private String reward;

	@DbIgnore
	private Integer gapOrders;

	@DbIgnore
	private BigDecimal gapMoney;

	@DbIgnore
	private Boolean isPrize = false;
}
