日期:2014-05-18  浏览次数:20651 次

ibatis是否能实现动态查询s
使用ibatis中.
请问.ibatis是否能实现动态查询.....
怎么实现...谢谢
急等

------解决方案--------------------
说得在具体一些。你想要的是sql语句还是?
------解决方案--------------------
步骤1:下载官方教程
http://ibatis.apache.org/docs/java/pdf/iBATIS-SqlMaps-2_cn.pdf
步骤2:翻到第41页开始阅读
------解决方案--------------------
有动态sql,看看文档,楼上有地址了,随便翻一下就会
------解决方案--------------------
<select id="SelectEemployee" parameterClass="string" resultClass = "resultClass">
select * from employee 

<dynamic prepend="WHERE">

<isParameterPresent>

emp_id = #value#

</isParameterPresent>

</dynamic>

</select>

 

</statements>