findBy abstract method

  1. @Query.new('''SELECT * 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<List<ProductStorageModel>> findBy(
  1. int productId,
  2. int branchId,
  3. int storeId,
  4. int currencyId,
)

Implementation

@Query('''SELECT * 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<List<ProductStorageModel>> findBy(
    int productId, int branchId, int storeId, int currencyId);