dev add user_id for find all complaints
Test Workflow / test (push) Has been cancelled

This commit is contained in:
2026-04-17 22:00:33 +07:00
parent 74f9be8bf7
commit d1a91fec1a
6 changed files with 52 additions and 3 deletions
@@ -5,6 +5,7 @@ import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import ru.soune.nocopy.entity.complaint.ComplaintEntity;
@@ -37,4 +38,7 @@ public interface ComplaintEntityRepository extends JpaRepository<ComplaintEntity
)
""")
Long getComplaintsWithoutLawCaseCount();
@Query("SELECT c FROM ComplaintEntity c WHERE c.email IN :emails")
Page<ComplaintEntity> getComplaintsByUserEmails(@Param("emails") List<String> emails, Pageable pageable);
}
@@ -45,4 +45,7 @@ public interface UserRepository extends JpaRepository<User, Long> {
@Query("SELECT u FROM User u WHERE u.personalTariffInfo.id = :tariffInfoId")
Optional<User> findByPersonalTariffInfoId(@Param("tariffInfoId") String tariffInfoId);
@Query("SELECT u.email FROM User u WHERE u.company = :company")
List<String> emailsByCompany(@Param("company") String company);
}