package com.cyksj.model.manage.views;

import com.cyksj.model.entity.GroupsRelation;
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.util.Date;

/**
 * @author chan
 * @date 2022/9/27 6:47 PM
 */
@Getter
@Setter
@SearchBean(tables = "groups_relation gr left join groups_trips gt on gr.groups_id = gt.id " +
		"left join account a on a.id = gt.account_id left join user u on gr.user_id = u.id " +
		"left join goods_don g on a.goods_id = g.id ")
public class GroupsRelationBackView {

	@DbField("gr.id")
	private Long id;

	@DbField("gt.account_id")
	private Long accountId;

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

	@DbField("a.account")
	private String tripsAccount;

	@DbField("a.password")
	private String tripsPassword;

	@DbField("a.api_secret")
	private String apiSecret;

	@DbField("a.created_time")
	private Date accountCreatedTime;

	/**
	 * 激活码
	 */
	@DbField("a.act_code")
	private String actCode;

	@DbField("if(a.api_secret='',false,true)")
	private Boolean isVerify;

	@DbField("g.id")
	private Long goodsId;

	@DbField("g.logo")
	private String logo;

	@DbField("g.type")
	private Integer goodsType;

	@DbField("g.second_type")
	private Integer goodsSecondType;

	@DbField("gr.groups_id")
	private Long groupsId;

	@DbField("g.title")
	private String title;

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

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

	@DbField("gr.start_time")
	private Date startTime;

	@DbField("gr.expiry_time")
	private Date expiryTime;

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

	@DbField("gt.num")
	private Integer gtNum;

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

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

	/**
	 * locking 锁定中
	 * overdue 过期
	 * validity 有效
	 * none 无人
	 */
	@DbField("gr.status")
	private GroupsRelation.Status status;

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

	/**
	 * 创建时间
	 */
	@DbField("gr.update_time")
	private Date update_time;

	/**
	 * 账号
	 */
	@DbField("gr.account")
	private String account;

	/**
	 * 是否是VIP
	 */
	@DbField("gr.is_vip")
	private Boolean isVip;

	@DbIgnore
	private Date updateExpiryTime;

	@DbIgnore
	private String errorMsg;

}
