<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Api id="__Eis9JvACgyKxMoPtkaU">
  <name>获取授权记录表</name>
  <parentId>__LgZds5MVHW3o08T7UcX</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <status>published</status>
  <apiGroup></apiGroup>
  <encode>UTF-8</encode>
  <requestType>get</requestType>
  <requestUrl>/lesson_auth_base_info</requestUrl>
  <tags></tags>
  <responseType>json</responseType>
  <responseScript><![CDATA[#include "sysfunction"
(function(){        
  var authLessonId = getParameter("authLessonId");                    
  var authUserId = getParameter("idCardNo"); 
  var lessonName = getParameter("lessonName"); 
  var playset = getParameter("playset"); 


  var whereStr = "where 1=1 ";           

  if(isNotNull(authLessonId)){              
    whereStr += "and a.ITEM_AUTHLESSONID ='"+authLessonId+"' ";              
  }   
  if(isNotNull(playset)){              
    whereStr += "and b.item_playset ='"+playset+"' ";              
  }  
  if(isNotNull(lessonName)){              
    whereStr += "and b.ITEM_LESSONNAME like '%"+lessonName+"%' ";              
  }  

  if(isNotNull(authUserId)){              
    whereStr += "and a.ITEM_AUTHUSERID ='"+authUserId+"' ";             
  }              

  var sql="select "+        
      "'"+ getDomainid() +"' as domainid,"+      
      "a.item_learnName,"+//保安公司名称
      "a.item_trainName,"+//培训公司名称
      "a.ITEM_AUTHUSERNAME," + //授权人员名称
      "a.ITEM_LEARNSTYLE,"+ //授权类型
      "b.ITEM_LESSONNAME," + //授权课程
      "a.ITEM_AUTHRECORDID,"+//报名id
      "b.item_playset," +   
      "a.ITEM_AUTHLESSONID," + //授权课程Id	        
      "a.ITEM_AUTHUSERID," + //授权人员身份证         
      "a.ITEM_AUTHRECORDID," + //授权记录Id    
      "a.ITEM_PROGRESS,"+ //学习进度
      "a.ITEM_AUTHLESSONCOVER,"+   
      "a.ID AS ITEM_ID,"+      
      "a.ID "+           
      "from tlk_lesson_auth_base_info a "+        
      "INNER JOIN "+sysfunction.DS_ORGANIZATIONAUTH+".tlk_lesson_base_info b on a.ITEM_AUTHLESSONID = b.ID and ifnull(a.item_ispass,'') != '1' and ifnull(a.item_isDelete,'')!='1' "+whereStr
  sql += " limit 1000"
      var datas = queryByDSName("tms",sql);
  return datas;     
})()]]></responseScript>
</Api>