package com.fzzy.igds.sys.repository; import com.fzzy.igds.dzhwk.domain.DicArea; 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.Service; import java.util.List; /** * @Description * @Author CZT * @Date 2024/11/23 09:56 */ @Service public interface DicAreaRepository extends JpaRepository, JpaSpecificationExecutor { /** * 根据父编码查询区域信息 * * @param parentCode * @return */ @Query("from DicArea where parentCode =:parentCode order by code") List getDicAreaByParentCode(@Param("parentCode") String parentCode); /** * 根据名称获取区域信息 * * @param name * @return */ @Query("from DicArea where name =:name order by code") DicArea listDicAreaByName(@Param("name") String name); /** * 根据code获取区域信息 * * @param code * @return */ @Query("from DicArea where code =:code order by code") DicArea listDicAreaByCode(@Param("code") String code); }