<?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="ClassMap">

    <statement id="detail" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
        SELECT TELGMCLSID AS "TELGMCLSID",
               TELGMCLSNAME AS "TELGMCLSNAME",
               MSGMETADSTCD AS "MSGMETADSTCD"
        FROM   $schemaId$.TSEAIBR05
        WHERE  LTRIM(RTRIM(TelgmClsID)) = LTRIM(RTRIM(#telgmClsID#))
    </statement>

    <statement id="update" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
        UPDATE $schemaId$.TSEAIBR05
        SET    TelgmClsName = #telgmClsName#,
               MsgMetaDstcd = #msgMetaDstcd#
        WHERE  LTRIM(RTRIM(TelgmClsID)) = LTRIM(RTRIM(#telgmClsID#))
    </statement>

    <statement id="insert" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
        INSERT INTO $schemaId$.TSEAIBR05 (
               TelgmClsID  ,
               TelgmClsName,
               MsgMetaDstcd )
        VALUES (
               #telgmClsID#  ,
               #telgmClsName#,
               #msgMetaDstcd#
               )
    </statement>

    <statement id="delete" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
        DELETE FROM $schemaId$.TSEAIBR05
        WHERE  LTRIM(RTRIM(TelgmClsID)) = LTRIM(RTRIM(#telgmClsID#))
    </statement>

    <!--  Check count -->
    <statement id="checkCount" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
        SELECT COUNT(TelgmClsID)
        FROM   $schemaId$.TSEAIBR05
        WHERE  LTRIM(RTRIM(TelgmClsID)) = LTRIM(RTRIM(#telgmClsID#))
    </statement>

    <statement id="getMsgMetaDstcd" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
         SELECT MsgMetaDstcd AS "CODE"
         FROM   $schemaId$.TSEAIBM03
    </statement>

    <statement id="getTelgmClsName" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
         SELECT TelgmClsName AS "CODE"
         FROM   $schemaId$.TSEAIBR01
    </statement>
</sqlMap>