Mybatis传入参数类型为Map

转载自   Mybatis传入参数类型为Map

mybatis更新sql语句:

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

HashMap<String,Object> map = new HashMap<String, Object>();
map.put("creator", "creator");
map.put("createdate", "createdate");

String[] ids = {"1","2"};
map.put("ids", ids );

猜你喜欢

转载自blog.csdn.net/moakun/article/details/82721362