|
@@ -4,17 +4,12 @@ package com.css.simulation.resource.scheduler.infrastructure.db.mysql.mapper;
|
|
|
import com.css.simulation.resource.scheduler.infrastructure.entity.TaskEntity;
|
|
|
import org.apache.ibatis.annotations.*;
|
|
|
import org.apache.ibatis.type.JdbcType;
|
|
|
-import org.springframework.context.annotation.Scope;
|
|
|
|
|
|
import java.sql.Timestamp;
|
|
|
import java.util.List;
|
|
|
|
|
|
-/**
|
|
|
- * simulation_manual_project_task
|
|
|
- */
|
|
|
@Mapper
|
|
|
-@Scope
|
|
|
-public interface TaskMapper {
|
|
|
+public interface SimulationManualProjectTaskMapper {
|
|
|
|
|
|
@Results(id = "task", value = {
|
|
|
@Result(column = "id", property = "id", jdbcType = JdbcType.VARCHAR),
|
|
@@ -46,17 +41,6 @@ public interface TaskMapper {
|
|
|
"where id = #{taskId}")
|
|
|
TaskEntity selectById(@Param("taskId")String taskId);
|
|
|
|
|
|
- @ResultMap("task")
|
|
|
- @Select("select smpt.id, smpt.p_id, smpt.create_user_id\n" +
|
|
|
- "from simulation_manual_project_task smpt\n" +
|
|
|
- " left join simulation_manual_project smp on smpt.p_id = smp.id\n" +
|
|
|
- " left join simulation_automatic_subproject sas on smpt.p_id = sas.id\n" +
|
|
|
- "where smpt.is_deleted = '0'\n" +
|
|
|
- " and run_state = 'Running'\n" +
|
|
|
- " and (smp.is_deleted = 0 or sas.is_deleted = 0)")
|
|
|
- List<TaskEntity> selectByRunStateAndProjectIsNotDeleted(@Param("runState") String runState);
|
|
|
-
|
|
|
-
|
|
|
|
|
|
@Update("update simulation_manual_project_task\n" +
|
|
|
"set run_state = #{runState},run_start_time = #{runStartTime}\n" +
|
|
@@ -94,51 +78,9 @@ public interface TaskMapper {
|
|
|
"where id = #{id}")
|
|
|
String selectStateById(@Param("id") String id);
|
|
|
|
|
|
- @Update("update simulation_manual_project_task\n" +
|
|
|
- "set run_state = #{runState}," +
|
|
|
- " run_end_time = #{runStopTime}," +
|
|
|
- " run_result = 'Success'," +
|
|
|
- " return_scene_id = #{task.returnSceneId},\n" +
|
|
|
- " score = #{task.score},\n" +
|
|
|
- " target_evaluate = #{task.targetEvaluate},\n" +
|
|
|
- " score_explain = #{task.scoreExplain},\n" +
|
|
|
- " modify_user_id = #{task.modifyUserId},\n" +
|
|
|
- " modify_time = #{task.modifyTime}\n" +
|
|
|
- " where id = #{task.id}")
|
|
|
- void updateSuccessStateAndScoreResultWithStopTime(@Param("task") TaskEntity task, @Param("runState") String runState, @Param("runStopTime") Timestamp runStopTime);
|
|
|
|
|
|
- @Update("update simulation_manual_project_task\n" +
|
|
|
- "set run_state = #{runState}," +
|
|
|
- " run_result = 'Success'," +
|
|
|
- " return_scene_id = #{task.returnSceneId},\n" +
|
|
|
- " score = #{task.score},\n" +
|
|
|
- " target_evaluate = #{task.targetEvaluate},\n" +
|
|
|
- " score_explain = #{task.scoreExplain},\n" +
|
|
|
- " modify_user_id = #{task.modifyUserId},\n" +
|
|
|
- " modify_time = #{task.modifyTime}\n" +
|
|
|
- " where id = #{task.id}")
|
|
|
void updateSuccessState(@Param("task") TaskEntity task, @Param("runState") String runState);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- @Update("update simulation_manual_project_task\n" +
|
|
|
- "set run_state = #{runState}\n" +
|
|
|
- "where id = #{taskId}")
|
|
|
- void updateStateById(@Param("runState") String runState, @Param("taskId") String taskId);
|
|
|
-
|
|
|
-
|
|
|
@Delete("delete from simulation_manual_project_task where p_id = #{projectId}")
|
|
|
void deleteByProject(@Param("projectId") String projectId);
|
|
|
-
|
|
|
-
|
|
|
- @Select("select count(1)\n" +
|
|
|
- "from simulation_manual_project_task\n" +
|
|
|
- "where p_id = #{projectId}")
|
|
|
- int selectTaskNumByProjectId(@Param("projectId") String projectId);
|
|
|
-
|
|
|
- @Select("select count(1)\n" +
|
|
|
- "from simulation_manual_project_task\n" +
|
|
|
- "where run_state in ('Aborted', 'Terminated')\n" +
|
|
|
- " and p_id = #{projectId}")
|
|
|
- int selectErrorTaskNumByProjectId(@Param("projectId") String projectId);
|
|
|
}
|