sumOf abstract method

  1. @Query.new('''SELECT sum(count) FROM product_storage WHERE (0 = :productId or product_id = :productId) and (0 = :branchId or branch_id = :branchId) and (0 = :storeId or store_id = :storeId) and (0 = :currencyId or currency_id = :currencyId)''')
Future<int?> sumOf(
  1. int productId,
  2. int branchId,
  3. int storeId,
  4. int currencyId,
)

Implementation

@Query('''SELECT sum(count) FROM product_storage WHERE
     (0 = :productId or product_id = :productId) and
     (0 = :branchId or branch_id = :branchId) and
     (0 = :storeId or store_id = :storeId) and
     (0 = :currencyId or currency_id = :currencyId)''')
Future<int?> sumOf(int productId, int branchId, int storeId, int currencyId);