diff options
author | Dan Timoney <dt5972@att.com> | 2018-03-23 23:24:54 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-03-23 23:24:54 +0000 |
commit | f168a9c4462a8290e810f0f85b0e59fbec63cbc8 (patch) | |
tree | 30891713de7ea8d25196362f7927b8d5552d6af0 /SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/repository/PreTestConfigRepository.java | |
parent | f41f120dd20c29fac2a4e46dde647f13fce08932 (diff) | |
parent | 9f93b09a9d7a55f8e9450a2ee3b14d6317eb1ceb (diff) |
Merge "Certification module"
Diffstat (limited to 'SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/repository/PreTestConfigRepository.java')
-rw-r--r-- | SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/repository/PreTestConfigRepository.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/repository/PreTestConfigRepository.java b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/repository/PreTestConfigRepository.java new file mode 100644 index 0000000..07472d9 --- /dev/null +++ b/SDNCReports/sdnc_reports_dao/src/main/java/com/onap/sdnc/reports/repository/PreTestConfigRepository.java @@ -0,0 +1,34 @@ + +package com.onap.sdnc.reports.repository; + +import java.util.Date; +import java.util.List; + +import javax.transaction.Transactional; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import com.onap.sdnc.reports.model.PreTestConfig; + +@Repository +public interface PreTestConfigRepository extends JpaRepository<PreTestConfig, Long> { + + @Query(value= " from PreTestConfig where timestamp >= :startDate and timestamp <= :endDate" ) + List<PreTestConfig> findPreTestConfigByTimeStamp(@Param("startDate") Date startDate, @Param("endDate")Date endDate); + + + @Query(value= " from PreTestConfig where timestamp >= :startDate and timestamp <= :endDate and testName = :testName" ) + List<PreTestConfig> findReportByTestName(@Param("startDate") Date startDate, @Param("endDate")Date endDate, @Param("testName")String testName); + + @Query(value= " from PreTestConfig where timestamp >= :startDate and timestamp <= :endDate and device.deviceName = :deviceName" ) + List<PreTestConfig> findReportByDeviceName(@Param("startDate") Date startDate, @Param("endDate")Date endDate, @Param("deviceName")String deviceName); + + @Modifying + @Query(value = "insert into PreTestConfig (testName,result,execuationDetails,timestamp,deviceId) VALUES (:testName,:result,:execuationDetails,:timestamp,:deviceId)", nativeQuery = true) + @Transactional + void logPreTestReport(@Param("testName") String testName,@Param("result") String result, @Param("execuationDetails") String execuationDetails,@Param("timestamp") String timestamp,@Param("deviceId") long deviceId); +} |