package com.fzzy.igds.repository; import com.fzzy.igds.domain.Dept; import org.springframework.data.jpa.repository.JpaRepository; 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 2025/11/26 15:48 */ @Service public interface DeptRepository extends JpaRepository { /** * 根据id获取信息 * * @param parentId * @return */ @Query("from Dept where id like:parentId order by id") List getDataByParentId(@Param("parentId") String parentId); /** * 根据companyId获取信息 * * @param companyId * @return */ @Query("from Dept where id =:id order by id") List getDataById(@Param("id") String id); /** * 根据companyId获取信息 * * @param companyId * @return */ @Query("from Dept where companyId =:companyId order by id") List getAllData(@Param("companyId") String companyId); }