mybatis如何接受map类型的参数

时间:2019-10-28 17:00:05   收藏:0   阅读:968

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

 

 

原文:https://www.cnblogs.com/YuyuanNo1/p/11753216.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!