package cn.cetc54.platform.base.dao; import cn.cetc54.platform.core.base.BaseDao; import cn.cetc54.platform.base.entity.Dict; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import java.util.List; /** * 字典数据处理层 * @author Exrick */ public interface DictDao extends BaseDao { /** * 排序获取全部 * @return */ @Query(value = "select d from Dict d order by d.sortOrder") List findAllOrderBySortOrder(); /** * 通过type获取 * @param type * @return */ Dict findByType(String type); /** * 模糊搜索 * @param key * @return */ @Query(value = "select d from Dict d where d.title like %:key% or d.type like %:key% order by d.sortOrder") List findByTitleOrTypeLike(@Param("key") String key); }