package com.ffii.fpsms.modules.deliveryOrder.entity

import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Query
import org.springframework.data.repository.query.Param
import org.springframework.stereotype.Repository
import java.time.LocalDate

@Repository
interface DoPickOrderLineRecordRepository : JpaRepository<DoPickOrderLineRecord, Long> {
    fun findByDoPickOrderIdAndDeletedFalse(doPickOrderId: Long): List<DoPickOrderLineRecord>
    fun findByDoOrderIdAndDeletedFalse(doOrderId: Long): List<DoPickOrderLineRecord>
    fun findByDoPickOrderIdInAndDeletedFalse(doPickOrderIds: Collection<Long>): List<DoPickOrderLineRecord>

    fun findByDoPickOrderId(recordId: Long?): List<DoPickOrderLineRecord>

    @Query("SELECT d FROM DoPickOrderLineRecord d WHERE d.recordId = :recordId AND d.deleted = false")
    fun findByRecordIdAndDeletedFalse(@Param("recordId") recordId: Long): List<DoPickOrderLineRecord>

}