package com.its.api.its.repository.vms;

import com.its.api.its.model.entity.vms.TbVmsFormObjectType;
import com.its.api.its.model.entity.vms.TbVmsFormObjectTypeKey;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TbVmsFormObjectTypeRepository extends JpaRepository<TbVmsFormObjectType, TbVmsFormObjectTypeKey>, JpaSpecificationExecutor<TbVmsFormObjectType> {

    @Query("select p from TbVmsFormObjectType p where p.vmsFormTypeCd = :formType")
    List<TbVmsFormObjectType> findAllByFormType(@Param("formType") Integer formType);
}
