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 );
本文详细介绍如何使用MyBatis框架通过传入Map参数类型进行批量数据更新操作,包括SQL语句的设置与Map参数的构造,适用于需要高效处理大量数据更新场景的开发者。
2917





