Created crud opration for company api's
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package net.gepafin.tendermanagement.repositories;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import net.gepafin.tendermanagement.entities.CompanyEntity;
|
||||
|
||||
@Repository
|
||||
public interface CompanyRepository extends JpaRepository<CompanyEntity, Long> {
|
||||
|
||||
List<CompanyEntity> findByIdIn(List<Long> companyIds);
|
||||
|
||||
Boolean existsByVatNumber(String vatNumber);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package net.gepafin.tendermanagement.repositories;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import net.gepafin.tendermanagement.entities.UserWithCompanyEntity;
|
||||
|
||||
|
||||
public interface UserWithCompanyRepository extends JpaRepository<UserWithCompanyEntity, Long> {
|
||||
|
||||
void deleteByCompanyId(Long companyId);
|
||||
|
||||
@Query("SELECT uwc.companyId FROM UserWithCompanyEntity uwc WHERE uwc.userId = :userId")
|
||||
List<Long> findCompanyIdByUserId(@Param("userId") Long userId);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user