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;

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

	   public String n_orgusername_like;//[人员名称]
       public void setN_orgusername_like(String n_orgusername_like) {
            this.n_orgusername_like=n_orgusername_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("orgusername");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_orgusername_like);
            this.getCondition().add(searchField);
       }
	   public String n_orgname_eq;//[机构名称]
       public void setN_orgname_eq(String n_orgname_eq) {
            this.n_orgname_eq=n_orgname_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("orgname");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_orgname_eq);
            this.getCondition().add(searchField);
       }
	   public String n_orgname_like;//[机构名称]
       public void setN_orgname_like(String n_orgname_like) {
            this.n_orgname_like=n_orgname_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("orgname");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_orgname_like);
            this.getCondition().add(searchField);
       }
	   public String n_orgid_eq;//[机构标识]
       public void setN_orgid_eq(String n_orgid_eq) {
            this.n_orgid_eq=n_orgid_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("orgid");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_orgid_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 orgusername=new SearchFieldFilter();
           orgusername.setParam("orgusername");
           orgusername.setCondition(SearchFieldType.LIKE);
           orgusername.setValue(strQuery);
           searchGroupFilter.getCondition().add(orgusername);
        this.getCondition().add(searchGroupFilter);   

           
           
        }
	}
}
