gtsoft-snail-job-server/easy-retry-datasource/easy-retry-mariadb-datasource/src/main/resources/mariadb/mapper/WorkflowTaskBatchMapper.xml
byteblogs168 abf654032c feat: 2.6.0
1. 工作流执行pg、mariadb数据库
2024-01-29 22:04:57 +08:00

47 lines
2.3 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.WorkflowTaskBatchMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.WorkflowTaskBatch">
<id column="id" property="id"/>
<result column="namespace_id" property="namespaceId"/>
<result column="group_name" property="groupName"/>
<result column="workflow_id" property="workflowId"/>
<result column="task_batch_status" property="taskBatchStatus"/>
<result column="operation_reason" property="operationReason"/>
<result column="execution_at" property="executionAt"/>
<result column="create_dt" property="createDt"/>
<result column="update_dt" property="updateDt"/>
<result column="deleted" property="deleted"/>
<result column="ext_attrs" property="extAttrs"/>
</resultMap>
<select id="selectWorkflowBatchPageList"
parameterType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.WorkflowBatchQueryDO"
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.WorkflowBatchResponseDO">
SELECT a.*, b.workflow_name
FROM workflow_task_batch a join workflow b on a.workflow_id = b.id
<where>
a.namespace_id = #{queryDO.namespaceId}
<if test="queryDO.workflowId != null">
and a.workflow_id = #{queryDO.workflowId}
</if>
<if test="queryDO.groupNames != null and queryDO.groupNames.size > 0">
and a.group_name IN
<foreach collection="queryDO.groupNames" item="groupName" open="(" separator="," close=")">
#{groupName}
</foreach>
</if>
<if test="queryDO.taskBatchStatus != null">
and task_batch_status = #{queryDO.taskBatchStatus}
</if>
<if test="queryDO.workflowName != null">
and b.workflow_name like #{queryDO.workflowName}
</if>
and a.deleted = 0
order by a.id desc
</where>
</select>
</mapper>