package com.uas.platform.b2b.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.uas.platform.b2b.model.MakeReturnItem;

@Repository
public interface MakeReturnItemDao extends JpaSpecificationExecutor<MakeReturnItem>,
JpaRepository<MakeReturnItem, Long>{
    /**
     * 通过企业uu、委外验收单号、明细序号查询委外验收明细
     *
     * @param enUU
     * @param code
     * @param number
     * @return
     */
    @Query("from MakeReturnItem r where r.returns.enUU = :enUU and r.returns.code = :code and r.number = :number")
    MakeReturnItem findByEnUUAndCodeAndNumber(@Param("enUU") Long enUU, @Param("code") String code, @Param("number") Short number);
}
