<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListView id="__BvgSQ1NlaFXnrik0fWw">
  <name>证书列表</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()+"'   ";
  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 a.ITEM_CERTIFICATEDATE >= '"+format(createStartDate,"yyyy-MM-dd")+"' ";            
  }            
  if(isNotNull(createEndDate)){            
    queryCriteriaSql += " and a.ITEM_CERTIFICATEDATE < DATE_FORMAT(DATE_ADD('"+format(createEndDate,"yyyy-MM-dd")+"',INTERVAL 1 DAY),'%Y-%m-%d')";             
  }
  var type = getParameter("type");
  println("type-------------------"+type);
  println("typepppppppppppppppp"+type)
  if(!isNotNull(type)){
    type = "0";
  }
  
  if("0".equals(type)){
    queryCriteriaSql += " and a.ITEM_CERTIFICATETYPE='1' ";
  }else{
    queryCriteriaSql += " and a.ITEM_CERTIFICATETYPE='11' ";
  }
  println("typepppppppppppppppp"+type)
  
  /*if(isNotNull(status)){            
    queryCriteriaSql = queryCriteriaSql + " and a.ITEM_STATUS like concat('%','"+status+"','%')"           
  }*/ 

  var sql = "select '"+getDomainid()+"' as domainId,a.id,a.created,"+
      "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," + //发证机关编号
      "a.ITEM_CERTIFICATEDATE," + //发证日期
      "case a.ITEM_STATUS when '1' then '正常'"+
      " when '0' then '吊销'"+
      " end 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.ITEM_ATTACHMENT" + //pdf签章
      " from tlk_certification a "+whereStr;
  sql=sql+queryCriteriaSql;
  var order ="ORDER BY a.created desc"
  sql=sql+order;
  println(sql);
  return sql;    
})();]]></sqlFilterScript>
  <procedureFilterScript><![CDATA[]]></procedureFilterScript>
  <filterCondition><![CDATA[[]]]></filterCondition>
  <commonFilterCondition><![CDATA[[{"field":"z_name","isCommonFilter":"true","paramKey":1640937626762}]]]></commonFilterCondition>
  <authorityCondition>[]</authorityCondition>
  <openType>1</openType>
  <editMode>02</editMode>
  <width>0</width>
  <height>0</height>
</ListView>