package com.izouma.jiashanxia.repo;

import com.izouma.jiashanxia.domain.WxFee;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

public interface WxFeeRepo extends JpaRepository<WxFee, String> {

    @Query(nativeQuery = true, value = "SELECT SUM(amount) FROM wx_fee WHERE is_refund=false")
    BigDecimal sumByAmount();

    List<WxFee> findAllByCreatedAtBetween(LocalDateTime createdAt, LocalDateTime createdAt2);
}
