<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Api id="__CPstwWR0GSsrgby9thX">
  <name>行业考试管理-我管理的-教师核验记录</name>
  <parentId>__LgZds5MVHW3o08T7UcX</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <status>published</status>
  <apiGroup></apiGroup>
  <encode>UTF-8</encode>
  <requestType>post</requestType>
  <requestUrl>/train/select/teacher/face/list</requestUrl>
  <tags></tags>
  <responseType>json</responseType>
  <responseScript><![CDATA[(function(){
  var result = new Packages.java.util.HashMap();
  var userName= getWebUser().getName();
  var userid = getWebUser().getId();
  var jsonStr = getParameter("_content");
  if(isNotNull(jsonStr)){
    var json = JSON.parse(jsonStr);
    var class_id = json["class_id"]
    var selectKey = json["selectKey"]
    var resuilt = json["resuilt"]
    var whereStr=" "
    if(isNotNull(selectKey)){
      whereStr+=" and (person.item_idcard_no like '%"+selectKey+"%' or  person.item_person_name like '%"+selectKey+"%' )"
    }
    if(isNotNull(resuilt)){
      whereStr+=" and person.item_check_resuilt= '"+resuilt+"' "
    }
    var sql="select '"+getDomainid()+"' as domainid,"+
        "person.id,DATE_FORMAT(person.created, '%Y-%m-%d %H:%i:%s') as item_face_date,"+//人脸核验时间
        "case person.item_check_resuilt when '0' then '不通过' when '1' then '通过' end as item_resuilt,"+//人脸结果
        "person.item_teacher_name, "+//核验老师
        "person.item_person_name, "+//姓名
        "person.item_idcard_no, "+//身份证
        "person.item_telephone "+//手机号
        "from tlk_train_train_face person where item_type='1' and  item_class_id='"+class_id+"' and item_teacher_id='"+userid+"'"+whereStr+
    " order by person.created desc "
    var datas = queryByDSName("tms",sql); 
    result.put("data",datas);
    result.put("total",datas.size());
    result.put("code","200");
    result.put("msg","OK");
    result.put("state", true);
    return result;
  }else{
    result.put("code","500");
    result.put("msg","请求体不能为空！");
    result.put("state", false);
    return result;
  }

})()]]></responseScript>
</Api>