title: How to iterate multiple data from DAO
body: <p>My code is like </p>
  
  <pre><code>for (Integer catId: catIds) {
          List&lt;Object[]&gt; objectList = invoiceDAO.periodWiseSalesRepoByRetailOrServices(ids, catId, startDate, endDate);
      }
  </code></pre>
  
  <p>By using the code above, I get data when <code>catId</code> = 0 from table like:</p>
  
  <p><a href="https://i.stack.imgur.com/sJcFF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sJcFF.png" alt="enter image description here"></a></p>
  
  <p>similarly when <code>catId</code> = 1, I got data like:</p>
  
  <p><a href="https://i.stack.imgur.com/AsIY1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AsIY1.png" alt="enter image description here"></a></p>
  
  <p>What I want is, if <code>date</code> and <code>shopid</code> is the same, I just want to calculate both sums. Sum means for date 20-12-2016 i get 6440 when catId=1 ,similarly in next image sum is 1809 for same shopId i want 8249 as total . like </p>
  
  <p><a href="https://i.stack.imgur.com/hMhdf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hMhdf.png" alt="enter image description here"></a></p>
  
  <p>What is the relevant approach?</p>