package cn.ibizlab.core.analysis.filter;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;

import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;

import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;


import cn.ibizlab.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.analysis.domain.DAMetric;
/**
 * 关系型数据实体[DAMetric] 查询条件对象
 */
@Slf4j
@Data
public class DAMetricSearchContext extends QueryWrapperContext<DAMetric> {

	private String n_da_metricname_like;//[指标名称]
	public void setN_da_metricname_like(String n_da_metricname_like) {
        this.n_da_metricname_like = n_da_metricname_like;
        if(!ObjectUtils.isEmpty(this.n_da_metricname_like)){
            this.getSearchCond().like("da_metricname", n_da_metricname_like);
        }
    }
	private String n_metrictype_eq;//[类型]
	public void setN_metrictype_eq(String n_metrictype_eq) {
        this.n_metrictype_eq = n_metrictype_eq;
        if(!ObjectUtils.isEmpty(this.n_metrictype_eq)){
            this.getSearchCond().eq("metrictype", n_metrictype_eq);
        }
    }
	private String n_extop_eq;//[附加设置]
	public void setN_extop_eq(String n_extop_eq) {
        this.n_extop_eq = n_extop_eq;
        if(!ObjectUtils.isEmpty(this.n_extop_eq)){
            this.getSearchCond().eq("extop", n_extop_eq);
        }
    }
	private String n_refmetric_eq;//[参照列]
	public void setN_refmetric_eq(String n_refmetric_eq) {
        this.n_refmetric_eq = n_refmetric_eq;
        if(!ObjectUtils.isEmpty(this.n_refmetric_eq)){
            this.getSearchCond().eq("refmetric", n_refmetric_eq);
        }
    }
	private String n_buildid_eq;//[模型构建标识]
	public void setN_buildid_eq(String n_buildid_eq) {
        this.n_buildid_eq = n_buildid_eq;
        if(!ObjectUtils.isEmpty(this.n_buildid_eq)){
            this.getSearchCond().eq("buildid", n_buildid_eq);
        }
    }
	private String n_buildid_in;//[模型构建标识]
	public void setN_buildid_in(String n_buildid_in) {
        this.n_buildid_in = n_buildid_in;
        if(!ObjectUtils.isEmpty(this.n_buildid_in)){
			this.getSearchCond().in("buildid",this.n_buildid_in.split(";"));
        }
    }
	private String n_buildname_eq;//[模型构建]
	public void setN_buildname_eq(String n_buildname_eq) {
        this.n_buildname_eq = n_buildname_eq;
        if(!ObjectUtils.isEmpty(this.n_buildname_eq)){
            this.getSearchCond().eq("buildname", n_buildname_eq);
        }
    }
	private String n_buildname_like;//[模型构建]
	public void setN_buildname_like(String n_buildname_like) {
        this.n_buildname_like = n_buildname_like;
        if(!ObjectUtils.isEmpty(this.n_buildname_like)){
            this.getSearchCond().like("buildname", n_buildname_like);
        }
    }

    /**
	 * 启用快速搜索
	 */
    @Override
	public void setQuery(String query)
	{
		 this.query=query;
		 if(!StringUtils.isEmpty(query)){
            this.getSearchCond().and( wrapper ->
                     wrapper.like("da_metricname", query)
            );
		 }
	}
}



