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

	<statement id="selectList" resultClass="java.util.HashMap">
		SELECT *
		FROM (
                SELECT  ROW_NUMBER() OVER(ORDER BY Msg) ROWNO, 
						Msg                ,
    		            MsgCtnt            ,
    		            TreatMatrCtnt      ,
    		            SMSSendYn          ,
    		            ITSMObstclGrdDstcd 
						FROM $schemaId$.TSEAIBP05
			<dynamic prepend="WHERE">
				<isNotEmpty prepend="AND" property="searchMsg">
					UPPER(Msg) LIKE UPPER('%' || #searchMsg# || '%'	)			
				</isNotEmpty>
				<isNotEmpty prepend="AND" property="searchDesc">
					UPPER(MsgCtnt) LIKE UPPER('%' || #searchDesc# || '%')			
			</isNotEmpty>
			</dynamic>						
			) ORGTABLE
		WHERE ROWNO BETWEEN #startNum# AND #endNum#
	</statement>	

	<statement id="selectListCount" resultClass="java.lang.Integer">
		SELECT 	COUNT(*) AS TOTALCOUNT
			FROM $schemaId$.TSEAIBP05
		<dynamic prepend="WHERE">
			<isNotEmpty prepend="AND" property="searchMsg">
				UPPER(Msg) LIKE UPPER('%' || #searchMsg# || '%'	)			
			</isNotEmpty>
			<isNotEmpty prepend="AND" property="searchDesc">
				UPPER(MsgCtnt) LIKE UPPER('%' || #searchDesc# || '%')			
			</isNotEmpty>
		</dynamic>				
	</statement>	
</sqlMap>
