<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListView id="__4OmOocgSJDtNQu7hz7F">
  <name>考试人员</name>
  <parentId>__xmA8P0JniFiisvoPiWM</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>false</readonly>
  <relatedMap><![CDATA[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ]]></relatedMap>
  <displayType>relatedForm</displayType>
  <defaultShowMode>month</defaultShowMode>
  <collapsibleShowMode>normal</collapsibleShowMode>
  <showWaterMark>false</showWaterMark>
  <showActivityColumnType>0</showActivityColumnType>
  <searchFormId>__eB6NIz0fTM6s4Dq2sru</searchFormId>
  <autoCompose>false</autoCompose>
  <relatedForm>__2i8jAJxf4DjUsB0szBf</relatedForm>
  <permissionType>public</permissionType>
  <filterScript><![CDATA[]]></filterScript>
  <sqlFilterScript><![CDATA[(function(){
  
  var lessonauth = getItemValueAsString("lessonauth"); 
  var apptype = getItemValueAsString("apptype"); 
  var registerPoliceAddress = getItemValueAsString("registerPoliceAddress"); 
  var examId=decodeURI(getParameter("examId")); 
  println("examId是对的吗？？？？？？？？"+examId)

  var examSiteId=decodeURI(getParameter("examSiteId")); //考试点id

  var computerStartDate=decodeURI(getParameter("computerStartDate")); 
  var computerEndDate=decodeURI(getParameter("computerEndDate")); 

  println("computerStartDate========.!!!>"+computerStartDate);
  println("computerEndDate========.!!!>"+computerEndDate);
  var theoreticalAddress=decodeURI(getParameter("theoreticalAddress")); 
  var now = getToday();
  println("now========.!!!>"+now)
  var now = format(now,"yyyy-MM-dd HH:mm:ss"); 
  println("now========.!!!>"+now)
  println("theoreticalAddress========.!!!>"+theoreticalAddress);
  var examRules=decodeURI(getParameter("examRules")); 
  println("examRules========.!!!>"+examRules);
  var writtenPassScore=decodeURI(getParameter("writtenPassScore")); 
  println("writtenScore========.!!!>"+writtenPassScore);
  var operatePassScore=decodeURI(getParameter("operatePassScore")); 
  println("operateScore========.!!!>"+operatePassScore);

  var whereStr = "where a.ITEM_EXAMID = '"+examId+"'  ";       
  var cardState = getItemValueAsString("cardState");        
  var testState = getItemValueAsString("testState");                  
  var name = getItemValueAsString("name");       
  var isbukao = getItemValueAsString("isbukao");       
  var idCardNo = getItemValueAsString("idCardNo");           
  var scoreMsgState = getItemValueAsString("scoreMsgState");  
  var company = getItemValueAsString("company"); 
  var SIGNIN = getItemValueAsString("SIGNIN"); 
  var isstamina = getItemValueAsString("isstamina"); 
  if(isNotNull(SIGNIN)){          
    whereStr += "and a.ITEM_SIGNIN = '"+SIGNIN+"' ";           
  }
  if(isNotNull(isstamina)){
    whereStr += "and b.ITEM_ISSTAMINA = '"+isstamina+"' "; 
  }
  if(isNotNull(lessonauth)){ 
    if("1".equals(lessonauth)){
      whereStr += "and (c.item_lessonid is not null and ifnull(c.item_lessonid,'') != '') ";  
    }else{
      whereStr += "and (c.item_lessonid is  null or ifnull(c.item_lessonid,'') = '') ";  
    }
  }
  if(isNotNull(name)){            
    whereStr += "and a.ITEM_NAME like concat('%','"+name+"','%') ";            
  }     
  if(isNotNull(isbukao)){            
    whereStr += "and a.ITEM_ismakeup = '"+isbukao+"' ";            
  }
  if(isNotNull(idCardNo)){            
    whereStr += "and a.ITEM_IDCARDNO like concat('%','"+idCardNo+"','%') ";                  
  }            
  if(isNotNull(company)){            
    whereStr += "and a.ITEM_COMPANY like concat('%','"+company+"','%') ";              
  }            
  if(isNotNull(testState)){          
    whereStr += "and a.ITEM_TESTSTATE = '"+testState+"' ";           
  }
  if(isNotNull(apptype)){   
    if("-".equals(apptype)){
      whereStr += "and (a.ITEM_apptype = '"+apptype+"' or ifnull(a.ITEM_apptype,'') = '') ";   
    }else{
      whereStr += "and a.ITEM_apptype = '"+apptype+"' ";   
    }
  }
  if(isNotNull(cardState)){          
    whereStr += "and a.ITEM_CARDSTATE = '"+cardState+"' ";           
  }
  if(isNotNull(scoreMsgState)){          
    whereStr += "and a.ITEM_SCOREMSGSTATE = '"+scoreMsgState+"' ";           
  }
  if(isNotNull(registerPoliceAddress)){            
    whereStr += "and p.ITEM_registerPoliceAddress like concat('%','"+registerPoliceAddress+"','%') ";            
  }
  
    var sql =  "select "+
        "  date_format(a.CREATED,'%Y-%m-%d %H:%i:%s')  as ITEM_CREATED,"+
        " '"+getDomainid()+"' as domainid,"+  
        "a.ITEM_SECURITYID," + //保安员id
        "a.ITEM_IDCARDNO," + //身份证
        "a.ITEM_NAME," + //姓名
        "a.ITEM_COMPANY," + //所属公司
        "a.ITEM_MOBILE," + //手机号
        " case a.ITEM_apptype when '-' then '未考试' when '0' then 'app考试' when '1' then '纸质考试' else '未考试' end ITEM_apptype ," + //考试方式
        "a.ITEM_WRITTENSCORE," + //笔试成绩
        "a.ITEM_OPERATESCORE," + //实操成绩
        "a.ITEM_SUMSCORE," + //总成绩
        "a.ITEM_remark," + //备注
        "a.ITEM_TESTSTATE," + //考试成绩状态
        " case a.ITEM_NOTICESTATE when '0' then '未通知' when '1' then '已通知' end ITEM_NOTICESTATE ," + //考试通知状态
        "a.ITEM_SCORESTATE," + //成绩确认状态
        "a.ITEM_CARDSTATE," + //制证状态
        "a.item_zw," + //座位号
        "a.ITEM_APPLYID," + //报名id
        "a.ITEM_photo," + //报名id
        "b.ITEM_type," + 
        "p.ITEM_REGISTERPOLICEADDRESS," + //办事机构
        "a.item_zw AS item_number,"+
        "a.ITEM_WRITTENSTATE," + //笔试状态
        "a.ITEM_WRITTENRECORD," + //笔试做题记录
        "case a.ITEM_ISMAKEUP when '0' then '否' when '2' then '是' else '' end as ITEM_ISMAKEUP ," + //是否补考
        "case a.ITEM_SIGNIN when '1' then '是' else '否' end as item_signin," + //是否签到
        "a.ITEM_CONFIRMDATE," + //确认成绩的时间
        "a.ITEM_confirmoperator," + //确认成绩的时间
        "a.ITEM_EXAMID," + //考试id
        "case c.item_lessonid when '' then '否' when null then '否' else '是' end as item_lessonauth," + //考试id
        "a.ID AS ITEM_ID,"+
        " b.ITEM_examine,"+
        " b.ITEM_examState,"+
        " b.ITEM_examname,"+
        "a.ID,"+
        "p.item_operator,"+//报名负责人
        "p.item_operator_phone"+//报名负责人联系方式
        " from tlk_system_exam_person a left join tlk_qualify_person_apply p on a.item_applyid = p.id   join tlk_learn_order_person c on c.item_appid = a.item_applyid and ifnull(c.item_isdelete,'') != '1' and c.item_orderstate = '1'  join tlk_system_exam_info b on a.ITEM_EXAMID =b.ID  ,(SELECT @rownum:=0) i "+whereStr+" order by a.item_zw*1 ";//	ORDER BY ITEM_CREATED
  println(sql);
  return sql;

})()]]></sqlFilterScript>
  <procedureFilterScript><![CDATA[]]></procedureFilterScript>
  <filterCondition><![CDATA[[]]]></filterCondition>
  <commonFilterCondition><![CDATA[[{"field":"name","isCommonFilter":"true","paramKey":1641978900936}]]]></commonFilterCondition>
  <authorityCondition>[]</authorityCondition>
  <openType>1</openType>
  <editMode>02</editMode>
  <width>0</width>
  <height>0</height>
</ListView>