Ibaits中iterate标签包含关键字如下
<select id="selectData" parameterClass="Map">
select * from testTable
<dynamic prepend="where">
<isNotEmpty property="type">
type=#type#
</isNotEmpty>
<isNotEmpty property="idsList">
<iterate prepend="and" open=" id in(" conjunction="," property="idsList" close=")">
<![CDATA[ #idsList[]# ]]>
</iterate>
</isNotEmpty>
</dynamic>
</delete>
(使用测试例子的sql-->select * from testTable where type=1 and id in (1,2,3,4) )
prepend :拼接SQL前使用的字符 比如"and";
open:prepend后面、整个拼接sql之前插入的内容 比如ID这个字段 做in查询 这里可以“ id in(”;
close:拼接的sql以何等字符结尾,比如“)”;
conjunction:分割字符 比如“,”
property:参数名称