UPDATE rescue_info SET need_system = '1' WHERE need_system = '0' AND driver_id IS NULL AND TIMESTAMPDIFF( MINUTE, rescue_time, NOW()) > 5 AND rescue_status = '2' DELETE FROM rescue_info_detail WHERE rescue_info_id = #{rescueId}; DELETE FROM rescue_driver_info WHERE rescue_id = #{rescueId};