|
@@ -1,37 +1,40 @@
|
|
|
-package cn.com.qmth.examcloud.service.core.repo;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-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.data.repository.query.QueryByExampleExecutor;
|
|
|
-
|
|
|
-import cn.com.qmth.examcloud.service.core.entity.Course;
|
|
|
-import cn.com.qmth.examcloud.service.core.entity.Org;
|
|
|
-
|
|
|
-/**
|
|
|
- * Created by songyue on 17/1/13.
|
|
|
- */
|
|
|
-public interface OrgRepo extends JpaRepository<Org, Long>,QueryByExampleExecutor<Org>, JpaSpecificationExecutor<Org> {
|
|
|
-
|
|
|
- List<Org> findByRootId(long rootId);
|
|
|
-
|
|
|
- List<Org> findById(long id);
|
|
|
-
|
|
|
- @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 parent_id=:parentId and enable = 1")
|
|
|
- List<Org> findByParentId(@Param("parentId") long parentId);
|
|
|
-
|
|
|
+package cn.com.qmth.examcloud.service.core.repo;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+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.data.repository.query.QueryByExampleExecutor;
|
|
|
+
|
|
|
+import cn.com.qmth.examcloud.service.core.entity.Org;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Created by songyue on 17/1/13.
|
|
|
+ */
|
|
|
+public interface OrgRepo extends JpaRepository<Org,Long>,QueryByExampleExecutor<Org> , JpaSpecificationExecutor<Org>{
|
|
|
+
|
|
|
+ List<Org> findByRootId(long rootId);
|
|
|
+
|
|
|
+ List<Org> findById(long id);
|
|
|
+
|
|
|
+ @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 parent_id=:parentId and enable = 1")
|
|
|
+ List<Org> findByParentId(@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_SHOP\")")
|
|
|
- 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);
|
|
|
-}
|
|
|
+ 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();
|
|
|
+}
|
|
|
+
|