Beneficiary must be able to add to favorite a Call
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package net.gepafin.tendermanagement.repositories;
|
||||
import net.gepafin.tendermanagement.entities.BeneficiaryPreferredCallEntity;
|
||||
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.util.List;
|
||||
|
||||
@Repository
|
||||
public interface BeneficiaryPreferredCallRepository extends JpaRepository<BeneficiaryPreferredCallEntity, Long> {
|
||||
List<BeneficiaryPreferredCallEntity> findByBeneficiaryId(Long beneficiaryId);
|
||||
List<BeneficiaryPreferredCallEntity> findByUserId(Long userId);
|
||||
|
||||
@Query("SELECT preferredCall FROM BeneficiaryPreferredCallEntity preferredCall where preferredCall.userId=:userId AND (:companyId is null OR preferredCall.companyId=:companyId)")
|
||||
List<BeneficiaryPreferredCallEntity> findByUserIdAndCompanyId(@Param("userId") Long userId, @Param("companyId") Long companyId);
|
||||
List<BeneficiaryPreferredCallEntity> findByBeneficiaryIdAndCompanyId(Long beneficiaryId,Long companyId);
|
||||
}
|
||||
@@ -18,4 +18,5 @@ public interface UserRepository extends JpaRepository<UserEntity, Long> {
|
||||
Optional<UserEntity> findByBeneficiaryCodiceFiscale(String codiceFiscale);
|
||||
|
||||
boolean existsByBeneficiaryCodiceFiscale(String codiceFiscale);
|
||||
UserEntity findByBeneficiaryId(Long beneficiaryId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user