在MyBatis中,前台传数组批量传id处理数据方式
<update id = "dishBatchSaleOrDown"> <if test="ids != null"> <if test="isDelete != null"> update dishData set isDelete = #{isDelete} where id IN <foreach collection="ids" item="id" open="(" close="(" separator=","> #{ids} </foreach> </if> AND merchantId = #{merchantId} </update>