package com.ajb.car.metadata.repositories;

import java.util.List;

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

import com.ajb.car.entity.meta.AgMdCode;

@Repository 
public interface AgMdCodeRepository extends JpaRepository<AgMdCode, Long>,JpaSpecificationExecutor<AgMdCode>  {

	/***
	 * mock find  10
	 */
	@Query(value="select * from ${context.tableName} t  limit 10 ", nativeQuery=true)
	List<AgMdCode> findAll();
	
	@Query(value="SELECT * from ag_md_code where code_type = ?1  limit 1 ", nativeQuery=true)
	AgMdCode getCodeByType(String type);
}