<update id="updateIotOnOffState" parameterType="java.util.Map"> <foreach item="value" index="key" collection="map.entrySet()" separator=";"> update iot_device set <if test="value!=null"> is_online = ${value} </if> where device_id = #{key} </foreach> </update>
希望能给网友们,帮助