<?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="SysDomain">
	<statement id="selectListCount" resultClass="java.lang.Integer">
		SELECT 	COUNT(*) AS "TOTALCOUNT"
			FROM $schemaId$.TSEAISY01
			<dynamic prepend="WHERE">
				<isNotEmpty prepend="AND" property="searchSysDomnName">
					SYSDOMNNAME LIKE UPPER( CONCAT('%' , #searchSysDomnName# , '%') )
				</isNotEmpty>
				<isNotEmpty prepend="AND" property="searchSysDomnDesc">
					UPPER(SYSDOMNDESC) LIKE UPPER('%' || #searchSysDomnDesc# || '%')
				</isNotEmpty>
			</dynamic>
	</statement>
	<statement id="selectList" resultClass="java.util.HashMap">
		SELECT *
		FROM (
                SELECT  @NO := @NO + 1 AS ROWNO,
						SYSDOMNNAME , SYSDOMNDESC
						FROM $schemaId$.TSEAISY01,  (SELECT @NO := 0) R
			<dynamic prepend="WHERE">
				<isNotEmpty prepend="AND" property="searchSysDomnName">
					SYSDOMNNAME LIKE UPPER( CONCAT('%' , #searchSysDomnName# , '%') )
				</isNotEmpty>
				<isNotEmpty prepend="AND" property="searchSysDomnDesc">
					UPPER(SYSDOMNDESC) LIKE UPPER('%' || #searchSysDomnDesc# || '%')
				</isNotEmpty>
			</dynamic>						
			) ORGTABLE
		WHERE ROWNO BETWEEN #startNum# AND #endNum#
	</statement>	
</sqlMap>
