Mybatis foreach标签it
事例记录一,传参map, 用到key和value 记录以下:io
<foreach collection="param.entrySet()" separator=";" item="val">
update m set a=1,b=#{val.key}
<where>
<if test="val.value != null and val.value.size() >0">
and id in
<foreach collection="val.value" item="item" open="(" separator="," close=")">
${item}
</foreach>
</if>
</where>
</foreach>test