|
@@ -13,30 +13,35 @@ import cn.com.qmth.examcloud.core.basic.dao.entity.Org;
|
|
|
/**
|
|
|
* Created by songyue on 17/1/13.
|
|
|
*/
|
|
|
-public interface OrgRepo extends JpaRepository<Org,Long>,QueryByExampleExecutor<Org> , JpaSpecificationExecutor<Org>{
|
|
|
+public interface OrgRepo
|
|
|
+ extends
|
|
|
+ JpaRepository<Org, Long>,
|
|
|
+ QueryByExampleExecutor<Org>,
|
|
|
+ JpaSpecificationExecutor<Org> {
|
|
|
+
|
|
|
+ List<Org> findByRootId(Long rootId);
|
|
|
|
|
|
- List<Org> findByRootId(Long rootId);
|
|
|
-
|
|
|
List<Org> findByRootIdAndNameLike(long rootId, String name);
|
|
|
|
|
|
- List<Org> findById(Long id);
|
|
|
+ List<Org> findByParentIdAndNameLikeAndEnable(long parentId, String name, Boolean enable);
|
|
|
|
|
|
- @Query(nativeQuery = true,value = "select *from ecs_core_org where parent_id=:parentId")
|
|
|
- List<Org> findBothByParentId(@Param("parentId") long parentId);
|
|
|
+ List<Org> findById(Long id);
|
|
|
|
|
|
- @Query(nativeQuery = true,value = "select *from ecs_core_org where parent_id=:parentId and enable = 1")
|
|
|
- List<Org> findByParentId(@Param("parentId") Long parentId);
|
|
|
+ @Query(nativeQuery = true, value = "select *from ecs_core_org where parent_id=:parentId")
|
|
|
+ List<Org> findBothByParentId(@Param("parentId") long parentId);
|
|
|
|
|
|
- @Query(nativeQuery = true,value = "select *from ecs_core_org where (id=:parentId or parent_id=:parentId) and enable = 1 and type = \"SCHOOL\"")
|
|
|
- List<Org> findAllSchoolByParentId(@Param("parentId") long parentId);
|
|
|
-
|
|
|
- @Query(nativeQuery = true,value = "select *from ecs_core_org where (id=:parentId or parent_id=:parentId) and enable = 1 and type in (\"PRINT_QMTH\",\"PRINT_SUPPLIER\")")
|
|
|
- List<Org> findAllPrintByParentId(@Param("parentId") long parentId);
|
|
|
+ @Query(nativeQuery = true, value = "select *from ecs_core_org where parent_id=:parentId and enable = 1")
|
|
|
+ List<Org> findByParentId(@Param("parentId") Long parentId);
|
|
|
|
|
|
- @Query(nativeQuery = true,value = "select *from ecs_core_org where parent_id=:parentId and code=:code and enable = 1")
|
|
|
- Org findFirstByParentIdAndCode(@Param("parentId") Long parentId, @Param("code")String code);
|
|
|
-
|
|
|
- @Query(nativeQuery = true,value = "select * from ecs_core_org t where t.parent_id = 0 and t.enable = 1 order by t.id")
|
|
|
- List<Org> findAllParentOrg();
|
|
|
-}
|
|
|
+ @Query(nativeQuery = true, value = "select *from ecs_core_org where (id=:parentId or parent_id=:parentId) and enable = 1 and type = \"SCHOOL\"")
|
|
|
+ List<Org> findAllSchoolByParentId(@Param("parentId") long parentId);
|
|
|
+
|
|
|
+ @Query(nativeQuery = true, value = "select *from ecs_core_org where (id=:parentId or parent_id=:parentId) and enable = 1 and type in (\"PRINT_QMTH\",\"PRINT_SUPPLIER\")")
|
|
|
+ List<Org> findAllPrintByParentId(@Param("parentId") long parentId);
|
|
|
|
|
|
+ @Query(nativeQuery = true, value = "select *from ecs_core_org where parent_id=:parentId and code=:code and enable = 1")
|
|
|
+ Org findFirstByParentIdAndCode(@Param("parentId") Long parentId, @Param("code") String code);
|
|
|
+
|
|
|
+ @Query(nativeQuery = true, value = "select * from ecs_core_org t where t.parent_id = 0 and t.enable = 1 order by t.id")
|
|
|
+ List<Org> findAllParentOrg();
|
|
|
+}
|