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.MakeAcceptItem;

@Repository
public interface MakeAcceptItemDao extends JpaSpecificationExecutor<MakeAcceptItem>,
JpaRepository<MakeAcceptItem,Long>{

    /**
     * 通过企业uu、委外验收单号、明细序号查询委外验收明细
     *
     * @param enUU
     * @param code
     * @param number
     * @return
     */
    @Query("from MakeAcceptItem a where a.accept.enUU = :enUU and a.accept.code = :code and a.number = :number")
    MakeAcceptItem findByEnUUAndCodeAndNumber(@Param("enUU") Long enUU, @Param("code") String code, @Param("number") Short number);
}
