All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.mosip.pms.common.repository.PartnerPolicyRepository Maven / Gradle / Ivy

There is a newer version: 1.3.0-dp.1
Show newest version
package io.mosip.pms.common.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import io.mosip.pms.common.entity.PartnerPolicy;

/**
 * @author sanjeev.shrivastava
 *
 */
@Repository
public interface PartnerPolicyRepository extends JpaRepository {
	
	@Query(value = "select * from partner_policy pp where pp.part_id=?1 AND pp.policy_id=?2 AND (pp.is_deleted is null or pp.is_deleted = false) AND pp.is_active=true",nativeQuery = true)
	public List findByPartnerIdAndPolicyIdAndIsActiveTrue(String part_id, String policy_id);
	
	@Query(value = "select * from partner_policy pp where pp.part_id=?1 AND (pp.is_deleted is null or pp.is_deleted = false) AND pp.is_active=true",nativeQuery = true)
	public List findByPartnerIdAndIsActiveTrue(String partner_Id); 
	
	@Query(value = "select * from partner_policy ppr where ppr.part_id=?1 AND ppr.policy_id=?2 AND ppr.policy_api_key=?3", nativeQuery = true )
	public PartnerPolicy findByPartnerIdAndPolicyIdAndApikey(String partnerId,String policyId,String apiKey);
	
	@Query(value = "select * from partner_policy ppr where ppr.part_id=?1 AND ppr.policy_api_key=?2", nativeQuery = true )
	public PartnerPolicy findByPartnerIdAndApikey(String partnerId,String apiKey);
	
	@Query(value = "select * from partner_policy ppr where ppr.policy_api_key=?", nativeQuery = true )
	public PartnerPolicy findByApiKey(String policy_api_key);
	
	@Query(value = "select * from partner_policy ppr where ppr.part_id=?", nativeQuery = true )
	public PartnerPolicy findByPartnerId(String partId);
	
	@Query(value = "select * from partner_policy pp where pp.policy_api_key=? AND (pp.is_deleted is null or pp.is_deleted = false) AND pp.is_active=true",nativeQuery = true)
	public PartnerPolicy findByPolicyApiKey(String policyApiKey);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy