package com.cyksj.model.views;

import com.cyksj.model.manage.views.GroupsRelationView;
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.util.List;

/**
 * @author chan
 * @date 2022/9/26 6:35 PM
 */
@Getter
@Setter
@SearchBean(tables = "groups_trips g ")
public class GroupsView {

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

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

    /**
     * 车位数量
     */
    @DbField("g.num")
    @JsonIgnore
    private Integer num;

    /**
     * 可用车位数
     */
    @DbField("g.available_num")
    @JsonIgnore
    private Integer availableNum;

    /**
     * 状态
     */
    @DbField("g.status")
    private String status;

    /**
     * 备注
     */
    @DbField("g.remark")
    private String remark;

    @DbField("case when available_num = 0 then 66 when available_num != 0 then available_num end")
    @JsonIgnore
    private Integer orderBy;

    /**
     * 关系
     */
    @DbIgnore
    private List<GroupsRelationView> relations;
}
