<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListView id="__5vqsoS4qrW92ndrhsYp">
  <name>抽查人员</name>
  <parentId>__33O9dRsTvtyXuJr33bv</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <description>抽查人员</description>
  <pagination>true</pagination>
  <pageLines>10</pageLines>
  <showTotalRow>true</showTotalRow>
  <refresh>false</refresh>
  <refreshAll>false</refreshAll>
  <newPage>false</newPage>
  <readonly>true</readonly>
  <relatedMap><![CDATA[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ]]></relatedMap>
  <displayType>relatedForm</displayType>
  <defaultShowMode>month</defaultShowMode>
  <collapsibleShowMode>normal</collapsibleShowMode>
  <showWaterMark>false</showWaterMark>
  <showActivityColumnType>0</showActivityColumnType>
  <searchFormId>__5EfKG4SOSweKLNqdcYC</searchFormId>
  <autoCompose>true</autoCompose>
  <relatedForm></relatedForm>
  <permissionType>public</permissionType>
  <filterScript><![CDATA[]]></filterScript>
  <sqlFilterScript><![CDATA[(function(){
  var domainId= getDomainid();
  var whereStr=" and 1=1 "
  var name = getItemValueAsString("z_name");  
  var idCard = getItemValueAsString("z_idCard");
  var phone = getItemValueAsString("z_phone");
  var status = getItemValueAsString("status");
  var applystatus = getItemValueAsString("applystatus");
  var company = getItemValueAsString("company")
  var reviewResult = getItemValueAsString("reviewResult");
  if(isNotNull(name)){            
    whereStr += "and (a.ITEM_NAME like concat('%','"+name+"','%'))";           
  }
  if(isNotNull(idCard)){            
    whereStr += "and (a.ITEM_IDCARDNO like concat('%','"+idCard+"','%'))";           
  }
  if(isNotNull(phone)){            
    whereStr += "and (a.ITEM_PHONE like concat('%','"+phone+"','%'))";           
  }
  if(isNotNull(status)){            
    whereStr += "and (a.ITEM_reviewStatus like concat('%','"+status+"','%'))";           
  }
  if(isNotNull(applystatus)){            
    whereStr += "and (a.ITEM_APPLYSTATUS like concat('%','"+applystatus+"','%'))";           
  }
  if(isNotNull(company)){            
    whereStr += "and (a.ITEM_LEARNNAME like concat('%','"+company+"','%'))";           
  }
  if(isNotNull(reviewResult)){            
    whereStr += "and (a.ITEM_reviewResult like concat('%','"+reviewResult+"','%'))";           
  }
  
  var sql = "select '"+domainId+"' as domainid,"+
      "a.ITEM_LEARNNAME," + //所属企业
      //"b.ITEM_PROGRESS," + //课程进度
      "a.ITEM_LEARNID," + //所属企业id
      "a.ITEM_NAME," + //姓名
      //    "a.formid,"+
      "a.item_birthday,"+//出生年月
      "a.item_education,"+//文化程度
      "a.item_residentType,"+//户籍类型
      "a.item_HEIGHT,"+//身高
      "a.item_CONTRACTNAME,"+//合同名称
      "a.ITEM_EFFECTSTARTDATE,"+//合同有效期开始
      "a.ITEM_EFFECTENDDATE,"+//合同有效期结束
      "a.ITEM_CONTRACTFILE,"+//合同文件
      "a.ITEM_IDCARDNOFRONTURL,"+//身份证人像面
      "a.ITEM_IDCARDNOBACKURL,"+//身份证国徽面
      "a.ITEM_RESIDENTPLACETYPE,"+
      "a.ITEM_PHONE," + //手机号
      "a.ITEM_IDCARDNO," + //身份证号
      "FORMAT(ifnull( b.ITEM_PROGRESS, '0' ),2) ITEM_PROGRESS,"+
      "case a.ITEM_APPLYSTATUS when '0' then '申报中'"+
      " when '1' then '申报通过'"+
      " when '2' then '申报不通过'"+ 
      " when '3' then '申报撤销'"+   
      " when '4' then '审批中'"+      
      " end as ITEM_APPLYSTATUS," + //申报状态
      "case a.ITEM_reviewStatus when '0' then '待审查' " + //审查状态
      " when '1' then '已审查'"+
      " when '2' then '待复审'"+ 
      " when '3' then '已复审'"+   
      " end as ITEM_reviewStatus," +
      "case a.ITEM_reviewResult when '0' then '--' " + //审查结果
      " when '1' then '审查通过'"+
      " when '2' then '审查不通过'"+ 
      " when '3' then '复审通过'"+   
      " when '4' then '复审不通过'"+    
      " end as ITEM_reviewResult," +
      "a.ITEM_TRAINID," + //培训公司id
      "a.ITEM_TRAINNAME," + //培训公司
      "a.CREATED as item_Ctime,"+//报名时间
      "case when d.id is null then '未安排' else '已安排' end item_examinationStatus,"+//用于判断考试安排状态，为空即未安排考试
      "(case d.item_testState  when '0' then '不合格' when '1' then '合格' else '未考试'end) item_testState,"+//考试结果
      "a.ID,"+
      "a.ID as ITEM_ID"+
      " from tlk_qualify_person_apply a "+
      " left join tlk_lesson_auth_base_info b  on b.ITEM_AUTHRECORDID=a.id and b.item_isdelete != '1'  "+
      " LEFT JOIN tlk_system_exam_person d on d.ITEM_APPLYID = a.ID"+
      " where a.ITEM_APPLYSTATUS = '0' and a.ITEM_trainId = '"+domainId+"'  and b.item_learnstyle='1' and ITEM_reviewStatus in ('1','2','3') and b.item_learnstyle = '1'  "+whereStr+" ORDER BY item_Ctime DESC "
    

  println("111111111111111111555"+sql);
  return sql;
})()]]></sqlFilterScript>
  <procedureFilterScript><![CDATA[]]></procedureFilterScript>
  <filterCondition><![CDATA[[]]]></filterCondition>
  <commonFilterCondition><![CDATA[[{"field":"z_name","isCommonFilter":"true","paramKey":1640933985189}]]]></commonFilterCondition>
  <authorityCondition>[]</authorityCondition>
  <openType>1</openType>
  <editMode>02</editMode>
  <width>0</width>
  <height>0</height>
</ListView>