mybatis 批量更新(根據list條件,更新表字段)

void updatebatchInspectionCode(List allocationCodelist,String batchInspectionCode);

Mapper接口的寫法,一個list集合,一個表字段名對應的實體類屬性字段

<update id="updatebatchInspectionCode" parameterType="java.util.List">
   update stockout_parts_goods_allocation
   set batch_inspection_code = #{batchInspectionCode,jdbcType=VARCHAR}
   where allocation_code in
    <foreach collection="list" index="index" item="allocationCode" separator="," open="(" close=")">
        #{allocationCode,jdbcType=VARCHAR}
    </foreach>
  </update>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章