package com.cyksj.model.views;

import com.cyksj.model.entity.GoodsDon;
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 com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;

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

/**
 * @author chan
 * @date 2022/9/27 11:54 AM
 */
@SearchBean(tables = "groups_relation gr left join groups_trips gt on gt.id = gr.groups_id " +
        "left join account a on a.id = gt.account_id " +
        "left join goods_don_sku sku on gt.sku_id = sku.id " +
        "left join goods_don g on g.id = sku.goods_id ",
        where = ":condition:")
@Getter
@Setter
public class RenewalView {

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

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

    @DbField("g.status")
    private Boolean goodsStatus;

    @DbField("sku.status")
    private Boolean skuStatus;

    @DbField("sku.months")
    private Integer months;

    @DbField("sku.days")
    private Integer days;

    @JsonIgnore
    @DbField("sku.num")
    private Long skuNum;

    /**
     * 是否是多人规格
     */
    @DbIgnore
    private Boolean isMulti;

    @DbField("sku.price")
    private BigDecimal price;

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

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

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

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

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

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

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

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

    /**
     * 二级分类
     * 虚物品 1邀请制 2非邀请制
     */
    @DbField("g.second_type")
    private Integer secondType;

    @DbField("g.special_type")
    private GoodsDon.SpecialType specialType;

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

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

    @DbIgnore
    private String expiryTimeStr;

    @DbField("gr.status")
    private String status;

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

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

    @DbField("a.api_key")
    private String apiKey;

    @DbField("a.gpt_email_pwd")
    private String gptEmailPwd;

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

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

    @DbField("a.gpt_refresh_token")
    private String gptRefreshToken;

    @DbField("gr.verify_code")
    private String verifyCode;

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

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

    @DbField("gr.account")
    private String grAccount;

    @DbField("gr.password")
    private String grPassword;

    @DbField("gr.recharge_status")
    private GroupsRelation.RechargeStatus rechargeStatus;

    @DbIgnore
    private String orderNo;
    @DbIgnore
    private Long orderId;

    @DbIgnore
    private String transactionId;

    /**
     * 店铺id
     */
    @DbField("gr.yhs_id")
    private Long yhsId;

    @DbIgnore
    private Date payTime;

    @DbIgnore
    private GoodsDonViews goodsDonViews;

    @DbIgnore
    private String remainDays;

    @DbIgnore
    private List<GroupsRelationUserView> relationViews;

    @DbIgnore
    private Integer codeNum;

    /**
     * 是否为镜像服务
     */
    @DbField("sku.is_mirror")
    private Boolean isMirror;
    /**
     * 是否为镜像车队服务
     */
    @DbField("sku.is_car")
    private Boolean isCar;


    /**
     * mj fast次数
     */
    @DbField("sku.mj_fast_num")
    private Integer mjFastNum;

    /**
     * mj relax次数
     */
    @DbField("sku.mj_relax_num")
    private Integer mjRelaxNum;

    /**
     * mj 套餐包最低单价
     */
    @DbIgnore
    private BigDecimal mjPackagePrice;
}
