在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>

 

posted @ 2017-12-13 16:26  Waves-a  阅读(927)  评论(0编辑  收藏  举报