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;
import java.util.Date;

/**
 * 项目名: yhlxj
 * 文件名: UserNfView
 * 创建者: JavaZou
 * 创建时间:2024/8/20 10:24
 */
@Getter
@Setter
@SearchBean(tables = "(select distinct user_id from order_don where goods_id = 1 and status not in ('close','noPayment','refund') group by user_id,date_format(created_time,'%Y-%m') having count(*) > 2) o inner join user u on u.id = o.user_id")
public class UserNfView {
	/**
	 * id
	 */
	@DbField("u.id")
	private Long id;

	/**
	 * 名称
	 */
	@DbField("u.nickname")
	private String nickname;

	/**
	 * 绑定手机号
	 */
	@DbIgnore
	private String bindPhone;

	/**
	 * 绑定邮箱
	 */
	@DbIgnore
	private String bindEmail;

	/**
	 * 头像
	 */
	@DbField("u.headimgurl")
	private String headimgurl;

	/**
	 * 积分
	 */
	@DbField("u.points")
	private BigDecimal points;

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

	@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.show_id")
	private String showId;

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

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

	@DbField("u.register_env")
	private String registerEnv;

	@DbField("u.last_time")
	private Date lastTime;

	@DbField("u.is_black")
	private Boolean isBlack;

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

	/**
	 * 创建时间
	 */
	@DbField("u.created_time")
	private Date createdTime;

	/**
	 * 最后更新时间
	 */
	@DbField("u.update_time")
	private Date updateTime;
}
