<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListView id="__RjBwSlDT5gcbMwSa51t">
  <name>apply_pay_person</name>
  <parentId>__HIZjMfqH2bnkhj0pPWl</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>__zjIYZSshOUckjytdFVL</searchFormId>
  <autoCompose>true</autoCompose>
  <permissionType>public</permissionType>
  <filterScript><![CDATA[]]></filterScript>
  <sqlFilterScript><![CDATA[#include "sysfunction";
(function(){
var keyWords = getItemValueAsString("keyWords"); 
var trainName = getItemValueAsString("trainName"); 
var createStartDate = getItemValueAsDate("createStartDate"); 
var createEndDate = getItemValueAsDate("createEndDate"); 

var whereStr = " where 1=1  ";         
if(isNotNull(keyWords)){            
  whereStr += "and (a.ITEM_NAME like concat('%','"+keyWords+"','%')"+
			" or a.ITEM_PHONE like concat('%','"+keyWords+"','%')"+
			" or a.ITEM_IDCARDNO like concat('%','"+keyWords+"','%')) ";           
}   
if(isNotNull(trainName)){            
  whereStr += "and a.ITEM_TRAINNAME like concat('%','"+trainName+"','%') ";            
}     
if(isNotNull(createStartDate)){            
  whereStr += "and a.CREATED >= '"+format(createStartDate,"yyyy-MM-dd HH:mm:ss")+"' ";            
}            
if(isNotNull(createEndDate)){            
  whereStr += "and a.CREATED <= '"+format(createEndDate,"yyyy-MM-dd HH:mm:ss")+"' ";            
}            
var sql = " select domainid,ITEM_LEARNNAME,ITEM_CREATED,ITEM_NAME,ITEM_PAYDATE,ITEM_PHONE,ITEM_IDCARDNO,ITEM_PRICE,ITEM_LESSONNAME from (SELECT "+
	"a.domainid,"+
	"a.ITEM_LEARNNAME,"+
"	a.CREATED as ITEM_CREATED,"+
"	a.ITEM_NAME,"+
	"a.ITEM_PHONE,"+
"	a.ITEM_IDCARDNO,"+
	"b.ITEM_PRICE,"+
"a.ITEM_PAYDATE,"+
"	b.ITEM_LESSONNAME "+
" FROM "+
	" tlk_grade_registration a"+
" 	LEFT JOIN tlk_level_train_person b ON a.ITEM_ORDERID = b.ID "+
" WHERE"+
	" ( a.ITEM_APPLYSTATUS = '0' OR a.ITEM_APPLYSTATUS = '1' ) "+
" 	AND b.item_orderState = '1'"+
" 	union "+
" SELECT"+
" 	a.domainid,"+
" 	a.ITEM_LEARNNAME,"+
	"a.CREATED as ITEM_CREATED,"+
	" a.ITEM_NAME,"+
	" a.ITEM_PHONE,"+
	" a.ITEM_IDCARDNO,"+
"	 b.ITEM_PRICE,"+
" a.ITEM_PAYDATE,"+
"	 b.ITEM_LESSONNAME"+
" FROM"+
" 	tlk_qualify_person_apply a"+
" 	INNER JOIN tlk_learn_order_person b ON a.ITEM_ORDERID = b.ID"+
	" LEFT JOIN tms.tlk_system_exam_person d ON d.ITEM_APPLYID = a.ID "+
"	 AND d.item_isDelete != '1'"+
"	 LEFT JOIN tms.tlk_system_exam_info e ON e.ID = d.ITEM_EXAMID" +
" 	AND e.ITEM_EXAMSTATE = '0' "+
" WHERE"+
" 	b.item_orderState = '1') a " +whereStr
println("aaaaaaaaaaaa"+sql);
return sql;
})()]]></sqlFilterScript>
  <procedureFilterScript><![CDATA[]]></procedureFilterScript>
  <filterCondition><![CDATA[[]]]></filterCondition>
  <commonFilterCondition><![CDATA[[]]]></commonFilterCondition>
  <authorityCondition>[]</authorityCondition>
  <openType>1</openType>
  <editMode>02</editMode>
  <width>0</width>
  <height>0</height>
</ListView>