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

	<statement id="list" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
		SELECT 
            BJOBBZWKPRCSSDSTCD,
            FLOWRULEPTRNDESC  
		FROM (
	         SELECT @NO := @NO + 1 AS  ROWNUMBER,
                BjobBzwkPrcssDstcd,
                FlowRulePtrnDesc  
			FROM $schemaId$.TSEAIBR04,  (SELECT @NO := 0) R
	        <dynamic prepend="WHERE">
		    	<isNotEmpty prepend="AND" property="searchbjobBzwkPrcssDstcd">
				    BjobBzwkPrcssDstcd LIKE CONCAT( '%' , #searchbjobBzwkPrcssDstcd# , '%')
			    </isNotEmpty>
		        <isNotEmpty prepend="AND" property="searchflowRulePtrnDesc">
				    FlowRulePtrnDesc LIKE CONCAT( '%' , #searchflowRulePtrnDesc# , '%')
			    </isNotEmpty> 
			</dynamic>
			ORDER BY BjobBzwkPrcssDstcd
		 ) TMP
		 WHERE ROWNUMBER BETWEEN #startNum# AND #endNum#		
	</statement>	

	<statement id="count" parameterClass="java.util.HashMap" resultClass="java.lang.Integer">
		SELECT 	COUNT(BjobBzwkPrcssDstcd) AS "TotalCount"
    	FROM $schemaId$.TSEAIBR04
	        <dynamic prepend="WHERE">
		    	<isNotEmpty prepend="AND" property="searchbjobBzwkPrcssDstcd">
				    BjobBzwkPrcssDstcd LIKE CONCAT( '%' , #searchbjobBzwkPrcssDstcd# , '%')
			    </isNotEmpty>
		        <isNotEmpty prepend="AND" property="searchflowRulePtrnDesc">
				    FlowRulePtrnDesc LIKE CONCAT( '%' , #searchflowRulePtrnDesc# , '%')
			    </isNotEmpty> 
			</dynamic>
	</statement>	

</sqlMap>