<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Api id="__GVEGkbCsfAsvrACGuKs">
  <name>资格证人员监考信息</name>
  <parentId>__LgZds5MVHW3o08T7UcX</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <status>published</status>
  <apiGroup></apiGroup>
  <encode>UTF-8</encode>
  <requestType>get</requestType>
  <requestUrl>/exam/invigilate</requestUrl>
  <tags></tags>
  <responseType>json</responseType>
  <responseScript><![CDATA[(function(){
  var personId=getParameter("personId");  
  var examId=getParameter("examId");  
  var whereStr=" where 1=1 "
  if(isNotNull(personId)){
    whereStr += " and a.ITEM_person like '%"+personId+"%' ";
  }
  if(isNotNull(examId)){
    whereStr += " and a.id= '"+examId+"' ";
  }

  var sql = "select '"+getDomainid()+"'as domainid,"+
      "a.ITEM_SUBJECTID," + //考试科目
      "a.ITEM_EXAMTYPE," + //考试类型
      "a.ITEM_PAPERID," + //试卷名称
      "a.ITEM_EXAMSTATE," + //考试状态
      "a.ITEM_EXAMNAME," + //考试名称
      "a.ITEM_person," + //考点联系人
      "a.ITEM_ATTENTION," + //注意事项
      "a.ITEM_ISSTAMINA," + //是否理论考试
      "a.ITEM_STAMINAADDRESS," + //体能考试地址
      "DATE_FORMAT(a.ITEM_STAMINASTARTDATE, '%Y-%m-%d %H:%i:%S' ) as ITEM_STAMINASTARTDATE," + //体能测试开始时间
      "DATE_FORMAT(a.ITEM_STAMINAENDDATE, '%Y-%m-%d %H:%i:%S' ) as ITEM_STAMINAENDDATE," + //体能测试结束时间
      "a.ITEM_EXAMRULES," + //成绩考核规则
      "a.ITEM_THEORETICALADDRESS," + //理论考试地址
      "DATE_FORMAT( a.ITEM_COMPUTERSTARTDATE, '%Y-%m-%d %H:%i:%S' ) as ITEM_COMPUTERSTARTDATE," + //理论考试开始时间
      "DATE_FORMAT( a.ITEM_COMPUTERENDDATE, '%Y-%m-%d %H:%i:%S' ) as ITEM_COMPUTERENDDATE," + //理论考试结束时间
      "a.ITEM_WRITTENRATIO," + //理论分数占比
      "a.ITEM_OPERATERATIO," + //体能分数占比
      "a.ITEM_EXAMSTANDARD," + //成绩合格分数
      "a.ITEM_WRITTENPASSSCORE," + //理论考试合格分数
      "a.ITEM_OPERATEPASSSCORE," + //
      "a.ITEM_practical_fail_up," + //
      "a.ITEM_ISCOMPUTEREXAM," + //是否理论考试
      "a.ITEM_ISMAKEUPEXAM," + //是否有补考机会
      "a.ITEM_CANCELREASON," + //取消考试原因
      "count(b.ID) ITEM_COUNT,"+
      "a.ID,"+ 
      "a.ID as ITEM_ID"+
      " from tms.tlk_system_exam_info a "+
      " LEFT JOIN"+
      " tms.tlk_system_exam_person b on a.ID = b.ITEM_EXAMID "+whereStr+"  GROUP BY a.ID";
  sql += " limit 2000"
  var datas = queryByDSName("tms",sql);
  return datas;
})()]]></responseScript>
</Api>