|
@@ -1,36 +1,73 @@
|
|
|
package cn.com.qmth.examcloud.core.questions.dao;
|
|
|
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.CourseProperty;
|
|
|
-import org.springframework.data.jpa.repository.JpaRepository;
|
|
|
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
|
-import org.springframework.data.repository.query.QueryByExampleExecutor;
|
|
|
+import org.apache.commons.compress.utils.Lists;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.PageImpl;
|
|
|
+import org.springframework.data.domain.Pageable;
|
|
|
+import org.springframework.data.jpa.domain.Specification;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Optional;
|
|
|
|
|
|
/**
|
|
|
* @author weiwenhai
|
|
|
* @describle 课程属性repo
|
|
|
* @date 2017.11.2
|
|
|
*/
|
|
|
-public interface CoursePropertyRepo extends JpaRepository<CourseProperty, Long>, QueryByExampleExecutor<CourseProperty>, JpaSpecificationExecutor<CourseProperty> {
|
|
|
+@Component
|
|
|
+//public interface CoursePropertyRepo extends JpaRepository<CourseProperty, Long>, QueryByExampleExecutor<CourseProperty>, JpaSpecificationExecutor<CourseProperty> {
|
|
|
+public class CoursePropertyRepo {
|
|
|
|
|
|
//查询所有课程属性
|
|
|
- List<CourseProperty> findByOrgId(Long orgId);
|
|
|
+ public List<CourseProperty> findByOrgId(Long orgId) {
|
|
|
+ return Lists.newArrayList();
|
|
|
+ }
|
|
|
|
|
|
//根据属性名查询
|
|
|
- CourseProperty findByNameAndOrgId(String name, Long orgId);
|
|
|
+ public CourseProperty findByNameAndOrgId(String name, Long orgId) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
//根据课程id查询
|
|
|
- List<CourseProperty> findByCourseId(Long courseId);
|
|
|
+ public List<CourseProperty> findByCourseId(Long courseId) {
|
|
|
+ return Lists.newArrayList();
|
|
|
+ }
|
|
|
|
|
|
- List<CourseProperty> findByCourseCode(String code);
|
|
|
+ public List<CourseProperty> findByCourseCode(String code) {
|
|
|
+ return Lists.newArrayList();
|
|
|
+ }
|
|
|
|
|
|
//根据课程代码查询已开启的课程属性
|
|
|
- List<CourseProperty> findByCourseCodeAndEnable(String code, Boolean enable);
|
|
|
+ public List<CourseProperty> findByCourseCodeAndEnable(String code, Boolean enable) {
|
|
|
+ return Lists.newArrayList();
|
|
|
+ }
|
|
|
|
|
|
//根据课程id查询已经开启的课程属性
|
|
|
- List<CourseProperty> findByCourseIdAndEnable(Long courseId, Boolean enable);
|
|
|
+ public List<CourseProperty> findByCourseIdAndEnable(Long courseId, Boolean enable) {
|
|
|
+ return Lists.newArrayList();
|
|
|
+ }
|
|
|
|
|
|
//根据id集合查询
|
|
|
- List<CourseProperty> findByIdIn(List<Long> ids);
|
|
|
-}
|
|
|
+ public List<CourseProperty> findByIdIn(List<Long> ids) {
|
|
|
+ return Lists.newArrayList();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void save(CourseProperty courseProperty) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public Page<CourseProperty> findAll(Specification<CourseProperty> specification, Pageable pageable) {
|
|
|
+ return new PageImpl<>(Lists.newArrayList(), pageable, 0l);
|
|
|
+ }
|
|
|
+
|
|
|
+ public Optional<CourseProperty> findById(Long id) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void saveAll(List<CourseProperty> courseProperties) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|