package com.ibiz.core.module.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;

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

	   public String n_psname_like;//[采购单名称]
       public void setN_psname_like(String n_psname_like) {
            this.n_psname_like=n_psname_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("psname");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_psname_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 psname=new SearchFieldFilter();
           psname.setParam("psname");
           psname.setCondition(SearchFieldType.LIKE);
           psname.setValue(strQuery);
           searchGroupFilter.getCondition().add(psname);
        this.getCondition().add(searchGroupFilter);   

           
           
        }
	}
}
