package com.fzzy.api.view.repository; import com.fzzy.api.Constant; import com.fzzy.api.entity.ApiTrigger; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import java.util.List; public interface ApiTriggerRep extends JpaRepository { @Query("from ApiTrigger where parentCode ='" + Constant.DEFAULT_CODE + "'") List findParent(); @Query("from ApiTrigger where parentCode =:parentCode order by code ") List findByParent(@Param("parentCode") String parentCode); @Query("from ApiTrigger where parentCode =:parentCode and code=:code") List findNameByCode(@Param("code") String code, @Param("parentCode") String parentCode ); @Query("from ApiTrigger where parentCode =:parentCode and val=:val order by code ") List findByParent(@Param("parentCode") String parentCode, @Param("val") String val); }