I have written a query in myBatis as below. The issue in the below query is that. The value of col3 is the last value inserted in the Map which is passed to the query. It is not the value for the corresponding key.
<update id="upd10" parameterType="map">
UPDATE TABLE_NAME SET col1 = #{col1_value}, col3= {item.value} WHERE
col2 IN
<foreach item="item" index="index" collection="dateMap.entrySet()" open="(" separator="," close=")">
#{item.key}
</foreach>
</update>
My Scenario is as below,
If the value of col2 is same as the item.key in the hashmap which i am passing to the query then i want to set the value of col3 to item.value.