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;

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

	   public String n_pwdchanged_eq;//[密码修改标记]
       public void setN_pwdchanged_eq(String n_pwdchanged_eq) {
            this.n_pwdchanged_eq=n_pwdchanged_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("pwdchanged");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_pwdchanged_eq);
            this.getCondition().add(searchField);
       }
	   public String n_loginaccountname_like;//[登录账号名称]
       public void setN_loginaccountname_like(String n_loginaccountname_like) {
            this.n_loginaccountname_like=n_loginaccountname_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("loginaccountname");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_loginaccountname_like);
            this.getCondition().add(searchField);
       }
	   public String n_issuperuser_eq;//[是否是超级用户]
       public void setN_issuperuser_eq(String n_issuperuser_eq) {
            this.n_issuperuser_eq=n_issuperuser_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("issuperuser");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_issuperuser_eq);
            this.getCondition().add(searchField);
       }
	   public String n_username_eq;//[用户名称]
       public void setN_username_eq(String n_username_eq) {
            this.n_username_eq=n_username_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("username");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_username_eq);
            this.getCondition().add(searchField);
       }
	   public String n_username_like;//[用户名称]
       public void setN_username_like(String n_username_like) {
            this.n_username_like=n_username_like;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("username");
            searchField.setCondition(SearchFieldType.LIKE);
            searchField.setValue(n_username_like);
            this.getCondition().add(searchField);
       }
	   public String n_userid_eq;//[用户标识]
       public void setN_userid_eq(String n_userid_eq) {
            this.n_userid_eq=n_userid_eq;
            SearchFieldFilter searchField = new SearchFieldFilter();
            searchField.setParam("userid");
            searchField.setCondition(SearchFieldType.EQ);
            searchField.setValue(n_userid_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 loginaccountname=new SearchFieldFilter();
           loginaccountname.setParam("loginaccountname");
           loginaccountname.setCondition(SearchFieldType.LIKE);
           loginaccountname.setValue(strQuery);
           searchGroupFilter.getCondition().add(loginaccountname);
        this.getCondition().add(searchGroupFilter);   

           
           
        }
	}
}
