mybatis如何接受map类型的参数


Mybatis传入参数类型为Map

 

mybatis更新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参数类型:

?
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 );

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM