|
@@ -5,9 +5,8 @@
|
|
|
|
|
|
package cn.com.qmth.examcloud.core.oe.admin.dao;
|
|
package cn.com.qmth.examcloud.core.oe.admin.dao;
|
|
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
-
|
|
|
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExportTaskEntity;
|
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExportTaskStatus;
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
import org.springframework.data.jpa.repository.Modifying;
|
|
import org.springframework.data.jpa.repository.Modifying;
|
|
@@ -16,34 +15,35 @@ import org.springframework.data.repository.query.Param;
|
|
import org.springframework.stereotype.Repository;
|
|
import org.springframework.stereotype.Repository;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExportTaskEntity;
|
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExportTaskStatus;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Repository
|
|
@Repository
|
|
public interface ExportTaskRepo
|
|
public interface ExportTaskRepo
|
|
- extends JpaRepository<ExportTaskEntity, Long>, JpaSpecificationExecutor<ExportTaskEntity> {
|
|
|
|
-
|
|
|
|
- @Transactional
|
|
|
|
- @Modifying
|
|
|
|
- @Query("update ExportTaskEntity set status=:status, statusMsg=:statusMsg, filePath=:filePath, updateTime=:updateTime where id=:id")
|
|
|
|
- int updateStatusAndStatusMsgById(@Param("id") Long id, @Param("status") ExportTaskStatus status,
|
|
|
|
- @Param("statusMsg") String statusMsg, @Param("filePath") String filePath,
|
|
|
|
- @Param("updateTime") Date updateTime);
|
|
|
|
-
|
|
|
|
- @Query(nativeQuery = true, value = "select * from ec_oe_export_task t where t.status='WAITING' ORDER BY t.id limit 1")
|
|
|
|
- public ExportTaskEntity findExportTaskToDispose();
|
|
|
|
-
|
|
|
|
- @Query(nativeQuery = true, value = "select * from ec_oe_export_task t where t.status='WAITING' ORDER BY t.id limit 5")
|
|
|
|
- public List<ExportTaskEntity> findExportTaskToDisposes();
|
|
|
|
-
|
|
|
|
- @Transactional
|
|
|
|
- @Modifying
|
|
|
|
- @Query("update ExportTaskEntity set status=:status, startTime=:startTime where id=:id")
|
|
|
|
- int startExportTask(@Param("id") Long id, @Param("status") ExportTaskStatus status,
|
|
|
|
- @Param("startTime") Date startTime);
|
|
|
|
-
|
|
|
|
- @Transactional
|
|
|
|
- @Modifying
|
|
|
|
- @Query("update ExportTaskEntity set endTime=:endTime where id=:id")
|
|
|
|
- int endExportTask(@Param("id") Long id, @Param("endTime") Date endTime);
|
|
|
|
|
|
+ extends JpaRepository<ExportTaskEntity, Long>, JpaSpecificationExecutor<ExportTaskEntity> {
|
|
|
|
+
|
|
|
|
+ @Transactional
|
|
|
|
+ @Modifying
|
|
|
|
+ @Query("update ExportTaskEntity set status=:status, statusMsg=:statusMsg, filePath=:filePath, updateTime=:updateTime where id=:id")
|
|
|
|
+ int updateStatusAndStatusMsgById(@Param("id") Long id, @Param("status") ExportTaskStatus status,
|
|
|
|
+ @Param("statusMsg") String statusMsg, @Param("filePath") String filePath,
|
|
|
|
+ @Param("updateTime") Date updateTime);
|
|
|
|
+
|
|
|
|
+ @Query(nativeQuery = true, value = "select * from ec_oe_export_task t where t.status='WAITING' ORDER BY t.id limit 1")
|
|
|
|
+ public ExportTaskEntity findExportTaskToDispose();
|
|
|
|
+
|
|
|
|
+ @Query(nativeQuery = true, value = "select * from ec_oe_export_task t where t.status='WAITING' ORDER BY t.id limit 5")
|
|
|
|
+ public List<ExportTaskEntity> findExportTaskToDisposes();
|
|
|
|
+
|
|
|
|
+ @Transactional
|
|
|
|
+ @Modifying
|
|
|
|
+ @Query("update ExportTaskEntity set status=:status, startTime=:startTime where id=:id")
|
|
|
|
+ int startExportTask(@Param("id") Long id, @Param("status") ExportTaskStatus status,
|
|
|
|
+ @Param("startTime") Date startTime);
|
|
|
|
+
|
|
|
|
+ @Transactional
|
|
|
|
+ @Modifying
|
|
|
|
+ @Query("update ExportTaskEntity set endTime=:endTime where id=:id")
|
|
|
|
+ int endExportTask(@Param("id") Long id, @Param("endTime") Date endTime);
|
|
|
|
+
|
|
}
|
|
}
|