<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListView id="__ImlflBlgisWZT02OQ9u">
  <name>五级结业证证书列表3</name>
  <parentId>__33O9dRsTvtyXuJr33bv</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <description>证书列表</description>
  <pagination>true</pagination>
  <pageLines>10</pageLines>
  <showTotalRow>true</showTotalRow>
  <refresh>false</refresh>
  <refreshAll>false</refreshAll>
  <newPage>false</newPage>
  <readonly>true</readonly>
  <relatedMap><![CDATA[                                                                                                                ]]></relatedMap>
  <displayType>relatedForm</displayType>
  <defaultShowMode>month</defaultShowMode>
  <collapsibleShowMode>normal</collapsibleShowMode>
  <showWaterMark>false</showWaterMark>
  <showActivityColumnType>0</showActivityColumnType>
  <searchFormId>__mZQ28P3b1RNAebPz05x</searchFormId>
  <autoCompose>false</autoCompose>
  <relatedForm>__JPHvq5gsbT0nuFotaqq</relatedForm>
  <permissionType>public</permissionType>
  <filterScript><![CDATA[]]></filterScript>
  <sqlFilterScript><![CDATA[ (function(){    
	var idCardNo = getItemValueAsString("idCard"); 
	//var certificateNO = getItemValueAsString("certificateNO"); 
	var name = getItemValueAsString("name"); 
	var jiguan = getItemValueAsString("jiguan");
	var bianhao = getItemValueAsString("bianhao");
	//var company = getItemValueAsString("company"); 
	var createStartDate = getItemValueAsDate("createStartDate"); 
	var createEndDate = getItemValueAsDate("createEndDate"); 
	var z_name = getItemValueAsString("z_name");  
	var z_idCard = getItemValueAsString("z_idCard"); 
	//var status = getItemValueAsString("status"); 
	var whereStr="where a.ITEM_CULTIVATECOMPANYCODE='"+getDomainid()+"' and a.ITEM_CERTIFICATETYPE='2' ";
	var queryCriteriaSql = "";   
	if(isNotNull(idCardNo)){            
	  whereStr += "and ITEM_IDCARDNO = '"+idCardNo+"' ";            
	} 
	/*if(isNotNull(certificateNO)){            
	  whereStr += "and ITEM_certificateNO like concat('%','"+certificateNO+"','%') ";            
	}*/   
	if(isNotNull(bianhao)){            
	  whereStr += "and ITEM_certificateNO like concat('%','"+bianhao+"','%') ";            
	}   
	if(isNotNull(name)){            
	  whereStr += "and ITEM_name = '"+name+"' ";            
	} 
   if(isNotNull(jiguan)){            
	  queryCriteriaSql = queryCriteriaSql + " and a.ITEM_CERTIFICATEFROM like concat('%','"+jiguan+"','%')"       
	}
	/*if(isNotNull(company)){            
	  queryCriteriaSql = queryCriteriaSql + " and a.ITEM_COMPANYNAMETOGET like concat('%','"+company+"','%')"     
	}*/
	 if(isNotNull(z_name)){                                        
	  queryCriteriaSql = queryCriteriaSql + " and a.ITEM_NAME like concat('%','"+z_name+"','%')"
	}
	if(isNotNull(z_idCard)){                                        
	  queryCriteriaSql = queryCriteriaSql + " and a.ITEM_IDCARDNO like concat('%','"+z_idCard+"','%')"
	}
	if(isNotNull(createStartDate)){            
	  queryCriteriaSql += "and c.ITEM_TRAININGENDTIME >= '"+format(createStartDate,"yyyy-MM-dd")+"' ";            
	}            
	if(isNotNull(createEndDate)){            
	  queryCriteriaSql += "and c.ITEM_TRAININGENDTIME < DATE_FORMAT(DATE_ADD('"+format(createEndDate,"yyyy-MM-dd")+"',INTERVAL 1 DAY),'%Y-%m-%d')";             
	} 
	/*if(isNotNull(status)){            
	  queryCriteriaSql = queryCriteriaSql + " and a.ITEM_STATUS like concat('%','"+status+"','%')"           
	}*/ 
  
	var sql = "select '"+getDomainid()+"' as domainId,"+
		"a.ITEM_SECURITYID," + //保安员ID
		"a.ITEM_NAME," + //保安员姓名
		"a.ITEM_IDCARDNO," + //证件号码
		"a.ITEM_IDCARDTYPE," + //证件类型
		"a.ITEM_CERTIFICATETYPE," + //证书类型
		"a.ITEM_CERTIFICATENO," + //证书编号
		"'五级' as ITEM_LEVEL," + //证书等级
		"a.ITEM_CONFIRMDATE," + //鉴定日期
		"a.ITEM_CERTIFICATEFROM," + //发证机关
		"a.ITEM_CERTIFICATEFROMNO," + //发证机关编号

		/*"case a.ITEM_STATUS when '1' then '正常'"+
		" when '0' then '吊销'"+
		" end as ITEM_STATUS," + //证书状态*/
		"'正常' as ITEM_STATUS," + //证书等级
		"a.ITEM_CULTIVATECOMPANY," + //所属培训机构
		"a.ITEM_COMPANYNAMETOGET," + //发证所在企业
		"a.ITEM_CULTIVATECOMPANYCODE," + //培训机构信用代码
		"a.ITEM_COMPANYNAMETOGETCODE," + //报名企业信用代码
		"a.ITEM_ONEINCHPHOTO," + //一寸照片
		"a.ITEM_BIRTHDAY," + //出生日期
		"a.ITEM_PERSONID," + //资格证报名id
		"a.ID,"+
		"c.ITEM_TRAININGENDTIME"+//发证日期 来自实操培训开班结束时间
		" from tlk_certification a left join tlk_level_class_student b on a.item_idcardno=b.item_idcardno  left join tlk_grade_card_class c on b.ITEM_CLASSID=c.ID    "+ whereStr+"   ";
	
	sql=sql+queryCriteriaSql;
   sql += " group by a.item_name";
   println(sql);
	return sql;    
  })();]]></sqlFilterScript>
  <procedureFilterScript><![CDATA[]]></procedureFilterScript>
  <filterCondition><![CDATA[[{"field":"name","operator":"LIKE","type":"03","ipField":"","numField":0,"daField":"","sfField":"z_name","syField":"","match":"z_name"},{"field":"idCardNo","operator":"LIKE","type":"03","ipField":"","numField":0,"daField":"","sfField":"z_idCard","syField":"","match":"z_idCard"},{"field":"cultivateCompany","operator":"LIKE","type":"03","ipField":"","numField":0,"daField":"","sfField":"jigou","syField":"","match":"jigou"},{"field":"certificateDate","operator":">=","type":"03","ipField":"","numField":0,"daField":"","sfField":"createStartDate","syField":"","match":"createStartDate"},{"field":"certificateDate","operator":"<=","type":"03","ipField":"","numField":0,"daField":"","sfField":"createEndDate","syField":"","match":"createEndDate"},{"field":"certificateNO","operator":"LIKE","type":"03","ipField":"","numField":0,"daField":"","sfField":"bianhao","syField":"","match":"bianhao"}]]]></filterCondition>
  <commonFilterCondition><![CDATA[[{"field":"z_name","isCommonFilter":"true","paramKey":1641262558749}]]]></commonFilterCondition>
  <authorityCondition>[]</authorityCondition>
  <openType>1</openType>
  <editMode>02</editMode>
  <width>0</width>
  <height>0</height>
</ListView>