Dao
int updateByOutstorage(List<Cargolist> cargolist);
Mapper.xml
这里注意添加foreach节点的操作符,open和close
否则Mybatis不能识别这是批量操作的多条语句,就会报ORA-00911: 无效字符
<update id="updateByOutstorage" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="begin" close=";end;" separator=";">
update ware_cargolist
<set>
OUTDATE = sysdate
</set>
where CARGONO = #{item.cargono,jdbcType=VARCHAR}
and OUTDATE is null
</foreach>
</update>