@Query("SELECT u FROM UserEntity u WHERE u.tenantId = :tenantId " + "AND u.customerId = :customerId AND u.authority = :authority " + "AND LOWER(u.searchText) LIKE LOWER(CONCAT(:searchText, '%'))" + "AND u.id > :idOffset ORDER BY u.id") List<UserEntity> findUsersByAuthority(@Param("tenantId") String tenantId, @Param("customerId") String customerId, @Param("idOffset") String idOffset, @Param("searchText") String searchText, @Param("authority") Authority authority, Pageable pageable);
@Query("SELECT rmd FROM RuleMetaDataEntity rmd WHERE rmd.tenantId IN (:tenantId, :nullTenantId) " + "AND LOWER(rmd.searchText) LIKE LOWER(CONCAT(:textSearch, '%')) " + "AND rmd.id > :idOffset ORDER BY rmd.id") List<RuleMetaDataEntity> findAllTenantRulesByTenantId(@Param("tenantId") String tenantId, @Param("nullTenantId") String nullTenantId, @Param("textSearch") String textSearch, @Param("idOffset") String idOffset, Pageable pageable);
@Query(value = "SELECT routerItemModel FROM RouterItemModel routerItemModel WHERE routerItemModel.routerIp =:routerIp " + "AND routerItemModel.routerMac =:routerMac " + "AND routerItemModel.model =:model AND routerItemModel.romVersion =:romVersion") public List<RouterItemModel> isExistsRouterModel(@Param("routerIp") String routerIp, @Param("routerMac")String routerMac, @Param("model")String model, @Param("romVersion")String romVersion);
/** * Geeft de partijen terug die geldig zijn voor vrij bericht. * @param peildatum peildatum * @return de gevonden partijen */ @Query("select p from Partij p where p.datumIngang <= :peildatum and (p.datumEinde > :peildatum or p.datumEinde is null) " + "and p.datumIngangVrijBericht <= :peildatum and (p.datumEindeVrijBericht > :peildatum or p.datumEindeVrijBericht is null) " + "and p.datumOvergangNaarBrp <= :peildatum " + "and p.isActueelEnGeldig = true and p.isActueelEnGeldigVoorVrijBericht = true " + "and (p.isVrijBerichtGeblokkeerd = false or p.isVrijBerichtGeblokkeerd is null)" + "and p.afleverpuntVrijBericht is not null") List<Partij> geldigeVrijBerichtPartijen(@Param("peildatum") Integer peildatum);
@Query("SELECT cd FROM ComponentDescriptorEntity cd WHERE cd.type = :type " + "AND cd.scope = :scope AND LOWER(cd.searchText) LIKE LOWER(CONCAT(:textSearch, '%')) " + "AND cd.id > :idOffset ORDER BY cd.id") List<ComponentDescriptorEntity> findByScopeAndType(@Param("type") ComponentType type, @Param("scope") ComponentScope scope, @Param("textSearch") String textSearch, @Param("idOffset") String idOffset, Pageable pageable);
@Query("select fo.idForm, ty.codTypAvis, td.temValidTypeDecCand, count(1)" + " from TypeDecisionCandidature td" + " join td.candidature ca" + " join ca.formation fo" + " join fo.commission co" + " join co.centreCandidature ce" + " join ca.candidat cand" + " join cand.compteMinima cpt" + " join td.typeDecision t" + " join t.typeAvis ty" + " where ce.idCtrCand = :idCtrCand and cpt.campagne.idCamp = :idcamp" + " and ca.datAnnulCand is null" + " and td.idTypeDecCand in (select max(td2.idTypeDecCand) from TypeDecisionCandidature td2 where ca.idCand = td2.candidature.idCand)" + " group by fo.idForm, ty.codTypAvis, td.temValidTypeDecCand") List<Object[]> findStatNbCandidatureByAvis(@Param("idCtrCand") Integer idCtrCand, @Param("idcamp") Integer idcamp);
@Query("SELECT d FROM DeviceEntity d WHERE d.tenantId = :tenantId " + "AND LOWER(d.searchText) LIKE LOWER(CONCAT(:textSearch, '%')) " + "AND d.id > :idOffset ORDER BY d.id") List<DeviceEntity> findByTenantId(@Param("tenantId") String tenantId, @Param("textSearch") String textSearch, @Param("idOffset") String idOffset, Pageable pageable);
@Query("SELECT pmd FROM PluginMetaDataEntity pmd WHERE pmd.tenantId IN (:tenantId, :nullTenantId) " + "AND LOWER(pmd.searchText) LIKE LOWER(CONCAT(:textSearch, '%')) " + "AND pmd.id > :idOffset ORDER BY pmd.id") List<PluginMetaDataEntity> findAllTenantPluginsByTenantId(@Param("tenantId") String tenantId, @Param("nullTenantId") String nullTenantId, @Param("textSearch") String textSearch, @Param("idOffset") String idOffset, Pageable pageable);
@Query("SELECT a FROM AssetEntity a WHERE a.tenantId = :tenantId " + "AND a.customerId = :customerId AND a.type = :type " + "AND LOWER(a.searchText) LIKE LOWER(CONCAT(:textSearch, '%')) " + "AND a.id > :idOffset ORDER BY a.id") List<AssetEntity> findByTenantIdAndCustomerIdAndType(@Param("tenantId") String tenantId, @Param("customerId") String customerId, @Param("type") String type, @Param("textSearch") String textSearch, @Param("idOffset") String idOffset, Pageable pageable);
@Query(FIND_BY_ID_QUERY) List<User> findByUserProjectId(@Param("projId") Integer projId);
@Query(value = "select * from `release` where release_id = :releaseId", nativeQuery = true) public ReleaseJPA findByReleaseId(@Param("releaseId") Integer releaseId);
@Query(value = "SELECT * FROM event_log AS log WHERE log.process_model_id = :processModelId AND log.resource = :subject AND EXISTS((SELECT 1 from event_log AS x " + "WHERE x.case_id = log.case_id AND x.activity = 'Process Start' AND x.message_type = '' AND x.resource = '' AND x.state = '')) " + "AND EXISTS((SELECT 1 from event_log AS y WHERE y.case_id = log.case_id AND y.activity = 'Process End' AND y.message_type = '' AND y.resource = '' AND y.state = ''))" + "ORDER BY log.case_id, log.event_id", nativeQuery = true) public List<EventLogEntry> getEventLogForProcessModelAndSubject(@Param("processModelId") int processModelId, @Param("subject") String subject);
@RestResource(rel = "byRestaurantId") List<MenuItem> findAllByRestaurantId(@Param("restaurantId") String restaurantId);
@Query("Select m from Module m " + "left join fetch m.image " + "where m.containerID=:containerID") Module findByContainerID(@Param("containerID") String id) throws DataAccessException;
@Query("SELECT zwbAggregateChar" + " FROM ZwbAggregateCharJPA zwbAggregateChar" + " WHERE date >= :dateBegin AND date <= :dateEnd") List<ZwbAggregateCharJPA> findBetweenDates(@Param("dateBegin") Long dateBegin, @Param("dateEnd") Long dateEnd);
@Transactional(readOnly = true) @RestResource(exported = false) List<Release> findByNameIgnoreCaseContaining(@Param("name") String name);
@Query(nativeQuery = true) List<TestCase> findByProblemId(@Param("problem_id") Long problemId);
@Query(FIND_BY_KEYWORD_JOB_SKILL) List<Project> findByKeywordAndJobAndSkill(@Param("keyWord") String keyWord, @Param("jobTitles") List<Integer> jobTitles, @Param("skills") List<Integer> skills, @Param("status") String status, @Param("remote") String remote);
@Query("SELECT * FROM " + Animal.TABLE_NAME + " WHERE status = :status") List<Animal> getByStatus(@Param("status") Status status);
@RestResource(exported = false) PackageMetadata findByRepositoryNameAndNameAndVersion(@Param("repositoryName") String repositoryName, @Param("name") String name, @Param("version") String version);
@Query(value = "SELECT curOrder FROM GuestOrder curOrder WHERE (curOrder.status = 0) AND curOrder.guestId =:guestId AND curOrder.orderId =:orderId") public GuestOrder findValidByGuestIdAndOrderId(@Param("guestId") long guestId, @Param("orderId") String orderId);
@Query(FIND_BY_CRITERIA_AND_COUNTRIES) Page<Organization> findByCriteriaAndCountries(@Param("keyword") String keyWord, @Param("countries") List<String> countries,@Param("open") Boolean open , @Param("status") String status, @Param("categories") List<String> categories,Pageable pageable);
@Query(value = "SELECT * FROM ROLE WHERE SYSTEM_ID = :systemId", nativeQuery = true) RoleImpl findBySystemId(@Param("systemId") String systemId);
@Query(value = "SELECT rwlm FROM RouterWhiteListModel rwlm WHERE rwlm.host =:host") public List<RouterWhiteListModel> findByHost(@Param("host") String host);
@Modifying(clearAutomatically = true) @Query(value = "DELETE FROM recover_password WHERE date_requested < (:date_requested);", nativeQuery = true) void deleteByDateRequested(@Param("date_requested") Date dateRequested);
@Query(value = "SELECT p FROM PROCESS_INSTANCE p WHERE p.state = :state", nativeQuery = false) Page<ProcessInstanceImpl> getProcessesInfoOfState(Pageable pageable, @Param("state") ProcessInstanceState state);
@Query("Select distinct s " + "from Server s " + "left join fetch s.image " + "where s.containerID=:id") Server findByContainerID(@Param("id") String id) throws DataAccessException;
@RestResource(rel = "by-id", description = @Description("find payment by id")) Payment findPaymentById(@Param("id") String id);
@Query("Select v from Volume v where v.name=:name") Volume findByName(@Param("name") String name) throws DataAccessException;
@Query(FIND_BY_KEYWORD_JOB) List<Project> findByKeywordAndJob(@Param("keyWord") String keyWord, @Param("jobTitles") List<Integer> jobTitles, @Param("status") String status, @Param("remote") String remote);
@Query( value = "select count(p) from PROCESS_INSTANCE p JOIN p.subjects s where p.endTime between :start and :end and p.state = 'FINISHED' and s.userId = :user", nativeQuery = false) Long getAmountOfFinishedProcessesBetweenRangeForUser(@Param("start") LocalDateTime start, @Param("end") LocalDateTime end, @Param("user") Long userId);
@Query("Select distinct s " + "from Server s " + "left join fetch s.image left join fetch s.application a left join fetch a.user " + "where s.name=:name") Server findByName(@Param("name") String name) throws DataAccessException;
@Query("select e From Event e where e.dateStart > :dateStart ORDER BY e.dateStart ASC") List<Event> getUpcommingEvents(@Param("dateStart") Date dateStart, Pageable pageable);
@Query("Select m from Module m " + "left join fetch m.image " + "left join fetch m.application " + "left join fetch m.ports " + "where m.id=:id ") Module findById(@Param("id") Long id) throws DataAccessException;
@RestResource(path = "findByUser", rel = "findByUser") Page<Project> findByUser(@Param(value = "user") String user, Pageable pageable);
@Query("SELECT r FROM MemberBio r WHERE r.member = (SELECT m FROM LocalMember m WHERE m.guildId = :guildId AND m.user.userId = :userId)") MemberBio findByGuildIdAndUserId(@Param("guildId") String guildId, @Param("userId") String userId);
@Query("SELECT e FROM Eats e, Food f, User u WHERE f.id = e.food AND u.id = e.user AND u.email = :email AND e.transactionDate between convert(:startDate, datetime) and convert(:endDate, datetime)") List<Eats> findBetweenDateRangeAndEmail(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("email") String email);
@Query(FIND_BY_CRITERIA_AND_COUNTRIES) List<Organization> findByCriteriaAndCountries(@Param("keyword") String keyWord, @Param("countries") List<String> countries,@Param("open") Boolean open , @Param("status") String status, @Param("categories") List<String> categories);
@Query("select i from Image i where i.imageType=:imageType") List<Image> findAllEnabledImagesByType(@Param("imageType") String imageType) throws DataAccessException;