<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" 
	"http://www.ibatis.com/dtd/sql-map-2.dtd">
	
<sqlMap namespace="FlowStep">
 
	<statement id="detail" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
		SELECT 
            BJOBBZWKPRCSSDSTCD AS "BJOBBZWKPRCSSDSTCD",
            BJOBSTGEDSTCD AS "BJOBSTGEDSTCD" ,
            BJOBSTGEPTRNNAME AS "BJOBSTGEPTRNNAME" ,
            BJOBFLOWCMPONAME AS "BJOBFLOWCMPONAME" ,
            TELGMCLSID AS "TELGMCLSID" ,
            UNITTELGMLEN AS "UNITTELGMLEN" ,
            BJOBNODEDESC AS "BJOBNODEDESC"
		FROM $schemaId$.TSEAIBR03
        WHERE BjobBzwkPrcssDstcd     = #bjobBzwkPrcssDstcd#
        AND   RTRIM(BjobStgeDstcd )  = RTRIM(#bjobStgeDstcd# )
	</statement>  
		
	<statement id="update" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
		UPDATE $schemaId$.TSEAIBR03 
		SET BjobStgePtrnName = #bjobStgePtrnName#       ,
			BjobFlowCmpoName = #bjobFlowCmpoName#       ,
			<!-- TelgmClsID       = NVL(#telgmClsID#, ' ' )  , -->
			TelgmClsID       = #telgmClsID#			    ,
			UnitTelgmLen     = #unitTelgmLen#           ,
			<!-- BjobNodeDesc     = NVL(#bjobNodeDesc#, ' ' ) -->  
			BjobNodeDesc     = #bjobNodeDesc#  
		WHERE BjobBzwkPrcssDstcd = #bjobBzwkPrcssDstcd#  
		AND   RTRIM(BjobStgeDstcd )  = RTRIM(#bjobStgeDstcd# )
	</statement>
	
	<statement id="insert" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
		INSERT INTO $schemaId$.TSEAIBR03 (
			  BjobBzwkPrcssDstcd  ,
			  BjobStgeDstcd       ,
			  BjobStgePtrnName    ,
			  BjobFlowCmpoName    ,
			  TelgmClsID          ,
			  UnitTelgmLen        ,
			  BjobNodeDesc        )
		VALUES (
			  #bjobBzwkPrcssDstcd#     ,
			  #bjobStgeDstcd#          ,
			  #bjobStgePtrnName#       ,
			  #bjobFlowCmpoName#       ,
			  <!-- NVL(#telgmClsID#, ' ' )  , -->
			  #telgmClsID#  		   ,
           #unitTelgmLen#::NUMERIC           ,
			  <!-- NVL(#bjobNodeDesc#, ' ' ) -->  
			  #bjobNodeDesc#  
		)
	</statement>
		
	<statement id="delete" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
		DELETE 	FROM $schemaId$.TSEAIBR03 
        WHERE BjobBzwkPrcssDstcd = #bjobBzwkPrcssDstcd#
        AND   RTRIM(BjobStgeDstcd )  = RTRIM(#bjobStgeDstcd# )
	</statement>
	
    <statement id="checkCount" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
        SELECT COUNT("BjobBzwkPrcssDstcd")
        FROM   $schemaId$.TSEAIBM03
        WHERE "BjobBzwkPrcssDstcd" = #bjobBzwkPrcssDstcd#
        AND   RTRIM("BjobStgeDstcd" )  = #bjobStgeDstcd#
    </statement>
        
	<statement id="getTelgmClsID" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
         SELECT TelgmClsID AS "CODE"
         FROM $schemaId$.TSEAIBR05
         ORDER BY TelgmClsID
	</statement>
    
</sqlMap>