<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListView id="__ByI6tHaZFHyMpI51MYL">
  <name>培训记录查询</name>
  <parentId>__hGBmZIJlszexS9jEYx0</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <pagination>true</pagination>
  <pageLines>10</pageLines>
  <showTotalRow>true</showTotalRow>
  <refresh>false</refresh>
  <refreshAll>false</refreshAll>
  <newPage>false</newPage>
  <lastModifyTime>2025-04-30T17:17:47.000+08:00</lastModifyTime>
  <readonly>false</readonly>
  <displayType>relatedForm</displayType>
  <defaultShowMode>month</defaultShowMode>
  <collapsibleShowMode>normal</collapsibleShowMode>
  <showWaterMark>false</showWaterMark>
  <showActivityColumnType>0</showActivityColumnType>
  <searchFormId>__oRYvbQ4xj8Z04l9Z1lD</searchFormId>
  <autoCompose>true</autoCompose>
  <relatedForm>__Wgz1dukcCuAmA1lXi9u</relatedForm>
  <permissionType>public</permissionType>
  <filterScript><![CDATA[]]></filterScript>
  <sqlFilterScript><![CDATA[(function(){
  var whereStr= " and 1=1 "
  var person_name = getItemValueAsString("person_name");  
  if(isNotNull(person_name)){                                        
    whereStr = whereStr + " and p.item_person_name like '%"+person_name+"%' "
  }  
  var telephone = getItemValueAsString("telephone");  
  if(isNotNull(telephone)){                                        
    whereStr = whereStr + " and p.item_telephone like '%"+telephone+"%' "
  }
  var idcard_no = getItemValueAsString("idcard_no");  
  if(isNotNull(idcard_no)){                                        
    whereStr = whereStr + " and p.item_idcard_no like '%"+idcard_no+"%' "
  }
  var domain_name = getItemValueAsString("domain_name");  
  if(isNotNull(domain_name)){                                        
    whereStr = whereStr + " and p.item_domain_name like '%"+domain_name+"%' "
  }
  var plan_name = getItemValueAsString("plan_name");  
  if(isNotNull(plan_name)){                                        
    whereStr = whereStr + " and p.item_plan_name like '%"+plan_name+"%' "
  }
  var point_type = getItemValueAsString("point_type");  
  if(isNotNull(point_type)){                                        
    whereStr = whereStr + " and p.item_point_type = '"+point_type+"' "
  }
  var trian_name = getItemValueAsString("trian_name");  
  if(isNotNull(trian_name)){                                        
    whereStr = whereStr + " and p.item_trian_name like '%"+trian_name+"%' "
  }
  var pay_status = getItemValueAsString("pay_status");  
  if(isNotNull(pay_status)){                                        
    whereStr = whereStr + " and p.item_pay_status = '"+pay_status+"' "
  }
  var exam_name = getItemValueAsString("exam_name");  
  if(isNotNull(exam_name)){                                        
    whereStr = whereStr + " and e.item_exam_name like '%"+exam_name+"%' "
  }
 
  var exam_info = getItemValueAsString("exam_info");  
  if(isNotNull(exam_info)){                                        
    whereStr = whereStr + " and ep.item_exam_info = '"+exam_info+"' "
  }

  var confirm_start_time = getItemValueAsDate("confirm_start_time");
  if(isNotNull(confirm_start_time)){                                        
    whereStr = whereStr + " and ep.item_confirm_time >= '"+format(confirm_start_time,"yyyy-MM-dd HH:mm:ss")+"' "
  }
  var confirm_end_time = getItemValueAsDate("confirm_end_time");
  if(isNotNull(confirm_end_time)){                                        
    whereStr = whereStr + " and ep.item_confirm_time <= '"+format(confirm_end_time,"yyyy-MM-dd HH:mm:ss")+"' "
  }
    var sql="select '"+getDomainid()+"' as domainid,person.created,"+
        "person.item_person_name,"+//姓名
        "person.item_telephone,"+//手机号码
        "person.item_idcard_no,"+//身份证
        "person.item_domain_name,"+//报名单位
        "plan.item_plan,"+//培训计划
        "type.item_point_type,"+//培训类型
        "case MAX( CASE WHEN person.item_classroom_type = '理论教室' THEN person.item_sign_status END ) when '1' then '已签到' else '未签到' end AS item_is_computer_sign ,"+//理论是否签到
        "case MAX( CASE WHEN person.item_classroom_type = '实操教室' THEN  person.item_sign_status  END ) when '1' then '已签到' else '未签到' end  AS item_is_operate_sign ,"+//实操是否签到
        "concat(DATE_FORMAT(plan.item_train_start_time, '%Y-%m-%d'),'~',DATE_FORMAT(plan.item_train_end_time, '%Y-%m-%d')) as item_train_time,"+//培训时间
        "MAX(CASE WHEN person.item_classroom_type = '理论教室' THEN class.item_class_name ELSE '' END) AS item_computer_class ,"+//理论教室
        "MAX(CASE WHEN person.item_classroom_type = '实操教室' THEN class.item_class_name ELSE '' END) AS item_operate_class "+//实操教室
        "from tlk_train_person person "+
        "inner join tlk_train_class_info class on class.id=person.item_class_id "+
        "inner join tlk_train_classroom classroom on classroom.id=class.item_classroom_id "+
        "inner join tlk_train_plan plan on plan.id=person.item_plan_id "+
        "left join tlk_train_point_type type on type.id = person.item_point_type " +
        "where person.item_train_domain_id='"+getDomainid()+"'"+whereStr+
        "group by person.item_idcard_no, plan.id " +
        " order by person.created desc "
    println(sql)
return sql 
})()]]></sqlFilterScript>
  <procedureFilterScript><![CDATA[]]></procedureFilterScript>
  <filterCondition><![CDATA[[]]]></filterCondition>
  <commonFilterCondition><![CDATA[[]]]></commonFilterCondition>
  <authorityCondition>[]</authorityCondition>
  <openType>293</openType>
  <editMode>02</editMode>
  <width>0</width>
  <height>0</height>
</ListView>