gtsoft-snail-job-server/easy-retry-datasource/easy-retry-postgres-datasource/src/main/resources/postgresql/mapper/WorkflowMapper.xml

33 lines
1.4 KiB
XML

<?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">
<mapper namespace="com.aizuda.easy.retry.template.datasource.persistence.mapper.WorkflowMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.Workflow">
<id column="id" property="id" />
<result column="namespace_id" property="namespaceId" />
<result column="group_name" property="groupName" />
<result column="workflow_status" property="workflowStatus" />
<result column="next_trigger_at" property="nextTriggerAt" />
<result column="flow_info" property="flowInfo" />
<result column="create_dt" property="createDt" />
<result column="update_dt" property="updateDt" />
<result column="deleted" property="deleted" />
<result column="ext_attrs" property="extAttrs" />
</resultMap>
<update id="updateBatchNextTriggerAtById" parameterType="java.util.List">
UPDATE workflow AS rt
SET next_trigger_at = tt.next_trigger_at
FROM (
<foreach collection="list" item="item" index="index" separator="UNION ALL">
select
#{item.nextTriggerAt} as next_trigger_at,
#{item.id} as id
</foreach>
) AS tt
WHERE rt.id = tt.id
</update>
</mapper>