mybatis如何接受map類型的參數

Mybatis傳入參數類型爲Mapjava

 

mybatis更新sql語句:sql

?
1
2
3
4
5
6
7
8
9
< update id= "publishT00_notice" parameterType= "Map" >
update test
set createdate = #{createdate},
creator = #{creator}
where id in
<foreach collection= "ids" item= "ids" separator= "," open = "(" close = ")" >
#{ids}
</foreach>
</ update >

傳入map參數類型:mybatis

?
1
2
3
4
5
HashMap<String,Object> map = new HashMap<String, Object>();
map.put( "creator" , "creator" );
map.put( "createdate" , "createdate" );
String[] ids = { "1" , "2" };
map.put( "ids" , ids );
相關文章
相關標籤/搜索