sumOf abstract method
- @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(
- int productId,
- int branchId,
- int storeId,
- 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);