<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Api id="__uTlO8K6dIYrYkcxWWHs">
  <name>获取证书</name>
  <parentId>__LgZds5MVHW3o08T7UcX</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <status>published</status>
  <apiGroup></apiGroup>
  <encode>UTF-8</encode>
  <requestType>get</requestType>
  <requestUrl>/certification</requestUrl>
  <tags></tags>
  <responseType>json</responseType>
  <responseScript><![CDATA[(function(){
 var idCardNo=getParameter("idCardNo");
  var whereStr=" where 1=1 "
  var whereStr2=" where 1=1 "
 if(isNotNull(idCardNo)){            
whereStr += "and a.ITEM_DOCUMENTID = '"+idCardNo+"' ";            
} 
   if(isNotNull(idCardNo)){            
whereStr2 += "and a.ITEM_IDCARDNO = '"+idCardNo+"' ";            
} 
 

var sql = "select '"+ getDomainid()+"' AS DOMAINID,"+
    "a.id,"+
    "a.item_certificateType,"+
  "a.ITEM_CERTIFICATENO," + //证书编号
  "a.ITEM_CERTIFICATEFROM," + //发证机关
  "DATE_FORMAT(a.ITEM_CERTIFICATEDATE, '%Y-%m-%d' ) as ITEM_CERTIFICATEDATE," + //发证日期
  "a.ITEM_SECURITYNAME," + //保安员姓名
  "a.ITEM_LEVEL," + //证书等级
  "DATE_FORMAT(a.ITEM_CONFIRMDATE, '%Y-%m-%d' ) as ITEM_CONFIRMDATE," + //鉴定日期
  "a.ITEM_DOCUMENTID " + //
  " from baibaodunflow.tlk_Certificate a  "+whereStr+
    " union all "+
    "select '"+ getDomainid()+"' AS DOMAINID,"+
     "a.id,"+
      "a.item_certificateType,"+
  "a.ITEM_CERTIFICATENO," + //证书编号
  "a.ITEM_CERTIFICATEFROM," + //发证机关
  "DATE_FORMAT(a.ITEM_CERTIFICATEDATE, '%Y-%m-%d' ) as ITEM_CERTIFICATEDATE," + //发证日期
  "a.ITEM_NAME," + //保安员姓名
  "a.ITEM_LEVEL," + //证书等级
  "DATE_FORMAT(a.ITEM_CONFIRMDATE, '%Y-%m-%d' ) as ITEM_CONFIRMDATE," + //鉴定日期
  "a.ITEM_IDCARDNO " + //
     " from tms.tlk_certification a "+whereStr2+" ";
  sql += " limit 1000"
var datas = queryByDSName("baibaodunFlow",sql);
return datas;
})()]]></responseScript>
</Api>