ibatis使用记录

动态更新:

1
2
3
4
5
6
update table_name
<dynamic prepend="set">
<isNotEmpty property="gmtCreate" prepend=",">
name = #name#
</isNotEmpty>
</dynamic>

注意:实体类的数据类型不要是基本数据类型,例:int–>Integer

批量删除

1
2
3
4
5
delete from table_name
where id in
<iterate property="idList" open="(" close=")" conjunction=",">
#idList[]#
</iterate>