<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListView id="__WvmJVaojPRkDOsoZgz0">
  <name>grade_class_student</name>
  <parentId>__AT2erAITyWrFQyQEh3m</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>__SUJkQFOtURm6qmtlTPN</searchFormId>
  <autoCompose>false</autoCompose>
  <relatedForm>__TTLL6anXeEmwkn6UvAO</relatedForm>
  <permissionType>public</permissionType>
  <filterScript><![CDATA[]]></filterScript>
  <sqlFilterScript><![CDATA[(function(){

  var domainId = getDomainid();
  var keyWord = getItemValueAsString("keyWord");//关键字
  var companyName = getItemValueAsString("companyName");//保安公司名称
  var isMakeUp = getItemValueAsString("isMakeUp"); //是否补考
  var graduationTestResults = getItemValueAsString("graduationTestResults"); //结业考试结果
  var identificationTestResults = getItemValueAsString("identificationTestResults"); //鉴定考试结果
  var classId=decodeURI(getParameter("classId"));  
  new Packages.cn.myapps.common.util.cache.MemoryCacheUtil.putToPrivateSpace("classId", classId, getWebUser()); //写缓存
  //println("keyWord==========================>"+keyWord);
  var loginNo=getWebUser().getLoginno();      
  var userId = getUserIdByLoginno(loginNo);   
  var request = $WEB.getParamsTable().getHttpRequest();
  request.getSession().setAttribute(userId + "classId",classId);
  var whereStr = " where 1=1 ";         
  if(isNotNull(classId)){            
    whereStr += "and a.ITEM_CLASSID = '"+classId+"' ";
  } 

  if(isNotNull(keyWord)){            
    whereStr += "and (a.ITEM_NAME like concat('%','"+keyWord+"','%')"+
      " or a.ITEM_PHONE like concat('%','"+keyWord+"','%')"+
      " or a.ITEM_IDCARDNO like concat('%','"+keyWord+"','%')) ";           
  }
  if(isNotNull(companyName)){            
    whereStr += "and a.ITEM_COMPANY like concat('%','"+companyName+"','%') ";            
  } 
  if(isNotNull(isMakeUp)){            
    whereStr += "and a.ITEM_ISMAKEUP like concat('%','"+isMakeUp+"','%') ";           
  } 
  if(isNotNull(graduationTestResults)){    
    if("0".equals(graduationTestResults)){
      whereStr += "and a.ITEM_GRADUATIONTESTRESULTS is null or a.ITEM_GRADUATIONTESTRESULTS = '0' "; 
    }else{
      whereStr += "and a.ITEM_GRADUATIONTESTRESULTS like concat('%','"+graduationTestResults+"','%') ";
    }
  }  
  if(isNotNull(identificationTestResults)){  
    if("0".equals(identificationTestResults)){
      whereStr += "and b.ITEM_IDENTIFICATIONTESTRESULTS is null or b.ITEM_IDENTIFICATIONTESTRESULTS = '0' "; 
    }else{
      whereStr += "and b.ITEM_IDENTIFICATIONTESTRESULTS like concat('%','"+identificationTestResults+"','%') "; 
    }
  } 

  var sql = "select '"+domainId+"' as domainid,"+
      "a.ITEM_NAME," + //姓名
      "a.ITEM_COMPANY," + //所属公司
      "a.ITEM_PHONE," + //手机号
      "a.ITEM_IDCARDNO," + //身份证号码
      "a.ITEM_ISMAKEUP," + //是否补考
      "a.ITEM_sumScore," + //总成绩
      //"a.ITEM_CONFIRMDATE," + //总成绩
      " DATE_FORMAT(a.ITEM_CONFIRMDATE,'%Y-%m-%d %H:%i:%S') item_confirmdate,"+
      //"date_format(a.,'%Y-%m-%d %H:%m:%s') as ," + //确认成绩的时间
      "a.ITEM_confirmoperator," + //确认成绩操作人
      "case a.ITEM_cardState when '1' then '已制证' when '2' then '制证中' when '0' then '未制证' end as ITEM_cardState," + //制证状态
      "case a.ITEM_scoreState when '1' then '已确认' when '0' then '未确认' end as ITEM_scoreState," + //成绩确认状态
      "a.ITEM_lessonPROGRESS," + //课程学习进度
      "a.ITEM_INTERNSHIPRECORDSTATUS," + //实习记录状态
      "a.ITEM_INTERNSHIPDAYS," + //实习天数
      "a.ITEM_INTERNSHIPTIME," + //实习时间
      "a.ITEM_TRAININGNOTICE," + //实操培训通知
      " case a.ITEM_apptype when '-' then '未考试' when '0' then 'app考试' when '1' then '纸质考试' else '未考试' end ITEM_apptype ," + //考试方式
      "a.ITEM_GRADUATIONTESTNOTIFICATION," + //结业考试通知
      "a.ITEM_IDENTIFICATIONTESTNOTIFICATION," + //鉴定考试通知
      "a.ITEM_GRADUATIONTESTRESULTS," + //结业考试结果
      "a.ITEM_GRADUATIONTHEORYSCORE," + //结业理论分数
      "a.ITEM_GRADUATIONOPERATIONSCORE," + //结业实操分数
      "b.ITEM_IDENTIFICATIONTESTRESULTS," + //鉴定考试结果
      "b.ITEM_IDENTIFICATIONTHEORYSCORE," + //鉴定理论成绩
      "b.ITEM_IDENTIFICATIONOPERATIONSCORE," + //鉴定实操分数
      "a.ITEM_CLASSID," + //班级id
      "case a.ITEM_noticeState when '1' then '已通知' when '0' then '未通知' end as ITEM_noticeState," + //考试通知状态
      "a.ID,"+ 
      //"a.formID,"+ 
      "a.applicationid,"+ 
      "a.ID as ITEM_ID"+
      " from tlk_level_class_student a left join tlk_scores b on a.ITEM_IDCARDNO=b.ITEM_IDCARDNO "+ whereStr+"";

  //" from tlk_level_class_student a"+ whereStr+"";

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