<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="SnaTracking">


<!--   전체 목록수 얻기 -->
	<statement id="selectListCount" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
         SELECT COUNT(*)
			FROM $schemaId$.TSEAIAD07 A,  $schemaId$.TSEAISY02 B   
		WHERE                                                 
		   A.ADPTRGSTATSEVRNAME  = B. HOSTNAME        
		  AND B. EAISEVRIP !='*'                           
     	  AND A.MSGDPSTHMS BETWEEN #searchStartTime# AND #searchEndTime#
	</statement>
	
	<!--  목록 조회  -->
	<statement id="selectList" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
		SELECT                                                                      
			A.MSGDPSTHMS AS "MSGDPSTHMS",    
			A.ADPTRGSTATSEVRNAME AS "ADPTRGSTATSEVRNAME", 
			A.ADPTRGROUPNAME AS "ADPTRGROUPNAME",                    
			A.LUGROUPNAME AS "LUGROUPNAME",  
			A.LUNAME AS "LUNAME" , 
			A.EAISVCSERNO AS "EAISVCSERNO",                       
			A.DATADSTCD AS "DATADSTCD",      
			A.EAIERRCTNT AS "EAIERRCTNT",
			B.EAISEVRIP AS "EAISEVRIP" ,                         
			A.LOGPRCSSSERNO AS "LOGPRCSSSERNO",
			A.FRTIMMSGDPSTHMS  AS "FRTIMMSGDPSTHMS"                                              
		FROM $schemaId$.TSEAIAD07 A,	$schemaId$.TSEAISY02 B   
		WHERE                                                 
		   A.ADPTRGSTATSEVRNAME  = B.HOSTNAME        
		   AND B.EAISEVRIP !='*'                           
     	   AND A.MSGDPSTHMS BETWEEN #searchStartTime# AND #searchEndTime#
		  <isNotEmpty prepend="AND" property="searchUuid"> 
            A.EAISVCSERNO = #searchUuid#
      	  </isNotEmpty>
          <isEqual compareValue="Y" prepend="AND" property="searchErrorYn">
             A.EAIERRCTNT = 'RECEAISNA000'
          </isEqual> 
          <isNotEmpty prepend="AND" property="searchLogPrcssSerno">
	      	 A.LOGPRCSSSERNO = #searchLogPrcssSerno#
	      </isNotEmpty>
          <isEqual compareValue="N" prepend="AND" property="searchErrorYn">
             A.EAIERRCTNT != 'RECEAISNA000'
          </isEqual> 
		 GROUP BY                  
		      A.MSGDPSTHMS ,A.ADPTRGROUPNAME , A.LUGROUPNAME , A.LUNAME ,A.EAISVCSERNO ,A.DATADSTCD , 
		      A.EAIERRCTNT ,A.ADPTRGSTATSEVRNAME ,B.EAISEVRIP ,A.LOGPRCSSSERNO ,A.FRTIMMSGDPSTHMS
		ORDER BY A. MSGDPSTHMS  ASC 
	</statement>	
	
</sqlMap>