mybatis中根据id集合更新数据

void updateHomeRecommendProduct(@Param("productIds")List<Integer> mHomeRecommendProductIds);
<update id="updateHomeRecommendProduct" parameterType="java.util.List">
		update m_home_recommend_product
		set is_delete = 1
		WHERE product_id IN
		<foreach collection="productIds" index="index" item="item" open="(" separator="," close=")">
			#{item}
		</foreach>
	</update>

猜你喜欢

转载自blog.csdn.net/leibaoxue/article/details/107954154