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;

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

	   public String n_tbdh_like;//[投保单号]
       public void setN_tbdh_like(String n_tbdh_like) {
            this.n_tbdh_like=n_tbdh_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("tbdh");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_tbdh_like);
            this.getCondition().add(searchField);
       }
	   public String n_cph_like;//[车牌号]
       public void setN_cph_like(String n_cph_like) {
            this.n_cph_like=n_cph_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("cph");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_cph_like);
            this.getCondition().add(searchField);
       }
       @JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
	   public Timestamp n_srrq_gt;//[输入日期]
       public void setN_srrq_gt(Timestamp n_srrq_gt) {
            this.n_srrq_gt=n_srrq_gt;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("srrq");
            searchField.setCondition(SearchFieldType.GT);
            searchField.setValue(n_srrq_gt);
            this.getCondition().add(searchField);
       }
       @JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
	   public Timestamp n_srrq_lt;//[输入日期]
       public void setN_srrq_lt(Timestamp n_srrq_lt) {
            this.n_srrq_lt=n_srrq_lt;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("srrq");
            searchField.setCondition(SearchFieldType.LT);
            searchField.setValue(n_srrq_lt);
            this.getCondition().add(searchField);
       }
	   public String n_dbdname_like;//[投保单名称]
       public void setN_dbdname_like(String n_dbdname_like) {
            this.n_dbdname_like=n_dbdname_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("dbdname");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_dbdname_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 dbdname=new SearchFieldFilter();
           dbdname.setParam("dbdname");
           dbdname.setCondition(SearchFieldType.LIKE);
           dbdname.setValue(strQuery);
           searchGroupFilter.getCondition().add(dbdname);
        this.getCondition().add(searchGroupFilter);   

           
           
        }
	}
}
