<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Api id="__pc9ShoCmxrDlLAwZVmK">
  <name>资格证获取考场信息</name>
  <parentId>__LgZds5MVHW3o08T7UcX</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <status>published</status>
  <apiGroup></apiGroup>
  <encode>UTF-8</encode>
  <requestType>get</requestType>
  <requestUrl>/exam/examRoom</requestUrl>
  <tags></tags>
  <responseType>json</responseType>
  <responseScript><![CDATA[(function(){
  var placeId = getParameter("placeId"); 
  var formId='__Pg1xGkcJskeVnxOMxSf';//placeId包含该字符串为北京地区
  var whereStr = " where 1=1 "; 
  if(isNotNull(placeId)){            
    whereStr += "and a.id='"+placeId+"' ";            
  }
  if(placeId.indexOf(formId)!=-1){
    //北京地区
    var sql="select '"+getDomainid()+
        "' as domainid,"+  
        "b.ITEM_TRAINING_NAME as ITEM_TRAININGINSTITUTIONS," + //培训机构
        "a.ITEM_ROOM_NAME as ITEM_ADDRESSNAME," + //考场名称
        "b.ITEM_ADDRESS as ITEM_ADDRESS," + //考场地点
        "a.ITEM_LONGITUDE as ITEM_LONGITUDE," + //进度
        "a.ITEM_LATITUDE as ITEM_LATITUDE," + //考场纬度
        "a.ITEM_ROOM_RANGE as ITEM_RANGE," + //有效范围
        "a.ITEM_ROOM_PERSON_LIMIT as ITEM_MAXNUMBER," + //最大考试人数
        "a.ITEM_ROOM_ACTIVATION_MODE as ITEM_STATE," + //考场状态
        "a.ID AS ITEM_ID,"+
        "a.ID "+
        " from tms.tlk_exam_room a join tms.tlk_exam_site b on a.ITEM_EXAM_SITE_ID=b.id "+whereStr;
  }else{
    var sql =  "select '"+getDomainid()+
        "' as domainid,"+  
        "ITEM_TRAININGINSTITUTIONS," + //培训机构
        "ITEM_ADDRESSNAME," + //考场名称
        "ITEM_ADDRESS," + //考场地点
        "ITEM_LONGITUDE," + //进度
        "ITEM_LATITUDE," + //考场纬度
        "ITEM_RANGE," + //有效范围
        "ITEM_MAXNUMBER," + //最大考试人数
        "ITEM_STATE," + //考场状态
        "ID AS ITEM_ID,"+
        "ID"+
        " from tms.tlk_examination_room a  "+whereStr;
  }
  sql += " limit 1000"
  var datas = queryByDSName("tms",sql);
  return datas;
})()]]></responseScript>
</Api>