ibatis 条件判断

<selectid = getObject " statementType="PREPARED" resultType="Integer"
		parameterClass="map">
		select * from 
		from
		db.sys_log t
		<dynamic prepend="where">
			<isNotEmpty prepend="and" property="loginNm">
				lower(t.login_nm) like
				'%'||#loginNm#||'%'
			</isNotEmpty>
			<isNotEmpty prepend="and" property="pageNm">
				lower(t.page_nm) like
				'%'||#pageNm#||'%'
			</isNotEmpty>
			<isNotEmpty prepend="and" property="subSystem">
				lower(t.sub_system) like
				'%'||#subSystem#||'%'
			</isNotEmpty>
			<isNotEmpty prepend="and" property="moduleName">
				lower(t.module_name) like
				'%'||#moduleName#||'%'
			</isNotEmpty>
			<isNotEmpty prepend="and" property="procType">
				lower(t.PROC_TYPE) =
				#procType#
			</isNotEmpty>
			<isNotEmpty prepend="and" property="procStartTm">
				to_date(to_char(t.proc_tm,'yyyy-MM-dd'),'yyyy-MM-dd')
				between
				#procStartTm# and #procEndTm#
			</isNotEmpty>
		</dynamic>
		order by t.proc_tm desc
		<![CDATA[)row_ where rownum <= #end#)row_ where rownum_  > #start#]]>
	</select>


你可能感兴趣的:(sql,ibatis,条件判断)