mybatis批量查询,批量新增就不聊了,今天看看批量修改。
直接上代码吧
xml文件中代码如下:
<update id="batchUpdate" parameterType="java.util.List">
update pat_doc_pat_info set
sex=
<foreach collection="list" item="item" index="index" separator=" " open="case patient_id" close="end">
when #{item.patientId} then #{item.sex}
</foreach>
,address=
<foreach collection="list" item="item" index="index" separator=" "