Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package io.mosip.admin.bulkdataupload.repositories;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import io.mosip.kernel.core.dataaccess.spi.repository.BaseRepository;
import io.mosip.admin.bulkdataupload.entity.Device;
/**
* Repository function to fetching device details
*
* @author Megha Tanga
* @author Sidhant Agarwal
* @author Ravi Kant
* @since 1.0.0
*
*/
@Repository
public interface DeviceRepository extends BaseRepository {
/**
* This method trigger query to fetch the Device detail for the given id.
*
* @param id the id of device
* @return the device detail
*/
@Query("FROM Device d where d.id = ?1 AND (d.isDeleted is null or d.isDeleted = false) AND d.isActive = true")
List findByIdAndIsDeletedFalseOrIsDeletedIsNull(String id);
/**
* This method trigger query to fetch the Device detail for the given language
* code.
*
*
* @param langCode language code provided by user
*
* @return List Device Details fetched from database
*/
@Query("FROM Device d where d.langCode = ?1 and (d.isDeleted is null or d.isDeleted = false) AND d.isActive = true")
List findByLangCodeAndIsDeletedFalseOrIsDeletedIsNull(String langCode);
/**
* This method trigger query to fetch the Device detail for the given language
* code and Device Type code.
*
*
* @param langCode language code provided by user
* @param deviceTypeCode device Type Code provided by user
* @return List Device Details fetched from database
*
*/
@Query(value = "select d.id, d.name, d.mac_address, d.serial_num, d.ip_address, d.dspec_id, d.lang_code, d.is_active, d.validity_end_dtimes, d.zone_code, s.dtyp_code from master.device_master d, master.device_spec s where d.dspec_id = s.id and d.lang_code = s.lang_code and d.lang_code = ?1 and s.dtyp_code = ?2 and (d.is_deleted is null or d.is_deleted = false) and d.is_active = true", nativeQuery = true)
List