<?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="SearchBAP">
    <statement id="selectList" parameterClass="java.util.HashMap" resultClass="java.util.LinkedHashMap" >    	
		SELECT
			INFID AS "interfaceName",
			BJOBMSGDSTICNAME AS "interfaceDesc" ,
			'fileinfo' AS "resourceType",
			THISMSGREGSNTID AS "userId",
			UAPPLCD AS "resourceApp",
			INFID || '.json' AS "resourceName",
			BJOBMSGDSTICNAME AS "resourceDesc",
			'FBT' || '/' || UAPPLCD || '/' || 'fileinfo' || '/' AS "resourcePath",
			BJOBTRANDSTCDNAME AS "fileCode"
		FROM
			$schemaId$.tseaiBJ01
        <dynamic prepend="WHERE">		    
             <isNotEmpty prepend="AND" property="userId">
		  	    THISMSGREGSNTID = #userId#
		    </isNotEmpty>
		    <isNotEmpty prepend="AND" property="resourceApp">
		  	    UAPPLCD = #resourceApp#
		    </isNotEmpty>
			<isNotEmpty property="searchName">
			  <isEqual prepend="AND" property="searchType" compareValue="interfaceName">
			  	INFID like '%'||#searchName#||'%'
			  </isEqual>
			  <isEqual prepend="AND" property="searchType" compareValue="interfaceDesc">
			  	BJOBMSGDSTICNAME like '%'||#searchName#||'%'
			  </isEqual>
			  <isEqual prepend="AND" property="searchType" compareValue="fileCode">
			  	 BJOBTRANDSTCDNAME like '%'||#searchName#||'%'
			  </isEqual>			  
			</isNotEmpty>
		</dynamic> 	
    </statement>   
</sqlMap>
