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

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

	   public String n_userroledataname_like;//[数据对象能力名称]
       public void setN_userroledataname_like(String n_userroledataname_like) {
            this.n_userroledataname_like=n_userroledataname_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("userroledataname");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_userroledataname_like);
            this.getCondition().add(searchField);
       }
	   public Integer n_isalldata_eq;//[全部数据]
       public void setN_isalldata_eq(Integer n_isalldata_eq) {
            this.n_isalldata_eq=n_isalldata_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("isalldata");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_isalldata_eq);
            this.getCondition().add(searchField);
       }
	   public String n_dataentityname_eq;//[业务实体名称]
       public void setN_dataentityname_eq(String n_dataentityname_eq) {
            this.n_dataentityname_eq=n_dataentityname_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("dataentityname");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_dataentityname_eq);
            this.getCondition().add(searchField);
       }
	   public String n_dataentityname_like;//[业务实体名称]
       public void setN_dataentityname_like(String n_dataentityname_like) {
            this.n_dataentityname_like=n_dataentityname_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("dataentityname");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_dataentityname_like);
            this.getCondition().add(searchField);
       }
	   public String n_dataentityid_eq;//[业务实体标识]
       public void setN_dataentityid_eq(String n_dataentityid_eq) {
            this.n_dataentityid_eq=n_dataentityid_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("dataentityid");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_dataentityid_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 userroledataname=new SearchFieldFilter();
           userroledataname.setParam("userroledataname");
           userroledataname.setCondition(SearchFieldType.LIKE);
           userroledataname.setValue(strQuery);
           searchGroupFilter.getCondition().add(userroledataname);
        this.getCondition().add(searchGroupFilter);   

           
           
        }
	}
}
