MyBatis之傳參,mybatis
1、當傳參為list 時:
1.1 mapper接口中:
void updateContactsIsRead(List<Integer> logidList);
1.2 mapper.xml 文件中:
<update id="updateContactsIsRead">
update emaillog2 set isRead = 1 where isRead = 0 and logid in
<foreach collection="list" item="logid" index="index" open="(" close=")" separator=",">
#{logid,jdbcType=INTEGER}
</foreach>
</update>