package com.ibiz.core.external.filter;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import com.ibiz.util.ISearchFilter;
import com.ibiz.util.domain.DataObj;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ibiz.util.SearchContext;
import com.ibiz.util.SearchFieldFilter;
import com.ibiz.util.enums.SearchFieldType;
import com.ibiz.util.enums.SearchGroupType;
import com.ibiz.util.SearchGroupFilter;
import lombok.Data;

/**
 * 关系型数据实体[CPXH] 查询条件对象
 */
@Data
public class CPXHSearchContext extends SearchContext {

	   public String n_cpxhname_like;//[厂牌型号名称]
       public void setN_cpxhname_like(String n_cpxhname_like) {
            this.n_cpxhname_like=n_cpxhname_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("cpxhname");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_cpxhname_like);
            this.getCondition().add(searchField);
       }

	/**
	 * 启用快速搜索
	 */
	public void setQuery(String strQuery)
	{
		 this.query=strQuery;
         if(!org.springframework.util.StringUtils.isEmpty(strQuery)){
           SearchGroupFilter searchGroupFilter=new SearchGroupFilter();
           searchGroupFilter.setSearchGroupType(SearchGroupType.OR);

           SearchFieldFilter cpxhname=new SearchFieldFilter();
           cpxhname.setParam("cpxhname");
           cpxhname.setCondition(SearchFieldType.LIKE);
           cpxhname.setValue(strQuery);
           searchGroupFilter.getCondition().add(cpxhname);
        this.getCondition().add(searchGroupFilter);   

           
           
        }
	}
}
