package com.sinosig.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.sinosig.util.ISearchFilter;
import com.sinosig.util.domain.DataObj;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sinosig.util.SearchContext;
import com.sinosig.util.SearchFieldFilter;
import com.sinosig.util.enums.SearchFieldType;
import com.sinosig.util.enums.SearchGroupType;
import com.sinosig.util.SearchGroupFilter;
import lombok.Data;

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

	   public String n_khlx_eq;//[客户类型]
       public void setN_khlx_eq(String n_khlx_eq) {
            this.n_khlx_eq=n_khlx_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("khlx");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_khlx_eq);
            this.getCondition().add(searchField);
       }
	   public String n_zjlx_eq;//[证件类型]
       public void setN_zjlx_eq(String n_zjlx_eq) {
            this.n_zjlx_eq=n_zjlx_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("zjlx");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_zjlx_eq);
            this.getCondition().add(searchField);
       }
	   public String n_xb_eq;//[性别]
       public void setN_xb_eq(String n_xb_eq) {
            this.n_xb_eq=n_xb_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("xb");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_xb_eq);
            this.getCondition().add(searchField);
       }
	   public String n_customername_like;//[客户名称]
       public void setN_customername_like(String n_customername_like) {
            this.n_customername_like=n_customername_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("customername");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_customername_like);
            this.getCondition().add(searchField);
       }
	   public String n_cidid_eq;//[车险单标识]
       public void setN_cidid_eq(String n_cidid_eq) {
            this.n_cidid_eq=n_cidid_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("cidid");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_cidid_eq);
            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 customername=new SearchFieldFilter();
           customername.setParam("customername");
           customername.setCondition(SearchFieldType.LIKE);
           customername.setValue(strQuery);
           searchGroupFilter.getCondition().add(customername);
        this.getCondition().add(searchGroupFilter);   

           
           
        }
	}
}
