package com.sa.ibiz.demo.demo.service.dto;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sa.ibiz.demo.ibizutil.domain.ParentData;
import com.sa.ibiz.demo.demo.domain.PPModel;
import org.springframework.util.StringUtils;
import lombok.Data;
import java.util.Map;
import java.sql.Timestamp;
import com.sa.ibiz.demo.ibizutil.service.SearchFilterBase;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sa.ibiz.demo.ibizutil.helper.DataGridCustomSearchHelper;
import com.alibaba.fastjson.JSONObject;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class PPModelSearchFilter extends SearchFilterBase {

	private String query;
	private Page page;
	private QueryWrapper<PPModel> selectCond;
	private JSONObject customsearchval;
	public PPModelSearchFilter(){
		this.page =new Page<PPModel>(1,Short.MAX_VALUE);
		this.selectCond=new QueryWrapper<PPModel>();	
	}

	/**
	 * 设定自定义查询条件，在原有SQL基础上追加该SQL
	 */
	public void setCustomCond(String sql)
	{
		this.selectCond.apply(sql);
	}

	private String n_c1pvpartid_eq;

	public void setN_c1pvpartid_eq(String n_c1pvpartid_eq) {
        this.n_c1pvpartid_eq = n_c1pvpartid_eq;
        if(!StringUtils.isEmpty(this.n_c1pvpartid_eq)){
            this.selectCond.eq("c1pvpartid", n_c1pvpartid_eq);
        }
    }
	private String n_c1pvpartname_eq;

	public void setN_c1pvpartname_eq(String n_c1pvpartname_eq) {
        this.n_c1pvpartname_eq = n_c1pvpartname_eq;
        if(!StringUtils.isEmpty(this.n_c1pvpartname_eq)){
            this.selectCond.eq("c1pvpartname", n_c1pvpartname_eq);
        }
    }
	private String n_c1pvpartname_like;

	public void setN_c1pvpartname_like(String n_c1pvpartname_like) {
        this.n_c1pvpartname_like = n_c1pvpartname_like;
        if(!StringUtils.isEmpty(this.n_c1pvpartname_like)){
            this.selectCond.like("c1pvpartname", n_c1pvpartname_like);
        }
    }
	private String n_c2pvpartid_eq;

	public void setN_c2pvpartid_eq(String n_c2pvpartid_eq) {
        this.n_c2pvpartid_eq = n_c2pvpartid_eq;
        if(!StringUtils.isEmpty(this.n_c2pvpartid_eq)){
            this.selectCond.eq("c2pvpartid", n_c2pvpartid_eq);
        }
    }
	private String n_c2pvpartname_eq;

	public void setN_c2pvpartname_eq(String n_c2pvpartname_eq) {
        this.n_c2pvpartname_eq = n_c2pvpartname_eq;
        if(!StringUtils.isEmpty(this.n_c2pvpartname_eq)){
            this.selectCond.eq("c2pvpartname", n_c2pvpartname_eq);
        }
    }
	private String n_c2pvpartname_like;

	public void setN_c2pvpartname_like(String n_c2pvpartname_like) {
        this.n_c2pvpartname_like = n_c2pvpartname_like;
        if(!StringUtils.isEmpty(this.n_c2pvpartname_like)){
            this.selectCond.like("c2pvpartname", n_c2pvpartname_like);
        }
    }
	private String n_c3pvpartid_eq;

	public void setN_c3pvpartid_eq(String n_c3pvpartid_eq) {
        this.n_c3pvpartid_eq = n_c3pvpartid_eq;
        if(!StringUtils.isEmpty(this.n_c3pvpartid_eq)){
            this.selectCond.eq("c3pvpartid", n_c3pvpartid_eq);
        }
    }
	private String n_c3pvpartname_eq;

	public void setN_c3pvpartname_eq(String n_c3pvpartname_eq) {
        this.n_c3pvpartname_eq = n_c3pvpartname_eq;
        if(!StringUtils.isEmpty(this.n_c3pvpartname_eq)){
            this.selectCond.eq("c3pvpartname", n_c3pvpartname_eq);
        }
    }
	private String n_c3pvpartname_like;

	public void setN_c3pvpartname_like(String n_c3pvpartname_like) {
        this.n_c3pvpartname_like = n_c3pvpartname_like;
        if(!StringUtils.isEmpty(this.n_c3pvpartname_like)){
            this.selectCond.like("c3pvpartname", n_c3pvpartname_like);
        }
    }
	private String n_c4pvpartid_eq;

	public void setN_c4pvpartid_eq(String n_c4pvpartid_eq) {
        this.n_c4pvpartid_eq = n_c4pvpartid_eq;
        if(!StringUtils.isEmpty(this.n_c4pvpartid_eq)){
            this.selectCond.eq("c4pvpartid", n_c4pvpartid_eq);
        }
    }
	private String n_c4pvpartname_eq;

	public void setN_c4pvpartname_eq(String n_c4pvpartname_eq) {
        this.n_c4pvpartname_eq = n_c4pvpartname_eq;
        if(!StringUtils.isEmpty(this.n_c4pvpartname_eq)){
            this.selectCond.eq("c4pvpartname", n_c4pvpartname_eq);
        }
    }
	private String n_c4pvpartname_like;

	public void setN_c4pvpartname_like(String n_c4pvpartname_like) {
        this.n_c4pvpartname_like = n_c4pvpartname_like;
        if(!StringUtils.isEmpty(this.n_c4pvpartname_like)){
            this.selectCond.like("c4pvpartname", n_c4pvpartname_like);
        }
    }
	private String n_l1pvpartid_eq;

	public void setN_l1pvpartid_eq(String n_l1pvpartid_eq) {
        this.n_l1pvpartid_eq = n_l1pvpartid_eq;
        if(!StringUtils.isEmpty(this.n_l1pvpartid_eq)){
            this.selectCond.eq("l1pvpartid", n_l1pvpartid_eq);
        }
    }
	private String n_l1pvpartname_eq;

	public void setN_l1pvpartname_eq(String n_l1pvpartname_eq) {
        this.n_l1pvpartname_eq = n_l1pvpartname_eq;
        if(!StringUtils.isEmpty(this.n_l1pvpartname_eq)){
            this.selectCond.eq("l1pvpartname", n_l1pvpartname_eq);
        }
    }
	private String n_l1pvpartname_like;

	public void setN_l1pvpartname_like(String n_l1pvpartname_like) {
        this.n_l1pvpartname_like = n_l1pvpartname_like;
        if(!StringUtils.isEmpty(this.n_l1pvpartname_like)){
            this.selectCond.like("l1pvpartname", n_l1pvpartname_like);
        }
    }
	private String n_l2pvpartid_eq;

	public void setN_l2pvpartid_eq(String n_l2pvpartid_eq) {
        this.n_l2pvpartid_eq = n_l2pvpartid_eq;
        if(!StringUtils.isEmpty(this.n_l2pvpartid_eq)){
            this.selectCond.eq("l2pvpartid", n_l2pvpartid_eq);
        }
    }
	private String n_l2pvpartname_eq;

	public void setN_l2pvpartname_eq(String n_l2pvpartname_eq) {
        this.n_l2pvpartname_eq = n_l2pvpartname_eq;
        if(!StringUtils.isEmpty(this.n_l2pvpartname_eq)){
            this.selectCond.eq("l2pvpartname", n_l2pvpartname_eq);
        }
    }
	private String n_l2pvpartname_like;

	public void setN_l2pvpartname_like(String n_l2pvpartname_like) {
        this.n_l2pvpartname_like = n_l2pvpartname_like;
        if(!StringUtils.isEmpty(this.n_l2pvpartname_like)){
            this.selectCond.like("l2pvpartname", n_l2pvpartname_like);
        }
    }
	private String n_l3pvpartid_eq;

	public void setN_l3pvpartid_eq(String n_l3pvpartid_eq) {
        this.n_l3pvpartid_eq = n_l3pvpartid_eq;
        if(!StringUtils.isEmpty(this.n_l3pvpartid_eq)){
            this.selectCond.eq("l3pvpartid", n_l3pvpartid_eq);
        }
    }
	private String n_l3pvpartname_eq;

	public void setN_l3pvpartname_eq(String n_l3pvpartname_eq) {
        this.n_l3pvpartname_eq = n_l3pvpartname_eq;
        if(!StringUtils.isEmpty(this.n_l3pvpartname_eq)){
            this.selectCond.eq("l3pvpartname", n_l3pvpartname_eq);
        }
    }
	private String n_l3pvpartname_like;

	public void setN_l3pvpartname_like(String n_l3pvpartname_like) {
        this.n_l3pvpartname_like = n_l3pvpartname_like;
        if(!StringUtils.isEmpty(this.n_l3pvpartname_like)){
            this.selectCond.like("l3pvpartname", n_l3pvpartname_like);
        }
    }
	private String n_l4pvpartid_eq;

	public void setN_l4pvpartid_eq(String n_l4pvpartid_eq) {
        this.n_l4pvpartid_eq = n_l4pvpartid_eq;
        if(!StringUtils.isEmpty(this.n_l4pvpartid_eq)){
            this.selectCond.eq("l4pvpartid", n_l4pvpartid_eq);
        }
    }
	private String n_l4pvpartname_eq;

	public void setN_l4pvpartname_eq(String n_l4pvpartname_eq) {
        this.n_l4pvpartname_eq = n_l4pvpartname_eq;
        if(!StringUtils.isEmpty(this.n_l4pvpartname_eq)){
            this.selectCond.eq("l4pvpartname", n_l4pvpartname_eq);
        }
    }
	private String n_l4pvpartname_like;

	public void setN_l4pvpartname_like(String n_l4pvpartname_like) {
        this.n_l4pvpartname_like = n_l4pvpartname_like;
        if(!StringUtils.isEmpty(this.n_l4pvpartname_like)){
            this.selectCond.like("l4pvpartname", n_l4pvpartname_like);
        }
    }
	private String n_portalpageid_eq;

	public void setN_portalpageid_eq(String n_portalpageid_eq) {
        this.n_portalpageid_eq = n_portalpageid_eq;
        if(!StringUtils.isEmpty(this.n_portalpageid_eq)){
            this.selectCond.eq("portalpageid", n_portalpageid_eq);
        }
    }
	private String n_portalpagename_eq;

	public void setN_portalpagename_eq(String n_portalpagename_eq) {
        this.n_portalpagename_eq = n_portalpagename_eq;
        if(!StringUtils.isEmpty(this.n_portalpagename_eq)){
            this.selectCond.eq("portalpagename", n_portalpagename_eq);
        }
    }
	private String n_portalpagename_like;

	public void setN_portalpagename_like(String n_portalpagename_like) {
        this.n_portalpagename_like = n_portalpagename_like;
        if(!StringUtils.isEmpty(this.n_portalpagename_like)){
            this.selectCond.like("portalpagename", n_portalpagename_like);
        }
    }
	private String n_ppmodel_eq;

	public void setN_ppmodel_eq(String n_ppmodel_eq) {
        this.n_ppmodel_eq = n_ppmodel_eq;
        if(!StringUtils.isEmpty(this.n_ppmodel_eq)){
            this.selectCond.eq("ppmodel", n_ppmodel_eq);
        }
    }
	private String n_r1pvpartid_eq;

	public void setN_r1pvpartid_eq(String n_r1pvpartid_eq) {
        this.n_r1pvpartid_eq = n_r1pvpartid_eq;
        if(!StringUtils.isEmpty(this.n_r1pvpartid_eq)){
            this.selectCond.eq("r1pvpartid", n_r1pvpartid_eq);
        }
    }
	private String n_r1pvpartname_eq;

	public void setN_r1pvpartname_eq(String n_r1pvpartname_eq) {
        this.n_r1pvpartname_eq = n_r1pvpartname_eq;
        if(!StringUtils.isEmpty(this.n_r1pvpartname_eq)){
            this.selectCond.eq("r1pvpartname", n_r1pvpartname_eq);
        }
    }
	private String n_r1pvpartname_like;

	public void setN_r1pvpartname_like(String n_r1pvpartname_like) {
        this.n_r1pvpartname_like = n_r1pvpartname_like;
        if(!StringUtils.isEmpty(this.n_r1pvpartname_like)){
            this.selectCond.like("r1pvpartname", n_r1pvpartname_like);
        }
    }
	private String n_r2pvpartid_eq;

	public void setN_r2pvpartid_eq(String n_r2pvpartid_eq) {
        this.n_r2pvpartid_eq = n_r2pvpartid_eq;
        if(!StringUtils.isEmpty(this.n_r2pvpartid_eq)){
            this.selectCond.eq("r2pvpartid", n_r2pvpartid_eq);
        }
    }
	private String n_r2pvpartname_eq;

	public void setN_r2pvpartname_eq(String n_r2pvpartname_eq) {
        this.n_r2pvpartname_eq = n_r2pvpartname_eq;
        if(!StringUtils.isEmpty(this.n_r2pvpartname_eq)){
            this.selectCond.eq("r2pvpartname", n_r2pvpartname_eq);
        }
    }
	private String n_r2pvpartname_like;

	public void setN_r2pvpartname_like(String n_r2pvpartname_like) {
        this.n_r2pvpartname_like = n_r2pvpartname_like;
        if(!StringUtils.isEmpty(this.n_r2pvpartname_like)){
            this.selectCond.like("r2pvpartname", n_r2pvpartname_like);
        }
    }
	private String n_r3pvpartid_eq;

	public void setN_r3pvpartid_eq(String n_r3pvpartid_eq) {
        this.n_r3pvpartid_eq = n_r3pvpartid_eq;
        if(!StringUtils.isEmpty(this.n_r3pvpartid_eq)){
            this.selectCond.eq("r3pvpartid", n_r3pvpartid_eq);
        }
    }
	private String n_r3pvpartname_eq;

	public void setN_r3pvpartname_eq(String n_r3pvpartname_eq) {
        this.n_r3pvpartname_eq = n_r3pvpartname_eq;
        if(!StringUtils.isEmpty(this.n_r3pvpartname_eq)){
            this.selectCond.eq("r3pvpartname", n_r3pvpartname_eq);
        }
    }
	private String n_r3pvpartname_like;

	public void setN_r3pvpartname_like(String n_r3pvpartname_like) {
        this.n_r3pvpartname_like = n_r3pvpartname_like;
        if(!StringUtils.isEmpty(this.n_r3pvpartname_like)){
            this.selectCond.like("r3pvpartname", n_r3pvpartname_like);
        }
    }
	private String n_r4pvpartid_eq;

	public void setN_r4pvpartid_eq(String n_r4pvpartid_eq) {
        this.n_r4pvpartid_eq = n_r4pvpartid_eq;
        if(!StringUtils.isEmpty(this.n_r4pvpartid_eq)){
            this.selectCond.eq("r4pvpartid", n_r4pvpartid_eq);
        }
    }
	private String n_r4pvpartname_eq;

	public void setN_r4pvpartname_eq(String n_r4pvpartname_eq) {
        this.n_r4pvpartname_eq = n_r4pvpartname_eq;
        if(!StringUtils.isEmpty(this.n_r4pvpartname_eq)){
            this.selectCond.eq("r4pvpartname", n_r4pvpartname_eq);
        }
    }
	private String n_r4pvpartname_like;

	public void setN_r4pvpartname_like(String n_r4pvpartname_like) {
        this.n_r4pvpartname_like = n_r4pvpartname_like;
        if(!StringUtils.isEmpty(this.n_r4pvpartname_like)){
            this.selectCond.like("r4pvpartname", n_r4pvpartname_like);
        }
    }

	public void setSrfparentdata(Map<String, String> srfparentdata) {
		this.srfparentdata = srfparentdata;
		String strParentkey=this.getSrfparentdata().get("srfparentkey");
		if(this.srfparentdata.containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_PPMODEL_PVPART_C1PVPARTID"))
			if(StringUtils.isEmpty(strParentkey)){
				this.setN_c1pvpartid_eq("NA");
			}
			else{
				this.setN_c1pvpartid_eq(strParentkey);
			}
		if(this.srfparentdata.containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_PPMODEL_PVPART_C2PVPARTID"))
			if(StringUtils.isEmpty(strParentkey)){
				this.setN_c2pvpartid_eq("NA");
			}
			else{
				this.setN_c2pvpartid_eq(strParentkey);
			}
		if(this.srfparentdata.containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_PPMODEL_PVPART_C3PVPARTID"))
			if(StringUtils.isEmpty(strParentkey)){
				this.setN_c3pvpartid_eq("NA");
			}
			else{
				this.setN_c3pvpartid_eq(strParentkey);
			}
		if(this.srfparentdata.containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_PPMODEL_PVPART_C4PVPARTID"))
			if(StringUtils.isEmpty(strParentkey)){
				this.setN_c4pvpartid_eq("NA");
			}
			else{
				this.setN_c4pvpartid_eq(strParentkey);
			}
		if(this.srfparentdata.containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_PPMODEL_PVPART_L1PVPARTID"))
			if(StringUtils.isEmpty(strParentkey)){
				this.setN_l1pvpartid_eq("NA");
			}
			else{
				this.setN_l1pvpartid_eq(strParentkey);
			}
		if(this.srfparentdata.containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_PPMODEL_PVPART_L2PVPARTID"))
			if(StringUtils.isEmpty(strParentkey)){
				this.setN_l2pvpartid_eq("NA");
			}
			else{
				this.setN_l2pvpartid_eq(strParentkey);
			}
		if(this.srfparentdata.containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_PPMODEL_PVPART_L3PVPARTID"))
			if(StringUtils.isEmpty(strParentkey)){
				this.setN_l3pvpartid_eq("NA");
			}
			else{
				this.setN_l3pvpartid_eq(strParentkey);
			}
		if(this.srfparentdata.containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_PPMODEL_PVPART_L4PVPARTID"))
			if(StringUtils.isEmpty(strParentkey)){
				this.setN_l4pvpartid_eq("NA");
			}
			else{
				this.setN_l4pvpartid_eq(strParentkey);
			}
		if(this.srfparentdata.containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_PPMODEL_PORTALPAGE_PORTALPAGEID"))
			if(StringUtils.isEmpty(strParentkey)){
				this.setN_portalpageid_eq("NA");
			}
			else{
				this.setN_portalpageid_eq(strParentkey);
			}
		if(this.srfparentdata.containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_PPMODEL_PVPART_R1PVPARTID"))
			if(StringUtils.isEmpty(strParentkey)){
				this.setN_r1pvpartid_eq("NA");
			}
			else{
				this.setN_r1pvpartid_eq(strParentkey);
			}
		if(this.srfparentdata.containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_PPMODEL_PVPART_R2PVPARTID"))
			if(StringUtils.isEmpty(strParentkey)){
				this.setN_r2pvpartid_eq("NA");
			}
			else{
				this.setN_r2pvpartid_eq(strParentkey);
			}
		if(this.srfparentdata.containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_PPMODEL_PVPART_R3PVPARTID"))
			if(StringUtils.isEmpty(strParentkey)){
				this.setN_r3pvpartid_eq("NA");
			}
			else{
				this.setN_r3pvpartid_eq(strParentkey);
			}
		if(this.srfparentdata.containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_PPMODEL_PVPART_R4PVPARTID"))
			if(StringUtils.isEmpty(strParentkey)){
				this.setN_r4pvpartid_eq("NA");
			}
			else{
				this.setN_r4pvpartid_eq(strParentkey);
			}
	}

	/**
	 * 启用快速搜索
	 */
	public void setQuery(String query)
	{
		 this.query=query;
		 if(!StringUtils.isEmpty(query)){
			this.selectCond.or().like("portalpagename",query);
		 }
	}

	/**
	 * 自定义查询
	 * @param customsearchval
	 */
	public void setCustomsearchval(JSONObject customsearchval) {
		this.customsearchval = customsearchval;
		if(!StringUtils.isEmpty(customsearchval)){
			DataGridCustomSearchHelper customSearchHelper= DataGridCustomSearchHelper.getInstance();
			String customSql =customSearchHelper.parseCustomVal(customsearchval);
			this.selectCond.apply(customSql);
		}
	}

}