你的位置:首页 > Java教程

[Java教程]MyBatis之传参


 
1、当传参为list 时:
     1.1 mapper接口中:
 void updateContactsIsRead(List<Integer> logidList);
 
     1.2 mapper.<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>