Implemented company in application

This commit is contained in:
rajesh
2024-09-29 19:59:10 +05:30
parent e4870b2c99
commit 9b3fd43bf9
28 changed files with 269 additions and 118 deletions

View File

@@ -3,6 +3,7 @@ package net.gepafin.tendermanagement.repositories;
import net.gepafin.tendermanagement.entities.ApplicationEntity;
import net.gepafin.tendermanagement.entities.FaqEntity;
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;
@@ -11,9 +12,7 @@ import java.util.List;
import java.util.Optional;
@Repository
public interface ApplicationRepository extends JpaRepository<ApplicationEntity,Long> {
public Optional<ApplicationEntity> findByUserIdAndCallIdAndIsDeletedFalse(Long userId,Long callId);
public interface ApplicationRepository extends JpaRepository<ApplicationEntity, Long>, JpaSpecificationExecutor<ApplicationEntity> {
public List<ApplicationEntity> findByUserIdAndIsDeletedFalse(Long userId);
@@ -26,4 +25,9 @@ public interface ApplicationRepository extends JpaRepository<ApplicationEntity,L
public Optional<ApplicationEntity> findByIdAndUserIdAndIsDeletedFalse(Long id,Long userId);
Optional<ApplicationEntity> findByCompanyIdAndCallIdAndIsDeletedFalse(Long companyId, Long callId);
public Optional<ApplicationEntity> findByIdAndUserIdAndCallIdAndIsDeletedFalse(Long applicationId, Long userId,
Long callId);
}

View File

@@ -1,6 +1,7 @@
package net.gepafin.tendermanagement.repositories;
import java.util.List;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
@@ -16,4 +17,6 @@ public interface UserWithCompanyRepository extends JpaRepository<UserWithCompany
@Query("SELECT uwc.companyId FROM UserWithCompanyEntity uwc WHERE uwc.userId = :userId")
List<Long> findCompanyIdByUserId(@Param("userId") Long userId);
Optional<UserWithCompanyEntity> findByUserIdAndCompanyId(Long userId, Long companyId);
}