|
@@ -1,6 +1,6 @@
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
-<mapper namespace="cn.sciento.farm.automationv2.infra.repository.TaskExecutionMapper">
|
|
|
|
|
|
|
+<mapper namespace="cn.sciento.farm.automationv2.infra.mapper.TaskExecutionMapper">
|
|
|
|
|
|
|
|
<!-- ResultMap -->
|
|
<!-- ResultMap -->
|
|
|
<resultMap id="BaseResultMap" type="cn.sciento.farm.automationv2.domain.entity.TaskExecution">
|
|
<resultMap id="BaseResultMap" type="cn.sciento.farm.automationv2.domain.entity.TaskExecution">
|
|
@@ -8,7 +8,7 @@
|
|
|
<result column="task_id" property="taskId"/>
|
|
<result column="task_id" property="taskId"/>
|
|
|
<result column="task_name" property="taskName"/>
|
|
<result column="task_name" property="taskName"/>
|
|
|
<result column="trigger_type" property="triggerType" typeHandler="org.apache.ibatis.type.EnumTypeHandler"/>
|
|
<result column="trigger_type" property="triggerType" typeHandler="org.apache.ibatis.type.EnumTypeHandler"/>
|
|
|
- <result column="execution_plan" property="executionPlan" typeHandler="com.fasterxml.jackson.databind.ObjectMapper"/>
|
|
|
|
|
|
|
+ <result column="execution_plan" property="executionPlan" typeHandler="cn.sciento.mybatis.handler.JSONHandler" jdbcType="VARCHAR"/>
|
|
|
<result column="current_index" property="currentIndex"/>
|
|
<result column="current_index" property="currentIndex"/>
|
|
|
<result column="status" property="status" typeHandler="org.apache.ibatis.type.EnumTypeHandler"/>
|
|
<result column="status" property="status" typeHandler="org.apache.ibatis.type.EnumTypeHandler"/>
|
|
|
<result column="version" property="version"/>
|
|
<result column="version" property="version"/>
|
|
@@ -31,7 +31,7 @@
|
|
|
status, version, started_at, expected_finish_at, last_heartbeat_at,
|
|
status, version, started_at, expected_finish_at, last_heartbeat_at,
|
|
|
tenant_id, created_at
|
|
tenant_id, created_at
|
|
|
) VALUES (
|
|
) VALUES (
|
|
|
- #{taskId}, #{taskName}, #{triggerType}, #{executionPlan,typeHandler=com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter}, #{currentIndex},
|
|
|
|
|
|
|
+ #{taskId}, #{taskName}, #{triggerType}, #{executionPlan,typeHandler=cn.sciento.farm.automationv2.infra.typehandler.ExecutionPlanTypeHandler}, #{currentIndex},
|
|
|
#{status}, #{version}, #{startedAt}, #{expectedFinishAt}, #{lastHeartbeatAt},
|
|
#{status}, #{version}, #{startedAt}, #{expectedFinishAt}, #{lastHeartbeatAt},
|
|
|
#{tenantId}, NOW()
|
|
#{tenantId}, NOW()
|
|
|
)
|
|
)
|
|
@@ -64,7 +64,7 @@
|
|
|
<update id="updateById">
|
|
<update id="updateById">
|
|
|
UPDATE task_execution
|
|
UPDATE task_execution
|
|
|
<set>
|
|
<set>
|
|
|
- <if test="executionPlan != null">execution_plan = #{executionPlan,typeHandler=com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter},</if>
|
|
|
|
|
|
|
+ <if test="executionPlan != null">execution_plan = #{executionPlan,typeHandler=cn.sciento.farm.automationv2.infra.typehandler.ExecutionPlanTypeHandler},</if>
|
|
|
<if test="currentIndex != null">current_index = #{currentIndex},</if>
|
|
<if test="currentIndex != null">current_index = #{currentIndex},</if>
|
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
|
<if test="startedAt != null">started_at = #{startedAt},</if>
|
|
<if test="startedAt != null">started_at = #{startedAt},</if>
|
|
@@ -83,7 +83,7 @@
|
|
|
<update id="updateByVersion">
|
|
<update id="updateByVersion">
|
|
|
UPDATE task_execution
|
|
UPDATE task_execution
|
|
|
<set>
|
|
<set>
|
|
|
- <if test="executionPlan != null">execution_plan = #{executionPlan,typeHandler=com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter},</if>
|
|
|
|
|
|
|
+ <if test="executionPlan != null">execution_plan = #{executionPlan,typeHandler=cn.sciento.farm.automationv2.infra.typehandler.ExecutionPlanTypeHandler},</if>
|
|
|
<if test="currentIndex != null">current_index = #{currentIndex},</if>
|
|
<if test="currentIndex != null">current_index = #{currentIndex},</if>
|
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
|
<if test="startedAt != null">started_at = #{startedAt},</if>
|
|
<if test="startedAt != null">started_at = #{startedAt},</if>
|
|
@@ -109,7 +109,7 @@
|
|
|
<!-- 更新execution_plan(乐观锁) -->
|
|
<!-- 更新execution_plan(乐观锁) -->
|
|
|
<update id="updateExecutionPlan">
|
|
<update id="updateExecutionPlan">
|
|
|
UPDATE task_execution
|
|
UPDATE task_execution
|
|
|
- SET execution_plan = #{executionPlan},
|
|
|
|
|
|
|
+ SET execution_plan = #{executionPlan,typeHandler=cn.sciento.farm.automationv2.infra.typehandler.ExecutionPlanTypeHandler},
|
|
|
version = version + 1,
|
|
version = version + 1,
|
|
|
updated_at = NOW()
|
|
updated_at = NOW()
|
|
|
WHERE id = #{id} AND version = #{version}
|
|
WHERE id = #{id} AND version = #{version}
|