package com.icloud.server.scala.payorder

import com.icloud.server.payutils.dto.PayOrderDO
import org.springframework.data.domain.{Page, Pageable}
import org.springframework.data.jpa.repository.{JpaRepository, JpaSpecificationExecutor}
import org.springframework.data.repository.{CrudRepository, PagingAndSortingRepository}
import org.springframework.stereotype.Repository

import java.util

@Repository
trait PayOrderRepository extends CrudRepository[PayOrderDO, Long] with JpaSpecificationExecutor[PayOrderDO] with JpaRepository[PayOrderDO, Long] with PagingAndSortingRepository[PayOrderDO, Long] {
  def findByChannelid(channelid: Long): PayOrderDO
  def findAllByOrderById( pageable: Pageable): util.List[PayOrderDO]
  def findAllByMerchantidOrderByIdDesc(merchantid:Long, pageable: Pageable): util.List[PayOrderDO]
  def findByIdAndMerchantid (id: Long,merchantid:Long): PayOrderDO
  def findByMerchantorderid (merchantorderid:String): PayOrderDO

}