views_query_alter add condition
You try code:
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\query\QueryPluginBase;
....

   /**
    * Implements hook_views_query_alter().
    */
    function mymodule_views_query_alter(ViewExecutable $view, QueryPluginBase $query) {
     $query-&gt;addWhere(0, 'node__field_data.nid', [1,2,3], 'IN');
    }