<?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="EaiMsg">
   <statement id="selectListCount" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
 		SELECT COUNT(*) 
 		 FROM $schemaId$.TSEAIHE01 HE01 RIGHT OUTER JOIN $schemaId$.TSEAIHE02 HE02
         		ON HE01.EAISVCNAME = HE02.EAISVCNAME
         	 WHERE EAIBZWKDSTCD IN ( SELECT EAIBZWKDSTCD FROM $schemaId$.TSEAIRM06 WHERE USERID =#loginId#) 
         	  AND HE02.SVCPRCSSNO = 1	
	 		 <isNotEmpty prepend="AND" property="searchEaiSvcName">
	        		UPPER(HE01.EAISVCNAME)   LIKE CONCAT('%',UPPER(#searchEaiSvcName#),'%')
	         </isNotEmpty>
	 		 <isNotEmpty prepend="AND" property="searchEaiBzwkDstcd">
	        		UPPER(HE01.EAIBZWKDSTCD) LIKE CONCAT('%',UPPER(#searchEaiBzwkDstcd#),'%')
	         </isNotEmpty>
	 		 <isNotEmpty prepend="AND" property="searchEaiSvcDesc">
	        		UPPER(HE01.EAISVCDESC)   LIKE CONCAT('%',UPPER(#searchEaiSvcDesc#),'%') 
	         </isNotEmpty>
	 		<isNotEmpty prepend="AND" property="searchSvcMotivUsedStcd">
	        		HE01.SVCMOTIVUSEDSTCD =  #searchSvcMotivUsedStcd# 
	         </isNotEmpty>
	 		 <isNotEmpty prepend="AND" property="searchFlowControl">
	        		HE01.FLOWCTRLROUTNAME =  #searchFlowControl# 
	         </isNotEmpty>
	 		 <isNotEmpty prepend="AND" property="searchPsvintfacdsticName">
		        	HE02.PSVINTFACDSTICNAME = #searchPsvintfacdsticName# 
		     </isNotEmpty>
	 		 <isNotEmpty prepend="AND" property="searchTranType">
	        		HE01.TRANTYPE = #searchTranType# 
	         </isNotEmpty>
	         <isNotEmpty prepend="AND" property="searchQueueName">
		        	UPPER(FR02.NONMOTIVROUTURINAME)   LIKE CONCAT('%',UPPER(#searchQueueName#),'%') 
		     </isNotEmpty>
		     <isNotEmpty prepend="AND" property="tranChangeSim">
	         		HE02.EAISVCNAME LIKE '%2'
	         </isNotEmpty>
  </statement>
  
  <statement id="selectList" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
		SELECT   * FROM (
			SELECT
				@NO := @NO + 1 AS ROWNO 
				, EAISVCNAME	           	   AS "EAISVCNAME"	
				, EAIBZWKDSTCD	               AS "EAIBZWKDSTCD"	
				, SVCHMSEONOT	               AS "SVCHMSEONOT"	
				, SVCMOTIVUSEDSTCD	           AS "SVCMOTIVUSEDSTCD"
	      		, PSVINTFACDSTICNAME 		   AS "PSVINTFACDSTICNAME"
				, SVCPRCESDSTICNAME	           AS "SVCPRCESDSTICNAME"	
				, FLOWCTRLROUTNAME	           AS "FLOWCTRLROUTNAME"	
				, INTGRADSTICNAME		       AS "INTGRADSTICNAME" 
				, SVCBFCLMNLOGYN		       AS "SVCBFCLMNLOGYN"		
				, GSTATSYSADPTRBZWKGROUPNAME   AS "GSTATSYSADPTRBZWKGROUPNAME"		
				, SEVRLOGLVELNO	               AS "SEVRLOGLVELNO"	
				, SVCLOGLVELNO		           AS "SVCLOGLVELNO"		
				, ERREAISVCNAME	               AS "ERREAISVCNAME"	
				, DMNDERRCHNGIDNAME	           AS "DMNDERRCHNGIDNAME"	
				, DMNDERRFLDNAME	           AS "DMNDERRFLDNAME"	
				, RSPNSERRCHNGIDNAME           AS "RSPNSERRCHNGIDNAME"
				, RSPNSERRFLDNAME	           AS "RSPNSERRFLDNAME"	
				, EAISVCDESC	               AS "EAISVCDESC"	
				, EAISEVRDSTCD		           AS "EAISEVRDSTCD"		
				, MODFIMGTSTUSDSTCD	           AS "MODFIMGTSTUSDSTCD"	
				, EAILASTAMNDYMS	           AS "EAILASTAMNDYMS"	
				, EAIGROUPCOCD		           AS "EAIGROUPCOCD"		
				, (SELECT CODENAME FROM $schemaId$.TSEAICM20 WHERE CODEGROUP='TRAN_TYPE' AND CODE=TRANTYPE) AS "TRANTYPE"
				, TRANTYPE 					   AS "TRANTYPE_CODE"	
				, NONMOTIVROUTURINAME		   AS "NONMOTIVROUTURINAME"
				, USEYN 					   AS "USEYN"
				, VERINFO 					   AS "VERINFO"
				, EXTBIZCD 					   AS "EXTBIZCD"
				, REFKEY					   AS "REFKEY"
	         FROM (  
	   				 SELECT HE01.EAISVCNAME, HE01.EAIBZWKDSTCD, HE01.SVCHMSEONOT, HE01.SVCMOTIVUSEDSTCD
	   				    , HE01.SVCPRCESDSTICNAME, HE01.FLOWCTRLROUTNAME , HE01.INTGRADSTICNAME, HE01.SVCBFCLMNLOGYN, HE01.GSTATSYSADPTRBZWKGROUPNAME
						, HE01.SEVRLOGLVELNO, HE01.SVCLOGLVELNO , HE01.ERREAISVCNAME, HE01.DMNDERRCHNGIDNAME, HE01.DMNDERRFLDNAME, HE01.RSPNSERRCHNGIDNAME
						, HE01.RSPNSERRFLDNAME, HE01.EAISVCDESC , HE01.EAISEVRDSTCD, HE01.MODFIMGTSTUSDSTCD ,HE01.EAILASTAMNDYMS, HE01.EAIGROUPCOCD
						, HE01.TRANTYPE ,FR02.NONMOTIVROUTURINAME ,HE01.USEYN, HE02.PSVINTFACDSTICNAME, HE01.VERINFO, HE01.EXTBIZCD, HE01.REFKEY
					 FROM $schemaId$.TSEAIHE01 HE01
	         			LEFT JOIN $schemaId$.TSEAIFR02 FR02 
	         				ON HE01.FLOWCTRLROUTNAME=FR02.ROUTNAME
	         			LEFT OUTER JOIN (
					 		SELECT EAISVCNAME, PSVINTFACDSTICNAME 
					 			FROM $schemaId$.TSEAIHE02 
					 		WHERE SVCPRCSSNO = 1 ) HE02
					 		ON HE01.EAISVCNAME = HE02.EAISVCNAME
	         		 WHERE EAIBZWKDSTCD IN ( SELECT EAIBZWKDSTCD FROM $schemaId$.TSEAIRM06 WHERE USERID =#loginId#) 
	         	) R1, (SELECT @NO := 0) R 
	         	<dynamic prepend="WHERE" >
			 		 <isNotEmpty prepend="AND" property="searchEaiSvcName">
			        		UPPER(EAISVCNAME)   LIKE CONCAT( '%',UPPER(#searchEaiSvcName#),'%' )
			         </isNotEmpty>
			 		 <isNotEmpty prepend="AND" property="searchEaiBzwkDstcd">
			        		UPPER(EAIBZWKDSTCD) LIKE CONCAT( '%',UPPER(#searchEaiBzwkDstcd#),'%' )
			         </isNotEmpty>
			 		 <isNotEmpty prepend="AND" property="searchEaiSvcDesc">
			        		UPPER(EAISVCDESC)   LIKE CONCAT( '%',UPPER(#searchEaiSvcDesc#),'%'  )
			         </isNotEmpty>
			 		 <isNotEmpty prepend="AND" property="searchSvcMotivUsedStcd">
			        		SVCMOTIVUSEDSTCD =  #searchSvcMotivUsedStcd# 
			         </isNotEmpty>
			 		 <isNotEmpty prepend="AND" property="searchFlowControl">
			        		FLOWCTRLROUTNAME =  #searchFlowControl# 
			         </isNotEmpty>
			 		 <isNotEmpty prepend="AND" property="searchTranType">
			        		TRANTYPE = #searchTranType# 
			         </isNotEmpty>
			         <isNotEmpty prepend="AND" property="searchQueueName">
				        	UPPER(NONMOTIVROUTURINAME)   LIKE CONCAT( '%',UPPER(#searchQueueName#),'%' ) 
				     </isNotEmpty>
				     <isEqual compareValue="R" prepend="AND" property="rmsMenuAuth">
				     		TRANTYPE != 'S'
				     </isEqual>
				 	 <isNotEmpty prepend="AND" property="searchPsvintfacdsticName">
		        			UPPER(PSVINTFACDSTICNAME)   LIKE CONCAT( '%',UPPER(#searchPsvintfacdsticName#),'%' )
			         </isNotEmpty>
			         <isNotEmpty prepend="AND" property="searchExtBizCd">
			         		UPPER(EXTBIZCD) LIKE  CONCAT('%',UPPER(#searchExtBizCd#),'%' )
			         </isNotEmpty>
			         <isNotEmpty prepend="AND" property="tranChangeSim">
			         		EAISVCNAME LIKE '%2'
			         </isNotEmpty>
			         <isNotEmpty prepend="AND" property="searchRefKey">
			         		UPPER(REFKEY) LIKE CONCAT( '%' , UPPER(#searchRefKey#) , '%' )
			         </isNotEmpty>
	         	</dynamic>
	         	ORDER BY EAIBZWKDSTCD,EAISVCNAME
		 	) R2
		WHERE ROWNO BETWEEN #startNum# AND #endNum#
  </statement>
  
	<statement id="selectListToExcel" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
		SELECT   $headersStr$ FROM (
			SELECT
				TMP1.EAISVCNAME AS "EAISVCNAME" ,
				TMP1.EAIBZWKDSTCD AS "EAIBZWKDSTCD" ,
				TMP1.SVCMOTIVUSEDSTCD AS "SVCMOTIVUSEDSTCD" ,
				TMP2.PSVINTFACDSTICNAME AS "PSVINTFACDSTICNAME" ,
				TMP1.FLOWCTRLROUTNAME AS "FLOWCTRLROUTNAME" ,
				TMP1.EAISVCDESC AS "EAISVCDESC" ,
				TMP1.EAISEVRDSTCD AS "EAISEVRDSTCD",
				TMP1.TRANTYPE AS "TRANTYPE" ,
				TMP1.NONMOTIVROUTURINAME AS "NONMOTIVROUTURINAME" 
	         FROM (  
	   				 SELECT HE01.EAISVCNAME,
							HE01.EAIBZWKDSTCD,
							HE01.SVCMOTIVUSEDSTCD ,
							HE01.FLOWCTRLROUTNAME ,
							HE01.EAISVCDESC,
							FR02.NONMOTIVROUTURINAME ,
							(SELECT CODENAME FROM $schemaId$.TSEAICM20 WHERE CODEGROUP='INOUT_TYPE' AND CODE = HE01.EAISEVRDSTCD) AS EAISEVRDSTCD,
							(SELECT CODENAME FROM $schemaId$.TSEAICM20 WHERE CODEGROUP = 'TRAN_TYPE' AND CODE = HE01.TRANTYPE) AS TRANTYPE ,
							(SELECT CODENAME FROM $schemaId$.TSEAICM20 WHERE CODEGROUP = 'USE_YN' AND CODE = HE01.USEYN) AS USEYN							
					 FROM $schemaId$.TSEAIHE01 HE01 LEFT JOIN $schemaId$.TSEAIFR02 FR02 
	         			ON HE01.FLOWCTRLROUTNAME=FR02.ROUTNAME
	         		 WHERE HE01.EAIBZWKDSTCD IN ( SELECT EAIBZWKDSTCD FROM $schemaId$.TSEAIRM06 WHERE USERID =#loginId#) 
		 		 <isNotEmpty prepend="AND" property="searchEaiSvcName">
		        		UPPER(HE01.EAISVCNAME)   LIKE CONCAT( '%',UPPER(#searchEaiSvcName#),'%' )
		         </isNotEmpty>
		 		 <isNotEmpty prepend="AND" property="searchEaiBzwkDstcd">
		        		UPPER(HE01.EAIBZWKDSTCD) LIKE CONCAT( '%',UPPER(#searchEaiBzwkDstcd#),'%' )
		         </isNotEmpty>
		 		 <isNotEmpty prepend="AND" property="searchEaiSvcDesc">
		        		UPPER(HE01.EAISVCDESC)   LIKE CONCAT( '%',UPPER(#searchEaiSvcDesc#),'%' ) 
		         </isNotEmpty>
		 		 <isNotEmpty prepend="AND" property="searchSvcMotivUsedStcd">
		        		HE01.SVCMOTIVUSEDSTCD =  #searchSvcMotivUsedStcd# 
		         </isNotEmpty>
		 		 <isNotEmpty prepend="AND" property="searchFlowControl">
		        		HE01.FLOWCTRLROUTNAME =  #searchFlowControl# 
		         </isNotEmpty>
		 		 <isNotEmpty prepend="AND" property="searchTranType">
		        		HE01.TRANTYPE = #searchTranType# 
		         </isNotEmpty>
		         <isNotEmpty prepend="AND" property="searchQueueName">
			        	UPPER(FR02.NONMOTIVROUTURINAME)   LIKE CONCAT( '%',UPPER(#searchQueueName#),'%' ) 
			     </isNotEmpty>
			     <isEqual compareValue="R" prepend="AND" property="rmsMenuAuth">
			     	HE01.TRANTYPE != 'S'
			     </isEqual>
			 	) TMP1
			 	LEFT OUTER JOIN (
			 		SELECT EAISVCNAME, PSVINTFACDSTICNAME 
			 			FROM $schemaId$.TSEAIHE02 
			 		WHERE SVCPRCSSNO = 1		 		
			 		 <isNotEmpty prepend="AND" property="searchPsvintfacdsticName">
			        		UPPER(PSVINTFACDSTICNAME)   LIKE CONCAT( '%',UPPER(#searchPsvintfacdsticName#),'%' ) 
			         </isNotEmpty>
			 	) TMP2
			 	ON TMP1.EAISVCNAME = TMP2.EAISVCNAME
		 	) MAIN
  </statement>
  
  <statement id="selectDetailSvcAll" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
		SELECT 
			  A.EAISVCNAME               AS "EAISVCNAME"    
			, A.SVCPRCSSNO               AS "SVCPRCSSNO"    
			, A.PSVINTFACDSTICNAME       AS "PSVINTFACDSTICNAME"    
			, A.PSVSYSBZWKDSTCD          AS "PSVSYSBZWKDSTCD"    
			, A.PSVSYSIDNAME             AS "PSVSYSIDNAME"    
			, A.PSVSYSSVCDSTICNAME       AS "PSVSYSSVCDSTICNAME"    
			, A.PSVSYSADPTRBZWKGROUPNAME AS "PSVSYSADPTRBZWKGROUPNAME"    
			, A.FLOVRYN                  AS "FLOVRYN"    
			, A.CHNGEONOT                AS "CHNGEONOT"    
			, A.CHNGMSGIDNAME            AS "CHNGMSGIDNAME"    
			, A.BASCRSPNSMSGCMPRCTNT     AS "BASCRSPNSMSGCMPRCTNT"    
			, A.BASCRSPNSCHNGEONOT       AS "BASCRSPNSCHNGEONOT"    
			, A.BASCRSPNSCHNGMSGIDNAME   AS "BASCRSPNSCHNGMSGIDNAME"    
			, A.ERRRSPNSMSGCMPRCTNT      AS "ERRRSPNSMSGCMPRCTNT"    
			, A.ERRRSPNSCHNGEONOT        AS "ERRRSPNSCHNGEONOT"    
			, A.ERRRSPNSCHNGMSGIDNAME    AS "ERRRSPNSCHNGMSGIDNAME"    
			, A.NEXTSVCPRCSSNO           AS "NEXTSVCPRCSSNO"    
			, A.OUTBNDROUTNAME           AS "OUTBNDROUTNAME"    
			, A.TOUTVAL                  AS "TOUTVAL"    
			, A.CMPENSVCPRCSSDSTICNAME   AS "CMPENSVCPRCSSDSTICNAME"    
			, A.SUPPLDELYN               AS "SUPPLDELYN"    
			, A.HDRCTRLDSTCD             AS "HDRCTRLDSTCD"    
			, A.HDRREFCLSNAME            AS "HDRREFCLSNAME"  
			, A.RESTOPTION               AS "RESTOPTION"  
		 FROM  $schemaId$.TSEAIHE02 A,     
		       $schemaId$.TSEAIHE01 B
		 WHERE A.EAISVCNAME = B.EAISVCNAME
		   AND A.EAISVCNAME = #eaiSvcName#
  </statement>
    
  <statement id="selectDetailSvc" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
		SELECT 
			  A.EAISVCNAME               AS "EAISVCNAME"    
			, A.SVCPRCSSNO               AS "SVCPRCSSNO"    
			, A.PSVINTFACDSTICNAME       AS "PSVINTFACDSTICNAME"    
			, A.PSVSYSBZWKDSTCD          AS "PSVSYSBZWKDSTCD"    
			, A.PSVSYSIDNAME             AS "PSVSYSIDNAME"    
			, A.PSVSYSSVCDSTICNAME       AS "PSVSYSSVCDSTICNAME"    
			, A.PSVSYSADPTRBZWKGROUPNAME AS "PSVSYSADPTRBZWKGROUPNAME"    
			, A.FLOVRYN                  AS "FLOVRYN"    
			, A.CHNGEONOT                AS "CHNGEONOT"    
			, A.CHNGMSGIDNAME            AS "CHNGMSGIDNAME"    
			, A.BASCRSPNSMSGCMPRCTNT     AS "BASCRSPNSMSGCMPRCTNT"    
			, A.BASCRSPNSCHNGEONOT       AS "BASCRSPNSCHNGEONOT"    
			, A.BASCRSPNSCHNGMSGIDNAME   AS "BASCRSPNSCHNGMSGIDNAME"    
			, A.ERRRSPNSMSGCMPRCTNT      AS "ERRRSPNSMSGCMPRCTNT"    
			, A.ERRRSPNSCHNGEONOT        AS "ERRRSPNSCHNGEONOT"    
			, A.ERRRSPNSCHNGMSGIDNAME    AS "ERRRSPNSCHNGMSGIDNAME"    
			, A.NEXTSVCPRCSSNO           AS "NEXTSVCPRCSSNO"    
			, A.OUTBNDROUTNAME           AS "OUTBNDROUTNAME"    
			, A.TOUTVAL                  AS "TOUTVAL"    
			, A.CMPENSVCPRCSSDSTICNAME   AS "CMPENSVCPRCSSDSTICNAME"    
			, A.SUPPLDELYN               AS "SUPPLDELYN"    
			, A.HDRCTRLDSTCD             AS "HDRCTRLDSTCD"    
			, A.HDRREFCLSNAME            AS "HDRREFCLSNAME"  
			, A.RESTOPTION               AS "RESTOPTION"  
		 FROM  $schemaId$.TSEAIHE02 A,     
		       $schemaId$.TSEAIHE01 B
		 WHERE A.EAISVCNAME = B.EAISVCNAME
		   AND A.EAISVCNAME = #eaiSvcName#
		   AND A.SVCPRCSSNO = #svcPrcssNo#
  </statement>
  <statement id="insert" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
		 INSERT INTO $schemaId$.TSEAIHE01
					( EAISVCNAME                 
					, EAIBZWKDSTCD               
					, SVCHMSEONOT                
					, SVCMOTIVUSEDSTCD           
					, SVCPRCESDSTICNAME          
					, FLOWCTRLROUTNAME           
					, INTGRADSTICNAME            
					, SVCBFCLMNLOGYN             
					, GSTATSYSADPTRBZWKGROUPNAME 
					, SEVRLOGLVELNO              
					, SVCLOGLVELNO               
					, ERREAISVCNAME              
					, DMNDERRCHNGIDNAME          
					, DMNDERRFLDNAME             
					, RSPNSERRCHNGIDNAME         
					, RSPNSERRFLDNAME            
					, EAISVCDESC                 
					, EAISEVRDSTCD	          
					, EAILASTAMNDYMS	           
					, EAIGROUPCOCD		           
					, TRANTYPE 
					, USEYN
					, VERINFO                  
					, TXID                  
					, REFKEY                  
					, EXTBIZCD                  
					, AUTHOR                  
					, INTERNALEXTERNALDVCD
					)
		     VALUES( #eaiSvcName#                 
					, #eaiBzwkDstcd#               
					, #svcHmsEonot#                
					, #svcMotivUseDstcd#           
					, #svcPrcesDsticName#          
					, #flowCtrlRoutName#           
					, #intgraDsticName#            
					, #svcBfClmnLogYn#             
					, #gstatSysAdptrBzwkGroupName# 
					, CAST(#sevrLogLvelNo# AS UNSIGNED)              
					, CAST(#svcLogLvelNo# AS UNSIGNED)               
					, #errEAISvcName#              
					, #dmndErrChngIdName#          
					, #dmndErrFldName#             
					, #rspnsErrChngIdName#         
					, #rspnsErrFldName#            
					, #eaiSvcDesc#                 
					, #eaiSevrDstCd# 		           
					, DATE_FORMAT(SYSDATE(), '%Y%m%d%H%i%s')	           
					, #eaiGroupCoCd#		           
					, #tranType#
					, #useYn#
					, #verInfo#                
					, #txId#                
					, #refKey#                
					, #extBizCd#                
					, #author#                
					, #internalExternalDvcd#
					)
  </statement>

  <statement id="update" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">    
    UPDATE $schemaId$.TSEAIHE01 
       SET EAIBZWKDSTCD                      = #eaiBzwkDstcd#                  
		 , SVCHMSEONOT                       = #svcHmsEonot#                   
		 , SVCMOTIVUSEDSTCD                  = #svcMotivUseDstcd#              
		 , SVCPRCESDSTICNAME                 = #svcPrcesDsticName#             
		 , FLOWCTRLROUTNAME                  = #flowCtrlRoutName#              
		 , INTGRADSTICNAME                   = #intgraDsticName#               
		 , SVCBFCLMNLOGYN                    = #svcBfClmnLogYn#                
		 , GSTATSYSADPTRBZWKGROUPNAME        = #gstatSysAdptrBzwkGroupName#    
		 , SEVRLOGLVELNO                     = CAST(#sevrLogLvelNo# AS UNSIGNED)                 
		 , SVCLOGLVELNO                      = CAST(#svcLogLvelNo# AS UNSIGNED)                  
		 , ERREAISVCNAME                     = #errEAISvcName#                 
		 , DMNDERRCHNGIDNAME                 = #dmndErrChngIdName#             
		 , DMNDERRFLDNAME                    = #dmndErrFldName#                
		 , RSPNSERRCHNGIDNAME                = #rspnsErrChngIdName#            
		 , RSPNSERRFLDNAME                   = #rspnsErrFldName#               
		 , EAISVCDESC                        = #eaiSvcDesc#                    
		 , EAISEVRDSTCD		           		 = #eaiSevrDstCd#	
		 , EAILASTAMNDYMS	           		 = SUBSTRING(DATE_FORMAT(SYSDATE(),'%Y%m%d%H%i%s%f'), 1,17)
		 , EAIGROUPCOCD		           		 = #eaiGroupCoCd#	
		 , TRANTYPE	 						 = #tranType#	
		 , USEYN							 = #useYn#
		 , VERINFO							 = #verInfo#      
		 , TXID							 	 = #txId#      
		 , REFKEY							 = #refKey#      
		 , EXTBIZCD							 = #extBizCd#      
		 , AUTHOR							 = #author#      
		 , INTERNALEXTERNALDVCD				 = #internalExternalDvcd#
     WHERE EAISVCNAME                        = #eaiSvcName#  
  </statement>
  
  <statement id="updateTranType" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">    
    UPDATE $schemaId$.TSEAIHE01 
       SET EAILASTAMNDYMS	           		 = SUBSTRING(DATE_FORMAT(SYSDATE(),'%Y%m%d%H%i%s%f'), 1,17)
		 , TRANTYPE	 						 = #tranType#	
		 WHERE EAISVCNAME                    = #eaiSvcName#  
  </statement>
  
  <statement id="selectListRef" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
		SELECT A.EAISVCNAME 
		     , A.SVCPRCSSNO
		     , A.REFMSGIDNO
		     , A.REFMSGIDNAME
		     , C.LOUTDESC
		 FROM  $schemaId$.TSEAIMS02 A
		     left outer join $schemaId$.TSEAITR07 C
		     ON  A.REFMSGIDNAME = C.LOUTNAME
		     , $schemaId$.TSEAIHE01 B
		 WHERE A.EAISVCNAME = B.EAISVCNAME		   
		   AND A.EAISVCNAME = #eaiSvcName#
		   AND A.SVCPRCSSNO = #svcPrcssNo#
		 ORDER BY A.EAISVCNAME, A.SVCPRCSSNO, A.REFMSGIDNO  
  </statement>  
  
   <statement id="selectListRefEtc" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
		SELECT 
      		 TR01.CNVSNNAME AS "CNVSNNAME"  
      		,TR01.CNVSNDESC AS "LOUTDESC"
      		,TR02.LOUTNAME  AS "REFMSGIDNAME" 
     	FROM $schemaId$.TSEAITR01 TR01 RIGHT OUTER JOIN $schemaId$.TSEAITR02 TR02
     		ON TR01.CNVSNNAME = TR02.CNVSNNAME
     		WHERE TR01.CNVSNNAME = (
		       SELECT CHNGMSGIDNAME    
		          FROM $schemaId$.TSEAIHE02            
		       WHERE EAISVCNAME = #eaiSvcName#
	         )
    	 AND TR02.SOURCRSULTDSTCD ='SRC_LAYOUT' 
  </statement>

  <statement id="selectListCondRule" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
		SELECT 
			A.EAISVCNAME       AS "EAISVCNAME" ,
			A.SVCPRCSSNO       AS "SVCPRCSSNO" ,
			A.RULESERNO        AS "RULESERNO" ,
			A.RSULTPRCSSNO     AS "RSULTPRCSSNO" ,
			A.RULEFLDGROUPNAME AS "RULEFLDGROUPNAME" ,
			A.RULEFLDNAME      AS "RULEFLDNAME" ,
			A.CMPRCTNT         AS "CMPRCTNT"
		 FROM  $schemaId$.TSEAIFR01 A
		     , $schemaId$.TSEAIHE01 B
		 WHERE A.EAISVCNAME = B.EAISVCNAME
		   AND A.EAISVCNAME = #eaiSvcName#
		   AND A.SVCPRCSSNO = #svcPrcssNo#
		 ORDER BY A.EAISVCNAME, A.SVCPRCSSNO, A.RULESERNO  
  </statement>   
  
  <statement id="insertRef" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
    INSERT INTO $schemaId$.TSEAIMS02(
                EAISVCNAME, SVCPRCSSNO, REFMSGIDNO, REFMSGIDNAME)
         VALUES(
                #EAISVCNAME#, #SVCPRCSSNO#, #REFMSGIDNO#, #REFMSGIDNAME#)
  </statement>
  
  <statement id="insertCondRule" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
    INSERT INTO $schemaId$.TSEAIFR01(
                EAISVCNAME, SVCPRCSSNO, RULESERNO, RSULTPRCSSNO, RULEFLDGROUPNAME, RULEFLDNAME, CMPRCTNT)
         VALUES(
                #EAISVCNAME#, #SVCPRCSSNO#, #RULESERNO#, #RSULTPRCSSNO#, #RULEFLDGROUPNAME#, #RULEFLDNAME#, #CMPRCTNT#)
  </statement>
  
  <statement id="insertSvc" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
      INSERT INTO $schemaId$.TSEAIHE02(
                      EAISVCNAME                   
                    , SVCPRCSSNO                   
                    , PSVINTFACDSTICNAME           
                    , PSVSYSBZWKDSTCD              
                    , PSVSYSSVCDSTICNAME           
                    , PSVSYSADPTRBZWKGROUPNAME     
                    , FLOVRYN                      
                    , CHNGEONOT                    
                    , CHNGMSGIDNAME                
                    , BASCRSPNSMSGCMPRCTNT         
                    , BASCRSPNSCHNGEONOT           
                    , BASCRSPNSCHNGMSGIDNAME       
                    , ERRRSPNSMSGCMPRCTNT          
                    , ERRRSPNSCHNGEONOT            
                    , ERRRSPNSCHNGMSGIDNAME        
                    , NEXTSVCPRCSSNO               
                    , OUTBNDROUTNAME               
                    , TOUTVAL                      
                    , CMPENSVCPRCSSDSTICNAME       
                    , SUPPLDELYN                   
                    , HDRCTRLDSTCD                 
                    , HDRREFCLSNAME                
                    , RESTOPTION                
                  )
           VALUES (
                      #eaiSvcName#                       
                    , #svcPrcssNo#                       
                    , #psvIntfacDsticName#               
                    , #psvSysBzwkDstcd#                  
                    , #psvSysSvcDsticName#               
                    , #psvSysAdptrBzwkGroupName#         
                    , #flovrYn#                          
                    , #chngEonot#                        
                    , #chngMsgIdName#                    
                    , #bascRspnsMsgCmprCtnt#             
                    , #bascRspnsChngEonot#               
                    , #bascRspnsChngMsgIdName#           
                    , #errRspnsMsgCmprCtnt#              
                    , #errRspnsChngEonot#                
                    , #errRspnsChngMsgIdName#            
                    , #nextSvcPrcssNo#                   
                    , #outbndRoutName#                   
                    , #toutVal#                          
                    , #cmpenSvcPrcssDsticName#           
                    , #supplDelYn#                       
                    , #hdrCtrlDstcd#                     
                    , #hdrRefClsName#                    
                    , #restOption#                    

                  )
  </statement>

  <statement id="updateSvc" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
      UPDATE $schemaId$.TSEAIHE02 
         SET  PSVINTFACDSTICNAME           = #psvIntfacDsticName#
            , PSVSYSBZWKDSTCD              = #psvSysBzwkDstcd#
            , PSVSYSSVCDSTICNAME           = #psvSysSvcDsticName#
            , PSVSYSADPTRBZWKGROUPNAME     = #psvSysAdptrBzwkGroupName#
            , FLOVRYN                      = #flovrYn#
            , CHNGEONOT                    = #chngEonot#
            , CHNGMSGIDNAME                = #chngMsgIdName#
            , BASCRSPNSMSGCMPRCTNT         = #bascRspnsMsgCmprCtnt#
            , BASCRSPNSCHNGEONOT           = #bascRspnsChngEonot#
            , BASCRSPNSCHNGMSGIDNAME       = #bascRspnsChngMsgIdName#
            , ERRRSPNSMSGCMPRCTNT          = #errRspnsMsgCmprCtnt#
            , ERRRSPNSCHNGEONOT            = #errRspnsChngEonot#
            , ERRRSPNSCHNGMSGIDNAME        = #errRspnsChngMsgIdName#
            , NEXTSVCPRCSSNO               = #nextSvcPrcssNo#
            , OUTBNDROUTNAME               = #outbndRoutName#
            , TOUTVAL                      = #toutVal#
            , CMPENSVCPRCSSDSTICNAME       = #cmpenSvcPrcssDsticName#
            , SUPPLDELYN                   = #supplDelYn#
            , HDRCTRLDSTCD                 = #hdrCtrlDstcd#
            , HDRREFCLSNAME                = #hdrRefClsName#
            , RESTOPTION                   = #restOption#
        WHERE EAISVCNAME                   = #eaiSvcName#
          AND SVCPRCSSNO                   = #svcPrcssNo#
  </statement>  
  
  <statement id="deleteSvc" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
    DELETE FROM $schemaId$.TSEAIHE02 
     WHERE EAISVCNAME = #eaiSvcName#
    <isNotEmpty prepend="AND" property="svcPrcssNo">
       AND SVCPRCSSNO = #svcPrcssNo#
    </isNotEmpty>             
  </statement>  
  
 
</sqlMap>

