<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListView id="__gMaEgOvXKI1mlpYCSMZ">
  <name>authorization_record</name>
  <parentId>__UTrlSN8IBYuGePSbeK8</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <description><![CDATA[课程授权列表]]></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>__c6zGLGK7syVj74FdSVX</searchFormId>
  <autoCompose>false</autoCompose>
  <relatedForm>__LFCzL9oexy8fk340Aky</relatedForm>
  <permissionType>public</permissionType>
  <filterScript><![CDATA[]]></filterScript>
  <sqlFilterScript><![CDATA[(function(){                           
                      var authLessonName = getItemValueAsString("authLessonName");                  
                  var createStartDate = getItemValueAsDate("createStartDate");       
                  var createEndDate = getItemValueAsDate("createEndDate");           
                  var authRecordType = getItemValueAsString("authRecordType");            
                      var whereStr = "where 1=1 ";         
                
                  if(isNotNull(authLessonName)){            
                          whereStr += "and t1.ITEM_AUTHLESSONNAME like concat('%','"+authLessonName+"','%') ";            
                        }            
                        if(isNotNull(createStartDate)){            
                          whereStr += "and t1.ITEM_CREATEDTIME >= '"+format(createStartDate,"yyyy-MM-dd HH:mm:ss")+"' ";            
                        }            
                        if(isNotNull(createEndDate)){            
                          whereStr += "and t1.ITEM_CREATEDTIME <= '"+format(createEndDate,"yyyy-MM-dd HH:mm:ss")+"' ";            
                        }            
               if(isNotNull(authRecordType)){           
                  if(authRecordType != "3"){            
                        whereStr += "and t1.ITEM_AUTHRECORDTYPE = '"+authRecordType+"' ";            
                      }else{            
                        whereStr += "and t1.ITEM_LESSONAUTHENDDATE < now() ";            
                      }            
               }           
                      var sql = "select "+                
                          "'"+ getDomainid() +"' as domainid,"+                
                          "t1.ITEM_LESSONAUTHSTARTDATE," + //开始时间                
                          "t1.ITEM_LESSONAUTHENDDATE," + //结束时间                
                          "t1.ITEM_AUTHLESSONID," + //课程ID                
                            "b.ITEM_LESSONNAME," + //授权课程	              
                          "t1.ITEM_AUTHPEOPLES," + //授权人员                
                          "case when ITEM_LESSONAUTHENDDATE < now() then '已过期'"+               
                          "when t1.ITEM_AUTHRECORDTYPE = 1 then '正常'"+               
                          "when t1.ITEM_AUTHRECORDTYPE = 2 then '已撤销' "+               
                          "end ITEM_AUTHRECORDTYPE," + //授权记录状态                
                          "t1.ITEM_CREATEDTIME," + //创建时间                
                          "t1.ITEM_UPDATEDTIME," + //更新时间                
                          "t1.ITEM_CREATEDPERNAME," + //创建人                
                          "t1.ID AS ITEM_ID,"+               
                       "t1.ID,"+             
                          "count(t2.ID) ITEM_COUNT "+                
                          "from tlk_authorization_record t1 "+                
                          "INNER JOIN "+                
                          "tlk_lesson_auth_base_info t2 on t1.ID = t2.ITEM_AUTHRECORDID "+ 
                          "INNER JOIN "+ 
                      "tlk_lesson_base_info b on t2.ITEM_AUTHLESSONID = b.ID "+ whereStr +            
                          "GROUP BY t2.ITEM_AUTHRECORDID"              
                           return sql;                      
                      })();]]></sqlFilterScript>
  <procedureFilterScript><![CDATA[]]></procedureFilterScript>
  <filterCondition><![CDATA[[]]]></filterCondition>
  <commonFilterCondition><![CDATA[[{"field":"authLessonName","isCommonFilter":"true"}]]]></commonFilterCondition>
  <authorityCondition>[]</authorityCondition>
  <openType>1</openType>
  <editMode>02</editMode>
  <width>0</width>
  <height>0</height>
</ListView>