title: How to use if condition inside where clause in Sequelize.js
body: <p>I would like to query <code>ManufacturerId: manufacturer_id</code> only if <code>manufacturer_id</code> is not equal to null.</p>
  
  <p>I tried this code but its giving me syntax error:</p>
  
  <pre><code>/* Get Brands List */
  router.get('/', function(req, res) {
    var archived_status = req.query["archived-status"];
    var manufacturer_id = req.params.manufacturer_id;
    models.Brand.findAll({
      where: {
          brand_archived_status: archived_status,
          if(manufacturer_id != null){
            ManufacturerId: manufacturer_id
          }
      },
      include: [{
        model: models.Job,
        required: false
      }]
    }).  
    then(function(brands) {  
        res.status(200).json(brands);  
    }, function(error) {  
        res.status(500).send(error);  
    });  
  });
  </code></pre>