package cn.ibizlab.core.extensions.dto;

import cn.ibizlab.core.lite.extensions.domain.DataObj;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.math.BigDecimal;

@JsonIgnoreProperties(ignoreUnknown = true)
public class FetchItem extends DataObj {



    // 表格展示类型：1.  default（维度数据以行的形式展示），2.  LIST_BOX（维度数据以列的形式展示）
    public String getDisplayType() {
        return this.getStringValue("displayType","default");
    }

    public FetchItem setDisplayType(String displayType) {
        this.put("displayType", displayType);
        return this;
    }

    public int getNo() {
        return this.getIntegerValue("no",1);
    }

    public FetchItem setNo(int no) {
        this.put("no",no);
        return this;
    }

    public String getDimId() {
        return this.getStringValue("dimId");
    }

    public FetchItem setDimId(String dimId) {
        this.put("dimId", dimId);
        this.put("itemId",dimId);
        return this;
    }

    public String getDimName() {
        return this.getStringValue("dimName");
    }

    public FetchItem setDimName(String dimName) {
        this.put("dimName",dimName);
        this.put("itemName",dimName);
        return this;
    }

    public String getMetricId() {
        return this.getStringValue("metricId");
    }

    public FetchItem setMetricId(String metricId) {
        this.put("metricId",metricId);
        this.put("itemId",metricId);
        return this;
    }

    public String getMetricName() {
        return this.getStringValue("metricName");
    }

    public FetchItem setMetricName(String metricName) {
        this.put("metricName",metricName);
        this.put("itemName",metricName);
        return this;
    }

    public BigDecimal getVal(String colId) {
        return this.getBigDecimalValue(colId,BigDecimal.ZERO);
    }

    public FetchItem setVal(String colId, BigDecimal val) {
        if(val==null)
            val=BigDecimal.ZERO;
        this.put(colId,val);
        return this;
    }



}
