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;

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

	   public String n_userroleresname_like;//[用户角色资源能力名称]
       public void setN_userroleresname_like(String n_userroleresname_like) {
            this.n_userroleresname_like=n_userroleresname_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("userroleresname");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_userroleresname_like);
            this.getCondition().add(searchField);
       }
	   public String n_userrolename_eq;//[角色名称]
       public void setN_userrolename_eq(String n_userrolename_eq) {
            this.n_userrolename_eq=n_userrolename_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("userrolename");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_userrolename_eq);
            this.getCondition().add(searchField);
       }
	   public String n_userrolename_like;//[角色名称]
       public void setN_userrolename_like(String n_userrolename_like) {
            this.n_userrolename_like=n_userrolename_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("userrolename");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_userrolename_like);
            this.getCondition().add(searchField);
       }
	   public String n_uniresname_eq;//[资源名称]
       public void setN_uniresname_eq(String n_uniresname_eq) {
            this.n_uniresname_eq=n_uniresname_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("uniresname");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_uniresname_eq);
            this.getCondition().add(searchField);
       }
	   public String n_uniresname_like;//[资源名称]
       public void setN_uniresname_like(String n_uniresname_like) {
            this.n_uniresname_like=n_uniresname_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("uniresname");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_uniresname_like);
            this.getCondition().add(searchField);
       }
	   public String n_userroleid_eq;//[用户角色标识]
       public void setN_userroleid_eq(String n_userroleid_eq) {
            this.n_userroleid_eq=n_userroleid_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("userroleid");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_userroleid_eq);
            this.getCondition().add(searchField);
       }
	   public String n_uniresid_eq;//[统一资源标识]
       public void setN_uniresid_eq(String n_uniresid_eq) {
            this.n_uniresid_eq=n_uniresid_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("uniresid");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_uniresid_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 userroleresname=new SearchFieldFilter();
           userroleresname.setParam("userroleresname");
           userroleresname.setCondition(SearchFieldType.LIKE);
           userroleresname.setValue(strQuery);
           searchGroupFilter.getCondition().add(userroleresname);
        this.getCondition().add(searchGroupFilter);   

           
           
        }
	}
}
