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;

/**
 * 项目名: yhlxj
 * 文件名: GroupsRelationIndependentView
 * 创建者: JavaZou
 * 创建时间:2023/11/27 15:10
 */

@Getter
@Setter
@SearchBean(tables = "order_don o inner join groups_relation gr on gr.id = o.relation_id and gr.user_id = o.user_id" +
		" left join groups_relation_independent_renew gnr on gnr.order_id = o.id" +
		" inner join user u on u.id = gr.user_id" +
		" left join goods_don g on g.id = o.goods_id" +
		" left join groups_trips gt on gt.id = gr.groups_id" +
		" left join goods_don_sku sku on sku.id = gt.sku_id" +
		" left join account a on a.id = gt.account_id" +
		" left join goods_don_sku sku2 on sku2.id = o.sku_id",
		where = ":condition:")
public class GroupsRelationIndependentView {
	@DbField("gr.id")
	private Long relationId;

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

	@DbField("o.id")
	private Long orderId;

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

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

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

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

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

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

	@DbField("a.expiry_time")
	private Date accountExpiryTime;

	@DbField("ifnull(gnr.is_renew,false)")
	private Boolean isRenew;

	@DbField("ifnull(o.pay_time,o.created_time)")
	private Date submitTime;

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

	@DbField("sku.id")
	private Long skuId;

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

	@DbField("sku.spec_val")
	private String specVal;

	@DbField("if(gnr.is_renew,gnr.update_time,null)")
	private Date updateTime;

	@DbField("o.sku_id")
	private Long renewSkuId;

	@DbField("sku2.spec_val")
	private String renewSpecVal;
}
