APITestMapper.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package cn.seecoder.web.dao.APITest;
  2. import cn.seecoder.web.model.vo.APITest.APITestResultVO;
  3. import org.apache.ibatis.annotations.*;
  4. import cn.seecoder.web.dao.provider.GeneralInsertUpdateSqlProvider;
  5. import cn.seecoder.web.model.po.APITest.TestInfo;
  6. import cn.seecoder.web.model.po.APITest.TestResult;
  7. import org.springframework.stereotype.Repository;
  8. import java.util.List;
  9. /**
  10. * @author zhaoxingrui
  11. * @date 2021/3/20
  12. * @description:
  13. */
  14. @Repository
  15. public interface APITestMapper {
  16. @InsertProvider(type = GeneralInsertUpdateSqlProvider.class, method = "insert")
  17. @Options(useGeneratedKeys = true, keyProperty = "param1.testId")
  18. boolean insert(TestInfo testInfo, String... ignoredCols);
  19. @Select("select * from test_info where project_id = #{id}")
  20. List<TestInfo> selectByProjectId(Integer id);
  21. @Select("select * from test_info where test_id = #{id}")
  22. TestInfo selectByTestId(Integer id);
  23. @Delete("delete from test_info where test_id = #{id}")
  24. boolean delete(Integer id);
  25. @InsertProvider(type = GeneralInsertUpdateSqlProvider.class, method = "insert")
  26. @Options(useGeneratedKeys = true, keyProperty = "param1.id")
  27. boolean execute(TestResult testResult, String... ignoredCols);
  28. @Select("select * from test_result where test_id = #{testId} and pipeline_record_id = #{pipelineRecordId}")
  29. List<TestResult> selectTestResultByTestId(@Param("testId") Integer testId,@Param("pipelineRecordId") Integer pipelineRecordId);
  30. @Delete("delete from test_result where test_id = #{id}")
  31. boolean deleteTestResult(Integer id);
  32. @Select("select * from test_result where test_id = #{testId} and pipeline_record_id = #{pipelineRecordId} order by id DESC LIMIT 0,1")
  33. TestResult selectLatestTestResultById(@Param("testId") Integer testId,@Param("pipelineRecordId") Integer pipelineRecordId);
  34. @Select("select * from test_result where pipeline_record_id = #{recordId}")
  35. List<APITestResultVO> selectByPipelineRecordId(Integer recordId);
  36. }