2023-09-29 23:13:45 +08:00
|
|
|
<?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.JobTaskBatchMapper">
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
|
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.JobTaskBatch">
|
|
|
|
<id column="id" property="id" />
|
|
|
|
<result column="group_name" property="groupName" />
|
|
|
|
<result column="job_id" property="jobId" />
|
2023-11-21 18:41:08 +08:00
|
|
|
<result column="namespace_id" property="namespaceId" />
|
2023-10-16 23:13:26 +08:00
|
|
|
<result column="task_batch_status" property="taskBatchStatus" />
|
2023-09-29 23:13:45 +08:00
|
|
|
<result column="create_dt" property="createDt" />
|
|
|
|
<result column="update_dt" property="updateDt" />
|
|
|
|
<result column="deleted" property="deleted" />
|
|
|
|
</resultMap>
|
2023-12-03 01:02:03 +08:00
|
|
|
<select id="selectJobBatchPageList"
|
2023-10-16 19:06:58 +08:00
|
|
|
parameterType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchQueryDO"
|
|
|
|
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchResponseDO">
|
2023-10-15 23:18:21 +08:00
|
|
|
SELECT a.*, b.job_name, b.task_type, b.block_strategy, b.trigger_type
|
|
|
|
FROM job_task_batch a join job b on a.job_id = b.id
|
2023-10-16 19:06:58 +08:00
|
|
|
<where>
|
2023-11-25 23:49:13 +08:00
|
|
|
a.namespace_id = #{queryDO.namespaceId}
|
2024-01-09 15:15:27 +08:00
|
|
|
and a.task_type = 3
|
2023-10-16 19:06:58 +08:00
|
|
|
<if test="queryDO.jobId != null">
|
2023-11-25 23:49:13 +08:00
|
|
|
and a.job_id = #{queryDO.jobId}
|
2023-10-16 19:06:58 +08:00
|
|
|
</if>
|
2023-12-10 23:58:49 +08:00
|
|
|
<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>
|
2023-10-16 19:06:58 +08:00
|
|
|
</if>
|
|
|
|
<if test="queryDO.taskBatchStatus != null">
|
2023-10-22 23:46:51 +08:00
|
|
|
and task_batch_status = #{queryDO.taskBatchStatus}
|
2023-10-16 19:06:58 +08:00
|
|
|
</if>
|
|
|
|
<if test="queryDO.jobName != null">
|
|
|
|
and job_name like #{queryDO.jobName}
|
|
|
|
</if>
|
|
|
|
and a.deleted = 0
|
2023-10-22 23:46:51 +08:00
|
|
|
order by a.id desc
|
2023-10-16 19:06:58 +08:00
|
|
|
</where>
|
|
|
|
|
2023-10-15 23:18:21 +08:00
|
|
|
</select>
|
2023-12-02 11:40:04 +08:00
|
|
|
|
|
|
|
<select id="summaryJobBatchList"
|
|
|
|
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchSummaryResponseDO">
|
2023-12-06 18:31:22 +08:00
|
|
|
SELECT namespace_id AS namespaceId,
|
|
|
|
job_id AS jobId,
|
|
|
|
group_name AS groupName,
|
|
|
|
task_batch_status AS taskBatchStatus,
|
|
|
|
operation_reason AS operationReason,
|
|
|
|
COUNT(operation_reason) AS operationReasonTotal,
|
|
|
|
SUM(CASE WHEN (task_batch_status = 3) THEN 1 ELSE 0 END) AS successNum,
|
|
|
|
SUM(CASE WHEN (task_batch_status = 6) THEN 1 ELSE 0 END) AS cancelNum,
|
|
|
|
SUM(CASE WHEN (task_batch_status = 5) THEN 1 ELSE 0 END) AS stopNum,
|
|
|
|
SUM(CASE WHEN (task_batch_status = 4) THEN 1 ELSE 0 END) AS failNum
|
2023-12-02 11:40:04 +08:00
|
|
|
FROM job_task_batch
|
|
|
|
WHERE create_dt BETWEEN #{from} AND #{to}
|
|
|
|
GROUP BY namespace_id, group_name, job_id, task_batch_status, operation_reason
|
|
|
|
|
|
|
|
</select>
|
2023-12-03 01:02:03 +08:00
|
|
|
|
|
|
|
<select id="selectJobBatchListByIds"
|
|
|
|
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchResponseDO">
|
|
|
|
SELECT a.*, b.job_name, b.task_type, b.block_strategy, b.trigger_type,b.executor_info,b.args_str
|
|
|
|
FROM job_task_batch a join job b on a.job_id = b.id
|
|
|
|
<where>
|
|
|
|
a.id in
|
|
|
|
<foreach collection="ids" item="id" separator="," open="(" close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
and a.deleted = 0
|
|
|
|
</where>
|
|
|
|
</select>
|
2023-09-29 23:13:45 +08:00
|
|
|
</mapper>
|