update 重构 数据库sql九九归一
This commit is contained in:
parent
e625abb1f9
commit
7de17ebc73
@ -1,5 +1,6 @@
|
||||
package com.aizuda.easy.retry.template.datasource.config;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.aizuda.easy.retry.template.datasource.enums.DbTypeEnum;
|
||||
import com.aizuda.easy.retry.template.datasource.utils.DbUtils;
|
||||
@ -17,10 +18,12 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@ -38,7 +41,13 @@ public class EasyRetryTemplateAutoConfiguration {
|
||||
MybatisSqlSessionFactoryBean factoryBean = new MybatisSqlSessionFactoryBean();
|
||||
factoryBean.setDataSource(dataSource);
|
||||
DbTypeEnum dbTypeEnum = DbUtils.getDbType();
|
||||
factoryBean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(MessageFormat.format("classpath*:/{0}/mapper/*.xml", dbTypeEnum.getDb())));
|
||||
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
|
||||
Resource[] resources1 = resolver.getResources("classpath*:/template/mapper/*.xml");
|
||||
Resource[] resources2 = resolver.getResources(MessageFormat.format("classpath*:/{0}/mapper/*.xml", dbTypeEnum.getDb()));
|
||||
List<Resource> resources = new ArrayList<>();
|
||||
resources.addAll(Arrays.asList(resources1));
|
||||
resources.addAll(Arrays.asList(resources2));
|
||||
factoryBean.setMapperLocations(resources.toArray(new Resource[0]));
|
||||
factoryBean.setPlugins(mybatisPlusInterceptor);
|
||||
factoryBean.setTypeAliasesPackage(mybatisPlusProperties.getTypeAliasesPackage());
|
||||
factoryBean.setGlobalConfig(mybatisPlusProperties.getGlobalConfig());
|
||||
|
@ -4,6 +4,7 @@ import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobNotif
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobNotifyConfigResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobNotifyConfig;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.NotifyConfig;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
@ -15,5 +16,5 @@ import java.util.List;
|
||||
* @author zuoJunLin
|
||||
*/
|
||||
public interface JobNotifyConfigMapper extends BaseMapper<JobNotifyConfig> {
|
||||
List<JobNotifyConfigResponseDO> selectJobNotifyConfigList(IPage<JobNotifyConfig> iPage, @Param("queryDO") JobNotifyConfigQueryDO queryDO);
|
||||
List<JobNotifyConfigResponseDO> selectJobNotifyConfigList(IPage<JobNotifyConfig> iPage, @Param("ew") Wrapper<JobNotifyConfig> wrapper);
|
||||
}
|
||||
|
@ -3,7 +3,10 @@ package com.aizuda.easy.retry.template.datasource.persistence.mapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardCardResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardLineResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.Job;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobNotifyConfig;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobSummary;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -23,25 +26,11 @@ public interface JobSummaryMapper extends BaseMapper<JobSummary> {
|
||||
|
||||
int insertOrUpdate(@Param("list") List<JobSummary> list);
|
||||
|
||||
IPage<DashboardRetryLineResponseDO.Task> jobTaskList(@Param("namespaceId") String namespaceId, @Param("groupNames") List<String> groupNames, Page<Object> page);
|
||||
IPage<DashboardRetryLineResponseDO.Task> jobTaskList(@Param("ew") Wrapper<Job> wrapper, Page<Object> page);
|
||||
|
||||
List<DashboardLineResponseDO> jobLineList(
|
||||
@Param("systemTaskType") Integer systemTaskType,
|
||||
@Param("namespaceId") String namespaceId,
|
||||
@Param("groupNames") List<String> groupNames,
|
||||
@Param("groupName") String groupName,
|
||||
@Param("dateFormat") String dateFormat,
|
||||
@Param("from") LocalDateTime from,
|
||||
@Param("to") LocalDateTime to);
|
||||
List<DashboardLineResponseDO> jobLineList(@Param("ew") Wrapper<JobSummary> wrapper);
|
||||
|
||||
List<DashboardRetryLineResponseDO.Rank> dashboardRank(
|
||||
@Param("systemTaskType") Integer systemTaskType,
|
||||
@Param("namespaceId") String namespaceId,
|
||||
@Param("groupNames") List<String> groupNames,
|
||||
@Param("groupName") String groupName,
|
||||
@Param("startTime") LocalDateTime startTime,
|
||||
@Param("endTime") LocalDateTime endTime
|
||||
);
|
||||
List<DashboardRetryLineResponseDO.Rank> dashboardRank(@Param("ew") Wrapper<JobSummary> wrapper);
|
||||
|
||||
DashboardCardResponseDO.JobTask toJobTask(@Param("systemTaskType") Integer systemTaskType, @Param("namespaceId") String namespaceId, @Param("groupNames") List<String> groupNames);
|
||||
DashboardCardResponseDO.JobTask toJobTask(@Param("ew") Wrapper<JobSummary> wrapper);
|
||||
}
|
||||
|
@ -3,7 +3,10 @@ package com.aizuda.easy.retry.template.datasource.persistence.mapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchQueryDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchSummaryResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobSummary;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobTaskBatch;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.WorkflowTaskBatch;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -23,11 +26,11 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface JobTaskBatchMapper extends BaseMapper<JobTaskBatch> {
|
||||
|
||||
List<JobBatchResponseDO> selectJobBatchPageList(IPage<JobTaskBatch> iPage, @Param("queryDO") JobBatchQueryDO queryDO);
|
||||
List<JobBatchResponseDO> selectJobBatchPageList(IPage<JobTaskBatch> iPage, @Param("ew") Wrapper<JobTaskBatch> wrapper);
|
||||
|
||||
List<JobBatchResponseDO> selectJobBatchListByIds(@Param("ids") List<Long> ids);
|
||||
List<JobBatchResponseDO> selectJobBatchListByIds(@Param("ew") Wrapper<JobTaskBatch> wrapper);
|
||||
|
||||
List<JobBatchSummaryResponseDO> summaryJobBatchList(@Param("systemTaskType") Integer systemTaskType, @Param("from") LocalDateTime todayFrom, @Param("to") LocalDateTime to);
|
||||
List<JobBatchSummaryResponseDO> summaryJobBatchList(@Param("ew") Wrapper<JobTaskBatch> wrapper);
|
||||
|
||||
List<JobBatchSummaryResponseDO> summaryWorkflowTaskBatchList(@Param("from") LocalDateTime todayFrom, @Param("to") LocalDateTime to);
|
||||
List<JobBatchSummaryResponseDO> summaryWorkflowTaskBatchList(@Param("ew") Wrapper<WorkflowTaskBatch> wrapper);
|
||||
}
|
||||
|
@ -3,7 +3,10 @@ package com.aizuda.easy.retry.template.datasource.persistence.mapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardCardResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardLineResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.Job;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.RetrySummary;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.SceneConfig;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -23,24 +26,13 @@ public interface RetrySummaryMapper extends BaseMapper<RetrySummary> {
|
||||
|
||||
int insertOrUpdate(@Param("list") List<RetrySummary> list);
|
||||
|
||||
DashboardCardResponseDO.RetryTask retryTask(@Param("namespaceId") String namespaceId, @Param("groupNames") List<String> groupNames);
|
||||
DashboardCardResponseDO.RetryTask retryTask(@Param("ew") Wrapper<RetrySummary> wrapper);
|
||||
|
||||
List<DashboardCardResponseDO.RetryTask> retryTaskBarList(@Param("namespaceId") String namespaceId, @Param("groupNames") List<String> groupNames);
|
||||
List<DashboardCardResponseDO.RetryTask> retryTaskBarList(@Param("ew") Wrapper<RetrySummary> wrapper);
|
||||
|
||||
IPage<DashboardRetryLineResponseDO.Task> retryTaskList(@Param("namespaceId") String namespaceId, @Param("groupNames") List<String> groupNames, Page<Object> page);
|
||||
IPage<DashboardRetryLineResponseDO.Task> retryTaskList(@Param("ew") Wrapper<SceneConfig> wrapper, Page<Object> page);
|
||||
|
||||
List<DashboardLineResponseDO> retryLineList(@Param("namespaceId") String namespaceId,
|
||||
@Param("groupNames") List<String> groupNames,
|
||||
@Param("groupName") String groupName,
|
||||
@Param("type") String type,
|
||||
@Param("from") LocalDateTime from,
|
||||
@Param("to") LocalDateTime to);
|
||||
List<DashboardLineResponseDO> retryLineList(@Param("ew") Wrapper<RetrySummary> wrapper);
|
||||
|
||||
|
||||
List<DashboardRetryLineResponseDO.Rank> dashboardRank(@Param("namespaceId") String namespaceId,
|
||||
@Param("groupNames") List<String> groupNames,
|
||||
@Param("groupName") String groupName,
|
||||
@Param("startTime") LocalDateTime startTime,
|
||||
@Param("endTime") LocalDateTime endTime
|
||||
);
|
||||
List<DashboardRetryLineResponseDO.Rank> dashboardRank(@Param("ew") Wrapper<RetrySummary> wrapper);
|
||||
}
|
||||
|
@ -2,7 +2,9 @@ package com.aizuda.easy.retry.template.datasource.persistence.mapper;
|
||||
|
||||
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.RetrySummary;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.RetryTaskLog;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -13,5 +15,5 @@ public interface RetryTaskLogMapper extends BaseMapper<RetryTaskLog> {
|
||||
|
||||
int batchInsert(List<RetryTaskLog> list);
|
||||
|
||||
List<DashboardRetryResponseDO> retrySummaryRetryTaskLogList(@Param("from") LocalDateTime from, @Param("to") LocalDateTime to);
|
||||
List<DashboardRetryResponseDO> retrySummaryRetryTaskLogList(@Param("ew") Wrapper<RetryTaskLog> wrapper);
|
||||
}
|
||||
|
@ -17,20 +17,4 @@ import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface SequenceAllocMapper extends BaseMapper<SequenceAlloc> {
|
||||
|
||||
/**
|
||||
* 更新业务类型下的最大id
|
||||
*
|
||||
* @param step 步长
|
||||
* @param groupName
|
||||
* @return 更新结果
|
||||
*/
|
||||
Integer updateMaxIdByCustomStep(@Param("step") Integer step, @Param("groupName") String groupName, @Param("namespaceId") String namespaceId);
|
||||
|
||||
/**
|
||||
* 更新最大id
|
||||
*
|
||||
* @param groupName 组名称
|
||||
* @return 更新结果
|
||||
*/
|
||||
Integer updateMaxId(@Param("groupName") String groupName, @Param("namespaceId") String namespaceId);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.aizuda.easy.retry.template.datasource.persistence.mapper;
|
||||
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.ServerNode;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -15,8 +16,6 @@ public interface ServerNodeMapper extends BaseMapper<ServerNode> {
|
||||
|
||||
int insertOrUpdate(@Param("records") List<ServerNode> records);
|
||||
|
||||
int deleteByExpireAt(@Param("endTime") LocalDateTime endTime);
|
||||
|
||||
List<ActivePodQuantityResponseDO> countActivePod(@Param("namespaceIds") List<String> namespaceIds);
|
||||
List<ActivePodQuantityResponseDO> countActivePod(@Param("ew") Wrapper<ServerNode> wrapper);
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ import com.aizuda.easy.retry.template.datasource.persistence.dataobject.Workflow
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.WorkflowBatchResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobTaskBatch;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.WorkflowTaskBatch;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -22,5 +24,5 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface WorkflowTaskBatchMapper extends BaseMapper<WorkflowTaskBatch> {
|
||||
|
||||
List<WorkflowBatchResponseDO> selectWorkflowBatchPageList(PageDTO<JobTaskBatch> pageDTO,@Param("queryDO") WorkflowBatchQueryDO workflowBatchQueryDO);
|
||||
List<WorkflowBatchResponseDO> selectWorkflowBatchPageList(PageDTO<JobTaskBatch> pageDTO,@Param("ew") Wrapper<WorkflowTaskBatch> wrapper);
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
<result column="group_status" jdbcType="TINYINT" property="groupStatus" />
|
||||
<result column="version" jdbcType="TINYINT" property="version" />
|
||||
<result column="group_partition" jdbcType="TINYINT" property="groupPartition" />
|
||||
<result column="route_key" jdbcType="TINYINT" property="routeKey" />
|
||||
<result column="id_generator_mode" jdbcType="TINYINT" property="idGeneratorMode" />
|
||||
<result column="init_scene" jdbcType="TINYINT" property="initScene" />
|
||||
<result column="description" jdbcType="TINYINT" property="description" />
|
||||
@ -15,7 +14,7 @@
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, `group_name`, group_status, version, `group_partition`, route_key, id_generator_mode, init_scene, description, create_dt, update_dt
|
||||
id, `group_name`, group_status, version, `group_partition`, id_generator_mode, init_scene, description, create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -25,18 +25,6 @@
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobNotifyConfigResponseDO">
|
||||
SELECT a.*, b.job_name
|
||||
FROM job_notify_config a join job b on a.job_id = b.id
|
||||
<where>
|
||||
a.namespace_id = #{queryDO.namespaceId}
|
||||
<if test="queryDO.jobId != null">
|
||||
and a.job_id = #{queryDO.jobId}
|
||||
</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>
|
||||
order by a.id desc
|
||||
</where>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
@ -18,28 +18,7 @@
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchResponseDO">
|
||||
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
|
||||
<where>
|
||||
a.namespace_id = #{queryDO.namespaceId}
|
||||
and a.system_task_type = 3
|
||||
<if test="queryDO.jobId != null">
|
||||
and a.job_id = #{queryDO.jobId}
|
||||
</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.jobName != null">
|
||||
and job_name like #{queryDO.jobName}
|
||||
</if>
|
||||
and a.deleted = 0
|
||||
order by a.id desc
|
||||
</where>
|
||||
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="summaryJobBatchList"
|
||||
@ -55,8 +34,7 @@
|
||||
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
|
||||
FROM job_task_batch
|
||||
WHERE system_task_type = #{systemTaskType} AND create_dt BETWEEN #{from} AND #{to}
|
||||
GROUP BY namespace_id, group_name, job_id, task_batch_status, operation_reason
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="summaryWorkflowTaskBatchList"
|
||||
@ -72,20 +50,13 @@
|
||||
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
|
||||
FROM workflow_task_batch
|
||||
WHERE create_dt BETWEEN #{from} AND #{to}
|
||||
GROUP BY namespace_id, group_name, workflow_id, task_batch_status, operation_reason
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<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>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
@ -1,13 +1,13 @@
|
||||
<?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.SystemUserPermissionMapper">
|
||||
<mapper namespace="com.aizuda.easy.retry.template.datasource.persistence.mapper.SequenceAllocMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SystemUserPermission">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SequenceAlloc">
|
||||
<id column="id" property="id" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="system_user_id" property="systemUserId" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="max_id" property="maxId" />
|
||||
<result column="step" property="step" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
@ -21,26 +21,7 @@
|
||||
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>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -1,21 +0,0 @@
|
||||
<?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.DistributedLockMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.DistributedLock">
|
||||
<id column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="lock_until" property="lockUntil" />
|
||||
<result column="locked_at" property="lockedAt" />
|
||||
<result column="locked_by" property="lockedBy" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, name, lock_until, locked_at, locked_by, create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -1,21 +0,0 @@
|
||||
<?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.GroupConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.GroupConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="group_status" jdbcType="TINYINT" property="groupStatus" />
|
||||
<result column="version" jdbcType="TINYINT" property="version" />
|
||||
<result column="group_partition" jdbcType="TINYINT" property="groupPartition" />
|
||||
<result column="route_key" jdbcType="TINYINT" property="routeKey" />
|
||||
<result column="id_generator_mode" jdbcType="TINYINT" property="idGeneratorMode" />
|
||||
<result column="init_scene" jdbcType="TINYINT" property="initScene" />
|
||||
<result column="description" jdbcType="TINYINT" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, `group_name`, group_status, version, `group_partition`, route_key, id_generator_mode, init_scene, description, create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -1,42 +0,0 @@
|
||||
<?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.JobNotifyConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.JobNotifyConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="namespace_id" jdbcType="VARCHAR" property="namespaceId" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="job_id" jdbcType="BIGINT" property="jobId" />
|
||||
<result column="notify_status" jdbcType="TINYINT" property="notifyStatus" />
|
||||
<result column="notify_type" jdbcType="TINYINT" property="notifyType" />
|
||||
<result column="notify_attribute" jdbcType="VARCHAR" property="notifyAttribute" />
|
||||
<result column="notify_threshold" jdbcType="TINYINT" property="notifyThreshold" />
|
||||
<result column="notify_scene" jdbcType="TINYINT" property="notifyScene" />
|
||||
<result column="rate_limiter_status" jdbcType="TINYINT" property="rateLimiterStatus" />
|
||||
<result column="rate_limiter_threshold" jdbcType="TINYINT" property="rateLimiterThreshold" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id,namespace_id, group_name,job_id,notify_status,notify_type, notify_attribute, notify_threshold, notify_scene,rate_limiter_status,rate_limiter_threshold, description,
|
||||
create_dt, update_dt
|
||||
</sql>
|
||||
<select id="selectJobNotifyConfigList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobNotifyConfigResponseDO">
|
||||
SELECT a.*, b.job_name
|
||||
FROM job_notify_config a join job b on a.job_id = b.id
|
||||
<where>
|
||||
a.namespace_id = #{queryDO.namespaceId}
|
||||
<if test="queryDO.jobId != null">
|
||||
and a.job_id = #{queryDO.jobId}
|
||||
</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>
|
||||
order by a.id desc
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -61,18 +61,7 @@
|
||||
ifnull(SUM(fail_num + stop_num + cancel_num), 0) AS fail,
|
||||
ifnull(SUM(success_num + fail_num + stop_num + cancel_num), 0) AS total
|
||||
FROM job_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != null and groupName != '' ">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND system_task_type = #{systemTaskType} AND namespace_id = #{namespaceId} AND trigger_at BETWEEN #{from} AND #{to}
|
||||
</where>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY DATE_FORMAT(trigger_at, #{dateFormat})
|
||||
</select>
|
||||
|
||||
@ -84,13 +73,7 @@
|
||||
ifnull(sum(fail_num), 0) AS failNum,
|
||||
ifnull(sum(success_num + fail_num + stop_num + cancel_num), 0) AS totalNum
|
||||
FROM job_summary
|
||||
WHERE system_task_type = #{systemTaskType} AND namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="dashboardRank"
|
||||
@ -103,21 +86,7 @@
|
||||
CONCAT(group_name, '/', (SELECT workflow_name FROM workflow WHERE id = business_id)) name,
|
||||
</if>
|
||||
SUM(fail_num) AS total FROM job_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != '' and groupName != null">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND trigger_at >= #{startTime} AND trigger_at <= #{endTime}
|
||||
</where>
|
||||
AND system_task_type = #{systemTaskType}
|
||||
AND namespace_id = #{namespaceId}
|
||||
GROUP BY namespace_id, group_name, business_id
|
||||
${ew.customSqlSegment}
|
||||
HAVING total > 0
|
||||
ORDER BY total DESC LIMIT 10
|
||||
</select>
|
||||
@ -128,13 +97,7 @@
|
||||
SUM(CASE WHEN (job_status = 1) THEN 1 ELSE 0 END) AS run,
|
||||
COUNT(*) AS total
|
||||
FROM job
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY namespace_id, group_name
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,72 +0,0 @@
|
||||
<?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" />
|
||||
<result column="namespace_id" property="namespaceId" />
|
||||
<result column="task_batch_status" property="taskBatchStatus" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
<result column="deleted" property="deleted" />
|
||||
</resultMap>
|
||||
<select id="selectJobBatchPageList"
|
||||
parameterType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchQueryDO"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchResponseDO">
|
||||
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
|
||||
<where>
|
||||
a.namespace_id = #{queryDO.namespaceId}
|
||||
<if test="queryDO.jobId != null">
|
||||
and a.job_id = #{queryDO.jobId}
|
||||
</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.jobName != null">
|
||||
and job_name like #{queryDO.jobName}
|
||||
</if>
|
||||
and a.deleted = 0
|
||||
order by a.id desc
|
||||
</where>
|
||||
|
||||
</select>
|
||||
<select id="summaryJobBatchList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchSummaryResponseDO">
|
||||
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 (operation_reason IN (2, 3)) THEN 1 ELSE 0 END) AS cancelNum,
|
||||
SUM(CASE WHEN (operation_reason IN (1, 5, 8)) THEN 1 ELSE 0 END) AS stopNum,
|
||||
SUM(CASE WHEN (operation_reason IN (4, 6, 7)) THEN 1 ELSE 0 END) AS failNum
|
||||
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>
|
||||
<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>
|
||||
</mapper>
|
@ -47,13 +47,7 @@
|
||||
ifnull(sum(suspend_num), 0) AS suspendNum,
|
||||
ifnull(sum(running_num + finish_num + max_count_num + suspend_num), 0) AS totalNum
|
||||
FROM retry_summary
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="retryTaskBarList"
|
||||
@ -61,14 +55,8 @@
|
||||
SELECT
|
||||
trigger_at, running_num, finish_num, max_count_num, suspend_num
|
||||
FROM retry_summary
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC LIMIT 7
|
||||
${ew.customSqlSegment}
|
||||
LIMIT 7
|
||||
</select>
|
||||
|
||||
<select id="retryLineList"
|
||||
@ -98,18 +86,7 @@
|
||||
ifnull(SUM(suspend_num), 0) AS suspendNum,
|
||||
ifnull(SUM(finish_num + running_num + max_count_num + suspend_num), 0) AS total
|
||||
FROM retry_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != null and groupName != '' ">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND namespace_id = #{namespaceId} AND trigger_at BETWEEN #{from} AND #{to}
|
||||
</where>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY createDt
|
||||
</select>
|
||||
|
||||
@ -117,21 +94,9 @@
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO$Rank">
|
||||
SELECT
|
||||
CONCAT(group_name, '/', scene_name) `name`,
|
||||
SUM(running_num + finish_num + max_count_num + suspend_num) AS total FROM retry_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != '' and groupName != null">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND namespace_id = #{namespaceId}
|
||||
AND trigger_at >= #{startTime} AND trigger_at <= #{endTime}
|
||||
</where>
|
||||
GROUP BY namespace_id, group_name, scene_name
|
||||
SUM(running_num + finish_num + max_count_num + suspend_num) AS total
|
||||
FROM retry_summary
|
||||
${ew.customSqlSegment}
|
||||
HAVING total > 0
|
||||
ORDER BY total DESC LIMIT 10
|
||||
</select>
|
||||
@ -143,12 +108,7 @@
|
||||
count(*) AS total
|
||||
FROM scene_config
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY namespace_id, group_name
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -43,7 +43,6 @@
|
||||
SUM(CASE WHEN (retry_status = 2) THEN 1 ELSE 0 END) AS maxCountNum,
|
||||
SUM(CASE WHEN (retry_status = 3) THEN 1 ELSE 0 END) AS suspendNum
|
||||
FROM retry_task_log
|
||||
WHERE create_dt between #{from} and #{to}
|
||||
GROUP BY namespace_id, group_name, scene_name
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,25 +0,0 @@
|
||||
<?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.SequenceAllocMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SequenceAlloc">
|
||||
<id column="id" property="id" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="max_id" property="maxId" />
|
||||
<result column="step" property="step" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
<update id="updateMaxIdByCustomStep">
|
||||
UPDATE sequence_alloc
|
||||
SET max_id = max_id + #{step}, update_dt = now()
|
||||
WHERE group_name = #{groupName} and namespace_id = #{namespaceId}
|
||||
</update>
|
||||
|
||||
<update id="updateMaxId">
|
||||
UPDATE sequence_alloc
|
||||
SET max_id = max_id + step, update_dt = now()
|
||||
WHERE group_name = #{groupName} and namespace_id = #{namespaceId}
|
||||
</update>
|
||||
</mapper>
|
@ -29,16 +29,9 @@
|
||||
ON DUPLICATE KEY UPDATE
|
||||
expire_at = values(`expire_at`)
|
||||
</insert>
|
||||
<delete id="deleteByExpireAt">
|
||||
delete from server_node
|
||||
where expire_at <= #{endTime,jdbcType=TIMESTAMP}
|
||||
</delete>
|
||||
<select id="countActivePod" resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
|
||||
SELECT node_type as nodeType, count(*) as total
|
||||
from server_node where namespace_id in
|
||||
<foreach collection="namespaceIds" item="namespaceId" separator="," open="(" close=")">
|
||||
#{namespaceId}
|
||||
</foreach>
|
||||
GROUP BY node_type
|
||||
from server_node
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,14 +0,0 @@
|
||||
<?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.SystemUserPermissionMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SystemUserPermission">
|
||||
<id column="id" property="id" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="system_user_id" property="systemUserId" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,46 +0,0 @@
|
||||
<?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>
|
@ -60,18 +60,7 @@
|
||||
ifnull(SUM(fail_num), 0) AS fail,
|
||||
ifnull(SUM(success_num + fail_num + stop_num + cancel_num), 0) AS total
|
||||
FROM job_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != null and groupName != '' ">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND system_task_type = #{systemTaskType} AND namespace_id = #{namespaceId} AND trigger_at BETWEEN #{from} AND #{to}
|
||||
</where>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY DATE_FORMAT(trigger_at, #{dateFormat})
|
||||
</select>
|
||||
|
||||
@ -84,13 +73,7 @@
|
||||
ifnull(sum(fail_num), 0) AS failNum,
|
||||
ifnull(sum(success_num + fail_num + stop_num + cancel_num), 0) AS totalNum
|
||||
FROM job_summary
|
||||
WHERE system_task_type = #{systemTaskType} AND namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="dashboardRank"
|
||||
@ -103,21 +86,7 @@
|
||||
CONCAT(group_name, '/', (SELECT workflow_name FROM workflow WHERE id = business_id)) name,
|
||||
</if>
|
||||
SUM(fail_num) AS total FROM job_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != '' and groupName != null">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND trigger_at >= #{startTime} AND trigger_at <= #{endTime}
|
||||
</where>
|
||||
AND system_task_type = #{systemTaskType}
|
||||
AND namespace_id = #{namespaceId}
|
||||
GROUP BY namespace_id, group_name, business_id
|
||||
${ew.customSqlSegment}
|
||||
HAVING total > 0
|
||||
ORDER BY total DESC LIMIT 10
|
||||
</select>
|
||||
@ -128,13 +97,7 @@
|
||||
SUM(CASE WHEN (job_status = 1) THEN 1 ELSE 0 END) AS run,
|
||||
count(*) AS total
|
||||
FROM job
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY namespace_id, group_name
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,18 +0,0 @@
|
||||
<?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.JobTaskMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.JobTask">
|
||||
<id column="id" property="id" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="job_id" property="jobId" />
|
||||
<result column="task_batch_id" property="taskBatchId" />
|
||||
<result column="parent_id" property="parentId" />
|
||||
<result column="execute_status" property="executeStatus" />
|
||||
<result column="result_message" property="resultMessage" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,20 +0,0 @@
|
||||
<?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.NotifyConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.NotifyConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="notify_type" jdbcType="TINYINT" property="notifyType" />
|
||||
<result column="notify_attribute" jdbcType="VARCHAR" property="notifyAttribute" />
|
||||
<result column="notify_threshold" jdbcType="TINYINT" property="notifyThreshold" />
|
||||
<result column="notify_scene" jdbcType="TINYINT" property="notifyScene" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, group_name, notify_type, notify_attribute, notify_threshold, notify_scene, description,
|
||||
create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -48,13 +48,7 @@
|
||||
IFNULL(SUM(suspend_num), 0) AS suspendNum,
|
||||
IFNULL(SUM(running_num + finish_num + max_count_num + suspend_num), 0) AS totalNum
|
||||
FROM retry_summary
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="retryTaskBarList"
|
||||
@ -62,14 +56,8 @@
|
||||
SELECT
|
||||
trigger_at, running_num, finish_num, max_count_num, suspend_num
|
||||
FROM retry_summary
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC LIMIT 7
|
||||
${ew.customSqlSegment}
|
||||
LIMIT 7
|
||||
</select>
|
||||
|
||||
<select id="retryLineList"
|
||||
@ -99,18 +87,7 @@
|
||||
IFNULL(SUM(suspend_num), 0) AS suspendNum,
|
||||
IFNULL(SUM(finish_num + running_num + max_count_num + suspend_num), 0) AS total
|
||||
FROM retry_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != null and groupName != '' ">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND namespace_id = #{namespaceId} AND trigger_at BETWEEN #{from} AND #{to}
|
||||
</where>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY createDt
|
||||
</select>
|
||||
|
||||
@ -118,21 +95,9 @@
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO$Rank">
|
||||
SELECT
|
||||
CONCAT(group_name, '/', scene_name) `name`,
|
||||
SUM(running_num + finish_num + max_count_num + suspend_num) AS total FROM retry_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != '' and groupName != null">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND namespace_id = #{namespaceId}
|
||||
AND trigger_at >= #{startTime} AND trigger_at <= #{endTime}
|
||||
</where>
|
||||
GROUP BY namespace_id, group_name, scene_name
|
||||
SUM(running_num + finish_num + max_count_num + suspend_num) AS total
|
||||
FROM retry_summary
|
||||
${ew.customSqlSegment}
|
||||
HAVING total > 0
|
||||
ORDER BY total DESC LIMIT 10
|
||||
</select>
|
||||
@ -143,13 +108,7 @@
|
||||
SUM(CASE WHEN (scene_status = 1) THEN 1 ELSE 0 END) AS run,
|
||||
COUNT(*) AS total
|
||||
FROM scene_config
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY namespace_id, group_name
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -45,7 +45,6 @@
|
||||
SUM(CASE WHEN (retry_status = 2) THEN 1 ELSE 0 END) AS maxCountNum,
|
||||
SUM(CASE WHEN (retry_status = 3) THEN 1 ELSE 0 END) AS suspendNum
|
||||
FROM retry_task_log
|
||||
WHERE create_dt between #{from} and #{to}
|
||||
GROUP BY namespace_id, group_name, scene_name
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,20 +0,0 @@
|
||||
<?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.SceneConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SceneConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="scene_name" jdbcType="VARCHAR" property="sceneName" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="scene_status" jdbcType="TINYINT" property="sceneStatus" />
|
||||
<result column="max_retry_count" jdbcType="TINYINT" property="maxRetryCount" />
|
||||
<result column="back_off" jdbcType="TINYINT" property="backOff" />
|
||||
<result column="trigger_interval" jdbcType="TINYINT" property="triggerInterval" />
|
||||
<result column="deadline_request" jdbcType="BIGINT" property="deadlineRequest" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, scene_name, group_name, scene_status, max_retry_count, back_off, `trigger_interval`, deadline_request, description, create_dt, update_dt
|
||||
</sql>
|
||||
</mapper>
|
@ -1,25 +0,0 @@
|
||||
<?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.SequenceAllocMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SequenceAlloc">
|
||||
<id column="id" property="id" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="max_id" property="maxId" />
|
||||
<result column="step" property="step" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
<update id="updateMaxIdByCustomStep">
|
||||
UPDATE sequence_alloc
|
||||
SET max_id = max_id + #{step}, update_dt = now()
|
||||
WHERE group_name = #{groupName} and namespace_id = #{namespaceId}
|
||||
</update>
|
||||
|
||||
<update id="updateMaxId">
|
||||
UPDATE sequence_alloc
|
||||
SET max_id = max_id + step, update_dt = now()
|
||||
WHERE group_name = #{groupName} and namespace_id = #{namespaceId}
|
||||
</update>
|
||||
</mapper>
|
@ -30,17 +30,10 @@
|
||||
ON DUPLICATE KEY UPDATE
|
||||
expire_at = values(`expire_at`)
|
||||
</insert>
|
||||
<delete id="deleteByExpireAt">
|
||||
delete from server_node
|
||||
where expire_at <= #{endTime,jdbcType=TIMESTAMP}
|
||||
</delete>
|
||||
<select id="countActivePod"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
|
||||
SELECT node_type as nodeType, count(*) as total
|
||||
from server_node where namespace_id in
|
||||
<foreach collection="namespaceIds" item="namespaceId" separator="," open="(" close=")">
|
||||
#{namespaceId}
|
||||
</foreach>
|
||||
GROUP BY node_type
|
||||
from server_node
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,15 +0,0 @@
|
||||
<?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.SystemUserMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SystemUser">
|
||||
<id column="id" property="id" />
|
||||
<result column="username" property="username" />
|
||||
<result column="password" property="password" />
|
||||
<result column="role" property="role" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,22 +0,0 @@
|
||||
<?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.WorkflowNodeMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.WorkflowNode">
|
||||
<id column="id" property="id" />
|
||||
<result column="namespace_id" property="namespaceId" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="job_id" property="jobId" />
|
||||
<result column="node_type" property="nodeType" />
|
||||
<result column="expression_type" property="expressionType" />
|
||||
<result column="fail_strategy" property="failStrategy" />
|
||||
<result column="workflow_node_status" property="workflowNodeStatus" />
|
||||
<result column="node_expression" property="nodeExpression" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
<result column="deleted" property="deleted" />
|
||||
<result column="ext_attrs" property="extAttrs" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,21 +0,0 @@
|
||||
<?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.DistributedLockMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.DistributedLock">
|
||||
<id column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="lock_until" property="lockUntil" />
|
||||
<result column="locked_at" property="lockedAt" />
|
||||
<result column="locked_by" property="lockedBy" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, name, lock_until, locked_at, locked_by, create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -1,21 +0,0 @@
|
||||
<?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.GroupConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.GroupConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="group_status" jdbcType="TINYINT" property="groupStatus" />
|
||||
<result column="version" jdbcType="TINYINT" property="version" />
|
||||
<result column="group_partition" jdbcType="TINYINT" property="groupPartition" />
|
||||
<result column="route_key" jdbcType="TINYINT" property="routeKey" />
|
||||
<result column="id_generator_mode" jdbcType="TINYINT" property="idGeneratorMode" />
|
||||
<result column="init_scene" jdbcType="TINYINT" property="initScene" />
|
||||
<result column="description" jdbcType="TINYINT" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, group_name, group_status, version, group_partition, route_key, id_generator_mode, init_scene, description, create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -1,45 +0,0 @@
|
||||
<?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.JobNotifyConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.JobNotifyConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="namespace_id" jdbcType="VARCHAR" property="namespaceId" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="job_id" jdbcType="BIGINT" property="jobId" />
|
||||
<result column="notify_status" jdbcType="TINYINT" property="notifyStatus" />
|
||||
<result column="notify_type" jdbcType="TINYINT" property="notifyType" />
|
||||
<result column="notify_attribute" jdbcType="VARCHAR" property="notifyAttribute" />
|
||||
<result column="notify_threshold" jdbcType="TINYINT" property="notifyThreshold" />
|
||||
<result column="notify_scene" jdbcType="TINYINT" property="notifyScene" />
|
||||
<result column="rate_limiter_status" jdbcType="TINYINT" property="rateLimiterStatus" />
|
||||
<result column="rate_limiter_threshold" jdbcType="TINYINT" property="rateLimiterThreshold" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id,namespace_id, group_name,job_id,notify_status,notify_type, notify_attribute, notify_threshold, notify_scene,rate_limiter_status,rate_limiter_threshold, description,
|
||||
create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
<select id="selectJobNotifyConfigList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobNotifyConfigResponseDO">
|
||||
SELECT a.*, b.job_name
|
||||
FROM
|
||||
job_notify_config a
|
||||
JOIN job b ON a.job_id = b.id
|
||||
<where>
|
||||
a.namespace_id = #{queryDO.namespaceId}
|
||||
<if test="queryDO.jobId != null">
|
||||
AND a.job_id = #{queryDO.jobId}
|
||||
</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>
|
||||
</where>
|
||||
ORDER BY a.id DESC
|
||||
</select>
|
||||
</mapper>
|
@ -89,18 +89,7 @@
|
||||
stop_num,
|
||||
cancel_num
|
||||
FROM job_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != null and groupName != '' ">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND system_task_type = #{systemTaskType} AND namespace_id = #{namespaceId} AND trigger_at BETWEEN #{from} AND #{to}
|
||||
</where>
|
||||
${ew.customSqlSegment}
|
||||
)
|
||||
GROUP BY DATE_FORMAT(trigger_at, #{dateFormat})
|
||||
</select>
|
||||
@ -113,13 +102,7 @@
|
||||
COALESCE(sum(fail_num), 0) AS failNum,
|
||||
COALESCE(sum(success_num + fail_num + stop_num + cancel_num), 0) AS totalNum
|
||||
FROM job_summary
|
||||
WHERE system_task_type = #{systemTaskType} AND namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="dashboardRank"
|
||||
@ -135,21 +118,7 @@
|
||||
</if>
|
||||
SUM(fail_num) AS total
|
||||
FROM job_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != '' and groupName != null">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND trigger_at BETWEEN #{startTime} AND #{endTime}
|
||||
</where>
|
||||
AND system_task_type = #{systemTaskType}
|
||||
AND namespace_id = #{namespaceId}
|
||||
GROUP BY namespace_id, group_name, business_id
|
||||
${ew.customSqlSegment}
|
||||
HAVING SUM(fail_num) > 0
|
||||
ORDER BY total DESC
|
||||
)
|
||||
@ -162,13 +131,7 @@
|
||||
SUM(CASE WHEN (job_status = 1) THEN 1 ELSE 0 END) AS run,
|
||||
COUNT(*) AS total
|
||||
FROM job
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY namespace_id, group_name
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,82 +0,0 @@
|
||||
<?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" />
|
||||
<result column="namespace_id" property="namespaceId" />
|
||||
<result column="task_batch_status" property="taskBatchStatus" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
<result column="deleted" property="deleted" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectJobBatchPageList"
|
||||
parameterType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchQueryDO"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchResponseDO">
|
||||
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
|
||||
<where>
|
||||
a.namespace_id = #{queryDO.namespaceId}
|
||||
<if test="queryDO.jobId != null">
|
||||
AND a.job_id = #{queryDO.jobId}
|
||||
</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.jobName != null">
|
||||
AND job_name LIKE #{queryDO.jobName}
|
||||
</if>
|
||||
AND a.deleted = 0
|
||||
</where>
|
||||
ORDER BY a.id DESC
|
||||
</select>
|
||||
|
||||
<select id="summaryJobBatchList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchSummaryResponseDO">
|
||||
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 (operation_reason IN (2, 3)) THEN 1 ELSE 0 END) AS cancelNum,
|
||||
SUM(CASE WHEN (operation_reason IN (1, 5, 8)) THEN 1 ELSE 0 END) AS stopNum,
|
||||
SUM(CASE WHEN (operation_reason IN (4, 6, 7)) THEN 1 ELSE 0 END) AS failNum
|
||||
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>
|
||||
|
||||
<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>
|
||||
</mapper>
|
@ -1,18 +0,0 @@
|
||||
<?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.JobTaskMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.JobTask">
|
||||
<id column="id" property="id" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="job_id" property="jobId" />
|
||||
<result column="task_batch_id" property="taskBatchId" />
|
||||
<result column="parent_id" property="parentId" />
|
||||
<result column="task_status" property="taskStatus" />
|
||||
<result column="result_message" property="resultMessage" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,20 +0,0 @@
|
||||
<?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.NotifyConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.NotifyConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="notify_type" jdbcType="TINYINT" property="notifyType" />
|
||||
<result column="notify_attribute" jdbcType="VARCHAR" property="notifyAttribute" />
|
||||
<result column="notify_threshold" jdbcType="TINYINT" property="notifyThreshold" />
|
||||
<result column="notify_scene" jdbcType="TINYINT" property="notifyScene" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, group_name, notify_type, notify_attribute, notify_threshold, notify_scene, description,
|
||||
create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -67,13 +67,7 @@
|
||||
COALESCE(sum(suspend_num), 0) AS suspendNum,
|
||||
COALESCE(sum(running_num + finish_num + max_count_num + suspend_num), 0) AS totalNum
|
||||
FROM retry_summary
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="retryTaskBarList"
|
||||
@ -83,15 +77,8 @@
|
||||
(
|
||||
SELECT
|
||||
trigger_at, running_num, finish_num, max_count_num, suspend_num
|
||||
FROM retry_summary
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
FROM retry_summary
|
||||
${ew.customSqlSegment}
|
||||
)
|
||||
WHERE ROWNUM <![CDATA[ <= ]]> 7
|
||||
</select>
|
||||
@ -129,18 +116,7 @@
|
||||
max_count_num,
|
||||
suspend_num
|
||||
FROM retry_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != null and groupName != '' ">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND namespace_id = #{namespaceId} AND trigger_at BETWEEN #{from} AND #{to}
|
||||
</where>
|
||||
${ew.customSqlSegment}
|
||||
)
|
||||
GROUP BY createDt
|
||||
</select>
|
||||
@ -155,20 +131,7 @@
|
||||
group_name || '/' || scene_name AS name,
|
||||
SUM(running_num + finish_num + max_count_num + suspend_num) AS total
|
||||
FROM retry_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != '' and groupName != null">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND namespace_id = #{namespaceId}
|
||||
AND trigger_at BETWEEN #{startTime} AND #{endTime}
|
||||
</where>
|
||||
GROUP BY namespace_id, group_name, scene_name
|
||||
${ew.customSqlSegment}
|
||||
HAVING SUM(running_num + finish_num + max_count_num + suspend_num) > 0
|
||||
ORDER BY SUM(running_num + finish_num + max_count_num + suspend_num) DESC
|
||||
)
|
||||
@ -181,13 +144,7 @@
|
||||
SUM(CASE WHEN (scene_status = 1) THEN 1 ELSE 0 END) AS run,
|
||||
COUNT(*) AS total
|
||||
FROM scene_config
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY namespace_id, group_name
|
||||
</select>
|
||||
|
||||
|
@ -48,7 +48,6 @@
|
||||
SUM(CASE WHEN (retry_status = 2) THEN 1 ELSE 0 END) AS maxCountNum,
|
||||
SUM(CASE WHEN (retry_status = 3) THEN 1 ELSE 0 END) AS suspendNum
|
||||
FROM retry_task_log
|
||||
WHERE create_dt between #{from} and #{to}
|
||||
GROUP BY namespace_id, group_name, scene_name
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,21 +0,0 @@
|
||||
<?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.SceneConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SceneConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="scene_name" jdbcType="VARCHAR" property="sceneName" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="scene_status" jdbcType="TINYINT" property="sceneStatus" />
|
||||
<result column="max_retry_count" jdbcType="TINYINT" property="maxRetryCount" />
|
||||
<result column="back_off" jdbcType="TINYINT" property="backOff" />
|
||||
<result column="trigger_interval" jdbcType="TINYINT" property="triggerInterval" />
|
||||
<result column="deadline_request" jdbcType="BIGINT" property="deadlineRequest" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, scene_name, group_name, scene_status, max_retry_count, back_off, trigger_interval, deadline_request, description, create_dt, update_dt
|
||||
</sql>
|
||||
</mapper>
|
@ -1,25 +0,0 @@
|
||||
<?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.SequenceAllocMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SequenceAlloc">
|
||||
<id column="id" property="id" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="max_id" property="maxId" />
|
||||
<result column="step" property="step" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
<update id="updateMaxIdByCustomStep">
|
||||
UPDATE sequence_alloc
|
||||
SET max_id = max_id + #{step}, update_dt = CURRENT_TIMESTAMP
|
||||
WHERE group_name = #{groupName} AND namespace_id = #{namespaceId}
|
||||
</update>
|
||||
|
||||
<update id="updateMaxId">
|
||||
UPDATE sequence_alloc
|
||||
SET max_id = max_id + step, update_dt = CURRENT_TIMESTAMP
|
||||
WHERE group_name = #{groupName} AND namespace_id = #{namespaceId}
|
||||
</update>
|
||||
</mapper>
|
@ -53,23 +53,13 @@
|
||||
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByExpireAt">
|
||||
DELETE
|
||||
FROM server_node
|
||||
WHERE expire_at <= #{endTime,jdbcType=TIMESTAMP}
|
||||
</delete>
|
||||
|
||||
<select id="countActivePod"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
|
||||
SELECT
|
||||
node_type AS nodeType,
|
||||
COUNT(*) AS total
|
||||
FROM server_node
|
||||
WHERE namespace_id IN
|
||||
<foreach collection="namespaceIds" item="namespaceId" separator="," open="(" close=")">
|
||||
#{namespaceId}
|
||||
</foreach>
|
||||
GROUP BY node_type
|
||||
FROM server_node
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -1,15 +0,0 @@
|
||||
<?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.SystemUserMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SystemUser">
|
||||
<id column="id" property="id" />
|
||||
<result column="username" property="username" />
|
||||
<result column="password" property="password" />
|
||||
<result column="role" property="role" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,14 +0,0 @@
|
||||
<?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.SystemUserPermissionMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SystemUserPermission">
|
||||
<id column="id" property="id" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="system_user_id" property="systemUserId" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,22 +0,0 @@
|
||||
<?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.WorkflowNodeMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.WorkflowNode">
|
||||
<id column="id" property="id" />
|
||||
<result column="namespace_id" property="namespaceId" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="job_id" property="jobId" />
|
||||
<result column="node_type" property="nodeType" />
|
||||
<result column="expression_type" property="expressionType" />
|
||||
<result column="fail_strategy" property="failStrategy" />
|
||||
<result column="workflow_node_status" property="workflowNodeStatus" />
|
||||
<result column="node_expression" property="nodeExpression" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
<result column="deleted" property="deleted" />
|
||||
<result column="ext_attrs" property="extAttrs" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,48 +0,0 @@
|
||||
<?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
|
||||
</where>
|
||||
ORDER BY a.id DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -1,21 +0,0 @@
|
||||
<?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.DistributedLockMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.DistributedLock">
|
||||
<id column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="lock_until" property="lockUntil" />
|
||||
<result column="locked_at" property="lockedAt" />
|
||||
<result column="locked_by" property="lockedBy" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, name, lock_until, locked_at, locked_by, create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -1,21 +0,0 @@
|
||||
<?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.GroupConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.GroupConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="group_status" jdbcType="TINYINT" property="groupStatus" />
|
||||
<result column="version" jdbcType="TINYINT" property="version" />
|
||||
<result column="group_partition" jdbcType="TINYINT" property="groupPartition" />
|
||||
<result column="route_key" jdbcType="TINYINT" property="routeKey" />
|
||||
<result column="id_generator_mode" jdbcType="TINYINT" property="idGeneratorMode" />
|
||||
<result column="init_scene" jdbcType="TINYINT" property="initScene" />
|
||||
<result column="description" jdbcType="TINYINT" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, `group_name`, group_status, version, `group_partition`, route_key, id_generator_mode, init_scene, description, create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -1,43 +0,0 @@
|
||||
<?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.JobNotifyConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.JobNotifyConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="namespace_id" jdbcType="VARCHAR" property="namespaceId" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="job_id" jdbcType="BIGINT" property="jobId" />
|
||||
<result column="notify_status" jdbcType="TINYINT" property="notifyStatus" />
|
||||
<result column="notify_type" jdbcType="TINYINT" property="notifyType" />
|
||||
<result column="notify_attribute" jdbcType="VARCHAR" property="notifyAttribute" />
|
||||
<result column="notify_threshold" jdbcType="TINYINT" property="notifyThreshold" />
|
||||
<result column="notify_scene" jdbcType="TINYINT" property="notifyScene" />
|
||||
<result column="rate_limiter_status" jdbcType="TINYINT" property="rateLimiterStatus" />
|
||||
<result column="rate_limiter_threshold" jdbcType="TINYINT" property="rateLimiterThreshold" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id,namespace_id, group_name,job_id,notify_status,notify_type, notify_attribute, notify_threshold, notify_scene,rate_limiter_status,rate_limiter_threshold, description,
|
||||
create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
<select id="selectJobNotifyConfigList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobNotifyConfigResponseDO">
|
||||
SELECT a.*, b.job_name
|
||||
FROM job_notify_config a join job b on a.job_id = b.id
|
||||
<where>
|
||||
a.namespace_id = #{queryDO.namespaceId}
|
||||
<if test="queryDO.jobId != null">
|
||||
and a.job_id = #{queryDO.jobId}
|
||||
</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>
|
||||
order by a.id desc
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -61,18 +61,7 @@
|
||||
COALESCE(SUM(fail_num + stop_num + cancel_num), 0) AS fail,
|
||||
COALESCE(SUM(success_num + fail_num + stop_num + cancel_num), 0) AS total
|
||||
FROM job_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != null and groupName != '' ">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND system_task_type = #{systemTaskType} AND namespace_id = #{namespaceId} AND trigger_at BETWEEN #{from} AND #{to}
|
||||
</where>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY DATE_FORMAT(trigger_at, #{dateFormat})
|
||||
</select>
|
||||
|
||||
@ -84,13 +73,7 @@
|
||||
COALESCE(sum(fail_num), 0) AS failNum,
|
||||
COALESCE(sum(success_num + fail_num + stop_num + cancel_num), 0) AS totalNum
|
||||
FROM job_summary
|
||||
WHERE system_task_type = #{systemTaskType} AND namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="dashboardRank"
|
||||
@ -103,21 +86,7 @@
|
||||
CONCAT(group_name, '/', (SELECT workflow_name FROM workflow WHERE id = business_id)) name,
|
||||
</if>
|
||||
SUM(fail_num) AS total FROM job_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != '' and groupName != null">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND trigger_at >= #{startTime} AND trigger_at <= #{endTime}
|
||||
</where>
|
||||
AND system_task_type = #{systemTaskType}
|
||||
AND namespace_id = #{namespaceId}
|
||||
GROUP BY namespace_id, group_name, business_id
|
||||
${ew.customSqlSegment}
|
||||
HAVING SUM(fail_num) > 0
|
||||
ORDER BY total DESC LIMIT 10
|
||||
</select>
|
||||
@ -128,13 +97,7 @@
|
||||
SUM(CASE WHEN (job_status = 1) THEN 1 ELSE 0 END) AS run,
|
||||
count(*) AS total
|
||||
FROM job
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY namespace_id, group_name
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,71 +0,0 @@
|
||||
<?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" />
|
||||
<result column="namespace_id" property="namespaceId" />
|
||||
<result column="task_batch_status" property="taskBatchStatus" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
<result column="deleted" property="deleted" />
|
||||
</resultMap>
|
||||
<select id="selectJobBatchPageList"
|
||||
parameterType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchQueryDO"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchResponseDO">
|
||||
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
|
||||
<where>
|
||||
a.namespace_id = #{queryDO.namespaceId}
|
||||
<if test="queryDO.jobId != null">
|
||||
and a.job_id = #{queryDO.jobId}
|
||||
</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.jobName != null">
|
||||
and job_name like #{queryDO.jobName}
|
||||
</if>
|
||||
and a.deleted = 0
|
||||
order by a.id desc
|
||||
</where>
|
||||
</select>
|
||||
<select id="summaryJobBatchList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchSummaryResponseDO">
|
||||
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 (operation_reason IN (2, 3)) THEN 1 ELSE 0 END) AS cancelNum,
|
||||
SUM(CASE WHEN (operation_reason IN (1, 5, 8)) THEN 1 ELSE 0 END) AS stopNum,
|
||||
SUM(CASE WHEN (operation_reason IN (4, 6, 7)) THEN 1 ELSE 0 END) AS failNum
|
||||
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>
|
||||
<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>
|
||||
</mapper>
|
@ -1,18 +0,0 @@
|
||||
<?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.JobTaskMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.JobTask">
|
||||
<id column="id" property="id" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="job_id" property="jobId" />
|
||||
<result column="task_batch_id" property="taskBatchId" />
|
||||
<result column="parent_id" property="parentId" />
|
||||
<result column="task_status" property="taskStatus" />
|
||||
<result column="result_message" property="resultMessage" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,20 +0,0 @@
|
||||
<?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.NotifyConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.NotifyConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="notify_type" jdbcType="TINYINT" property="notifyType" />
|
||||
<result column="notify_attribute" jdbcType="VARCHAR" property="notifyAttribute" />
|
||||
<result column="notify_threshold" jdbcType="TINYINT" property="notifyThreshold" />
|
||||
<result column="notify_scene" jdbcType="TINYINT" property="notifyScene" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, group_name, notify_type, notify_attribute, notify_threshold, notify_scene, description,
|
||||
create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -47,13 +47,7 @@
|
||||
COALESCE(sum(suspend_num), 0) AS suspendNum,
|
||||
COALESCE(sum(running_num + finish_num + max_count_num + suspend_num), 0) AS totalNum
|
||||
FROM retry_summary
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="retryTaskBarList"
|
||||
@ -61,14 +55,8 @@
|
||||
SELECT
|
||||
trigger_at, running_num, finish_num, max_count_num, suspend_num
|
||||
FROM retry_summary
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC LIMIT 7
|
||||
${ew.customSqlSegment}
|
||||
LIMIT 7
|
||||
</select>
|
||||
|
||||
<select id="retryLineList"
|
||||
@ -98,18 +86,7 @@
|
||||
COALESCE(SUM(suspend_num), 0) AS suspendNum,
|
||||
COALESCE(SUM(finish_num + running_num + max_count_num + suspend_num), 0) AS total
|
||||
FROM retry_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != null and groupName != '' ">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND namespace_id = #{namespaceId} AND trigger_at BETWEEN #{from} AND #{to}
|
||||
</where>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY createDt
|
||||
</select>
|
||||
|
||||
@ -117,21 +94,9 @@
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO$Rank">
|
||||
SELECT
|
||||
CONCAT(group_name, '/', scene_name) name,
|
||||
SUM(running_num + finish_num + max_count_num + suspend_num) AS total FROM retry_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != '' and groupName != null">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND namespace_id = #{namespaceId}
|
||||
AND trigger_at >= #{startTime} AND trigger_at <= #{endTime}
|
||||
</where>
|
||||
GROUP BY namespace_id, group_name, scene_name
|
||||
SUM(running_num + finish_num + max_count_num + suspend_num) AS total
|
||||
FROM retry_summary
|
||||
${ew.customSqlSegment}
|
||||
HAVING SUM(running_num + finish_num + max_count_num + suspend_num) > 0
|
||||
ORDER BY total DESC LIMIT 10
|
||||
</select>
|
||||
@ -142,13 +107,7 @@
|
||||
sum(CASE WHEN (scene_status = 1) THEN 1 ELSE 0 END) AS run,
|
||||
count(*) AS total
|
||||
FROM scene_config
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY namespace_id, group_name
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -44,7 +44,6 @@
|
||||
SUM(CASE WHEN (retry_status = 2) THEN 1 ELSE 0 END) AS maxCountNum,
|
||||
SUM(CASE WHEN (retry_status = 3) THEN 1 ELSE 0 END) AS suspendNum
|
||||
FROM retry_task_log
|
||||
WHERE create_dt between #{from} and #{to}
|
||||
GROUP BY namespace_id, group_name, scene_name
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,20 +0,0 @@
|
||||
<?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.SceneConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SceneConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="scene_name" jdbcType="VARCHAR" property="sceneName" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="scene_status" jdbcType="TINYINT" property="sceneStatus" />
|
||||
<result column="max_retry_count" jdbcType="TINYINT" property="maxRetryCount" />
|
||||
<result column="back_off" jdbcType="TINYINT" property="backOff" />
|
||||
<result column="trigger_interval" jdbcType="TINYINT" property="triggerInterval" />
|
||||
<result column="deadline_request" jdbcType="BIGINT" property="deadlineRequest" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, scene_name, group_name, scene_status, max_retry_count, back_off, `trigger_interval`, deadline_request, description, create_dt, update_dt
|
||||
</sql>
|
||||
</mapper>
|
@ -1,25 +0,0 @@
|
||||
<?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.SequenceAllocMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SequenceAlloc">
|
||||
<id column="id" property="id" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="max_id" property="maxId" />
|
||||
<result column="step" property="step" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
<update id="updateMaxIdByCustomStep">
|
||||
UPDATE sequence_alloc
|
||||
SET max_id = max_id + #{step}, update_dt = now()
|
||||
WHERE group_name = #{groupName} and namespace_id = #{namespaceId}
|
||||
</update>
|
||||
|
||||
<update id="updateMaxId">
|
||||
UPDATE sequence_alloc
|
||||
SET max_id = max_id + step, update_dt = now()
|
||||
WHERE group_name = #{groupName} and namespace_id = #{namespaceId}
|
||||
</update>
|
||||
</mapper>
|
@ -30,18 +30,10 @@
|
||||
ON CONFLICT (host_id, host_ip) DO UPDATE SET expire_at = EXCLUDED.expire_at
|
||||
|
||||
</insert>
|
||||
<delete id="deleteByExpireAt">
|
||||
delete
|
||||
from server_node
|
||||
where expire_at <= #{endTime,jdbcType=TIMESTAMP}
|
||||
</delete>
|
||||
<select id="countActivePod"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
|
||||
SELECT node_type as nodeType, count(*) as total
|
||||
from server_node where namespace_id in
|
||||
<foreach collection="namespaceIds" item="namespaceId" separator="," open="(" close=")">
|
||||
#{namespaceId}
|
||||
</foreach>
|
||||
GROUP BY node_type
|
||||
from server_node
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,15 +0,0 @@
|
||||
<?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.SystemUserMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SystemUser">
|
||||
<id column="id" property="id" />
|
||||
<result column="username" property="username" />
|
||||
<result column="password" property="password" />
|
||||
<result column="role" property="role" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,22 +0,0 @@
|
||||
<?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.WorkflowNodeMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.WorkflowNode">
|
||||
<id column="id" property="id" />
|
||||
<result column="namespace_id" property="namespaceId" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="job_id" property="jobId" />
|
||||
<result column="node_type" property="nodeType" />
|
||||
<result column="expression_type" property="expressionType" />
|
||||
<result column="fail_strategy" property="failStrategy" />
|
||||
<result column="workflow_node_status" property="workflowNodeStatus" />
|
||||
<result column="node_expression" property="nodeExpression" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
<result column="deleted" property="deleted" />
|
||||
<result column="ext_attrs" property="extAttrs" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,46 +0,0 @@
|
||||
<?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>
|
@ -1,27 +0,0 @@
|
||||
<?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.DistributedLockMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.DistributedLock">
|
||||
<id column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="lock_until" property="lockUntil" />
|
||||
<result column="locked_at" property="lockedAt" />
|
||||
<result column="locked_by" property="lockedBy" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, name, lock_until, locked_at, locked_by, create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
<update id="updateTest">
|
||||
UPDATE distributed_lock SET locked_by = #{lockedBy},
|
||||
lock_until = #{lockUntil},
|
||||
locked_at = #{lockedAt}
|
||||
WHERE name = #{name} AND lock_until <![CDATA[ <= ]]> #{lockedAt}
|
||||
</update>
|
||||
</mapper>
|
@ -1,22 +0,0 @@
|
||||
<?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.GroupConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.GroupConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="group_status" jdbcType="TINYINT" property="groupStatus" />
|
||||
<result column="version" jdbcType="TINYINT" property="version" />
|
||||
<result column="group_partition" jdbcType="TINYINT" property="groupPartition" />
|
||||
<result column="route_key" jdbcType="TINYINT" property="routeKey" />
|
||||
<result column="id_generator_mode" jdbcType="TINYINT" property="idGeneratorMode" />
|
||||
<result column="init_scene" jdbcType="TINYINT" property="initScene" />
|
||||
<result column="description" jdbcType="TINYINT" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, `group_name`, group_status, version, `group_partition`, route_key, id_generator_mode, init_scene, description, create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -1,46 +0,0 @@
|
||||
<?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.JobNotifyConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.JobNotifyConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="namespace_id" jdbcType="VARCHAR" property="namespaceId" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="job_id" jdbcType="BIGINT" property="jobId" />
|
||||
<result column="notify_status" jdbcType="TINYINT" property="notifyStatus" />
|
||||
<result column="notify_type" jdbcType="TINYINT" property="notifyType" />
|
||||
<result column="notify_attribute" jdbcType="VARCHAR" property="notifyAttribute" />
|
||||
<result column="notify_threshold" jdbcType="TINYINT" property="notifyThreshold" />
|
||||
<result column="notify_scene" jdbcType="TINYINT" property="notifyScene" />
|
||||
<result column="rate_limiter_status" jdbcType="TINYINT" property="rateLimiterStatus" />
|
||||
<result column="rate_limiter_threshold" jdbcType="TINYINT" property="rateLimiterThreshold" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,namespace_id, group_name,job_id,notify_status,notify_type, notify_attribute, notify_threshold, notify_scene,rate_limiter_status,rate_limiter_threshold, description,
|
||||
create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
<select id="selectJobNotifyConfigList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobNotifyConfigResponseDO">
|
||||
SELECT a.*,
|
||||
b.job_name
|
||||
FROM job_notify_config a
|
||||
JOIN job b ON a.job_id = b.id
|
||||
<where>
|
||||
a.namespace_id = #{queryDO.namespaceId}
|
||||
<if test="queryDO.jobId != null">
|
||||
AND a.job_id = #{queryDO.jobId}
|
||||
</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>
|
||||
</where>
|
||||
ORDER BY a.id DESC
|
||||
</select>
|
||||
</mapper>
|
@ -77,20 +77,7 @@
|
||||
cancel_num,
|
||||
fail_num
|
||||
FROM job_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != null and groupName != '' ">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND system_task_type = #{systemTaskType}
|
||||
AND namespace_id = #{namespaceId}
|
||||
AND trigger_at BETWEEN #{from} AND #{to}
|
||||
</where>
|
||||
${ew.customSqlSegment}
|
||||
) AS subquery
|
||||
GROUP BY DATE_FORMAT(trigger_at, #{dateFormat})
|
||||
</select>
|
||||
@ -104,13 +91,7 @@
|
||||
ISNULL(sum(fail_num), 0) AS failNum,
|
||||
ISNULL(sum(success_num + fail_num + stop_num + cancel_num), 0) AS totalNum
|
||||
FROM job_summary
|
||||
WHERE system_task_type = #{systemTaskType} AND namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="dashboardRank"
|
||||
@ -125,21 +106,7 @@
|
||||
</if>
|
||||
SUM(fail_num) AS total
|
||||
FROM job_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != '' and groupName != null">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND trigger_at BETWEEN #{startTime} AND #{endTime}
|
||||
AND namespace_id = #{namespaceId}
|
||||
AND system_task_type = #{systemTaskType}
|
||||
</where>
|
||||
GROUP BY namespace_id, group_name, business_id
|
||||
${ew.customSqlSegment}
|
||||
HAVING SUM(fail_num) > 0
|
||||
ORDER BY name DESC
|
||||
</select>
|
||||
@ -152,13 +119,7 @@
|
||||
SUM(CASE WHEN (job_status = 1) THEN 1 ELSE 0 END) AS run,
|
||||
COUNT(*) AS total
|
||||
FROM job
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY namespace_id, group_name
|
||||
ORDER BY group_name
|
||||
</select>
|
||||
@ -169,12 +130,6 @@
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO$Task">
|
||||
SELECT COUNT(DISTINCT group_name)
|
||||
FROM job
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,89 +0,0 @@
|
||||
<?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" />
|
||||
<result column="namespace_id" property="namespaceId" />
|
||||
<result column="task_batch_status" property="taskBatchStatus" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
<result column="deleted" property="deleted" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectJobBatchPageList"
|
||||
parameterType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchQueryDO"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchResponseDO">
|
||||
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
|
||||
<where>
|
||||
a.namespace_id = #{queryDO.namespaceId}
|
||||
AND a.system_task_type = 3
|
||||
<if test="queryDO.jobId != null">
|
||||
AND a.job_id = #{queryDO.jobId}
|
||||
</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.jobName != null">
|
||||
AND job_name like #{queryDO.jobName}
|
||||
</if>
|
||||
AND a.deleted = 0
|
||||
</where>
|
||||
ORDER BY a.id DESC
|
||||
</select>
|
||||
|
||||
<select id="summaryJobBatchList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchSummaryResponseDO">
|
||||
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
|
||||
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>
|
||||
|
||||
<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>
|
||||
</mapper>
|
@ -1,18 +0,0 @@
|
||||
<?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.JobTaskMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.JobTask">
|
||||
<id column="id" property="id" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="job_id" property="jobId" />
|
||||
<result column="task_batch_id" property="taskBatchId" />
|
||||
<result column="parent_id" property="parentId" />
|
||||
<result column="execute_status" property="executeStatus" />
|
||||
<result column="result_message" property="resultMessage" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,15 +0,0 @@
|
||||
<?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.NamespaceMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.Namespace">
|
||||
<id column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="unique_id" property="uniqueId" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
<result column="deleted" property="deleted" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,21 +0,0 @@
|
||||
<?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.NotifyConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.NotifyConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="notify_type" jdbcType="TINYINT" property="notifyType" />
|
||||
<result column="notify_attribute" jdbcType="VARCHAR" property="notifyAttribute" />
|
||||
<result column="notify_threshold" jdbcType="TINYINT" property="notifyThreshold" />
|
||||
<result column="notify_scene" jdbcType="TINYINT" property="notifyScene" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, group_name, notify_type, notify_attribute, notify_threshold, notify_scene, description,
|
||||
create_dt, update_dt
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -59,13 +59,7 @@
|
||||
ISNULL(SUM(suspend_num), 0) AS suspendNum,
|
||||
ISNULL(SUM(running_num + finish_num + max_count_num + suspend_num), 0) AS totalNum
|
||||
FROM retry_summary
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="retryTaskBarList"
|
||||
@ -77,15 +71,7 @@
|
||||
max_count_num,
|
||||
suspend_num
|
||||
FROM retry_summary
|
||||
WHERE
|
||||
namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="retryLineList"
|
||||
@ -121,19 +107,7 @@
|
||||
max_count_num,
|
||||
suspend_num
|
||||
FROM retry_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != null and groupName != '' ">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND namespace_id = #{namespaceId}
|
||||
AND trigger_at BETWEEN #{from} AND #{to}
|
||||
</where>
|
||||
${ew.customSqlSegment}
|
||||
) AS subquery
|
||||
GROUP BY createDt
|
||||
</select>
|
||||
@ -144,20 +118,7 @@
|
||||
CONCAT(group_name, '/', scene_name) AS name,
|
||||
SUM(running_num + finish_num + max_count_num + suspend_num) AS total
|
||||
FROM retry_summary
|
||||
<where>
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupName != '' and groupName != null">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND namespace_id = #{namespaceId}
|
||||
AND trigger_at BETWEEN #{startTime} AND #{endTime}
|
||||
</where>
|
||||
GROUP BY namespace_id, group_name, scene_name
|
||||
${ew.customSqlSegment}
|
||||
HAVING SUM(running_num + finish_num + max_count_num + suspend_num) > 0
|
||||
ORDER BY total DESC
|
||||
</select>
|
||||
@ -170,14 +131,7 @@
|
||||
SUM(CASE WHEN (scene_status = 1) THEN 1 ELSE 0 END) AS run,
|
||||
COUNT(*) AS total
|
||||
FROM scene_config
|
||||
WHERE
|
||||
namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY namespace_id, group_name
|
||||
ORDER BY group_name
|
||||
</select>
|
||||
@ -186,13 +140,7 @@
|
||||
SQL Server SELECT COUNT(*) FROM (... ORDER BY group_name) 会报错 -->
|
||||
<select id="sqlServer_jobTaskList_Count" resultType="java.lang.Integer">
|
||||
SELECT COUNT(DISTINCT group_name)
|
||||
FROM scene_config
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
<if test="groupNames != null and groupNames.size > 0">
|
||||
AND group_name IN
|
||||
<foreach collection="groupNames" item="groupName" open="(" separator="," close=")">
|
||||
#{groupName}
|
||||
</foreach>
|
||||
</if>
|
||||
FROM scene_config
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -45,7 +45,6 @@
|
||||
SUM(CASE WHEN (retry_status = 2) THEN 1 ELSE 0 END) AS maxCountNum,
|
||||
SUM(CASE WHEN (retry_status = 3) THEN 1 ELSE 0 END) AS suspendNum
|
||||
FROM retry_task_log
|
||||
WHERE create_dt between #{from} and #{to}
|
||||
GROUP BY namespace_id, group_name, scene_name
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,21 +0,0 @@
|
||||
<?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.SceneConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SceneConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="scene_name" jdbcType="VARCHAR" property="sceneName" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="scene_status" jdbcType="TINYINT" property="sceneStatus" />
|
||||
<result column="max_retry_count" jdbcType="TINYINT" property="maxRetryCount" />
|
||||
<result column="back_off" jdbcType="TINYINT" property="backOff" />
|
||||
<result column="trigger_interval" jdbcType="TINYINT" property="triggerInterval" />
|
||||
<result column="deadline_request" jdbcType="BIGINT" property="deadlineRequest" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, scene_name, group_name, scene_status, max_retry_count, back_off, `trigger_interval`, deadline_request, description, create_dt, update_dt
|
||||
</sql>
|
||||
</mapper>
|
@ -1,25 +0,0 @@
|
||||
<?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.SequenceAllocMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SequenceAlloc">
|
||||
<id column="id" property="id" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="max_id" property="maxId" />
|
||||
<result column="step" property="step" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
<update id="updateMaxIdByCustomStep">
|
||||
UPDATE sequence_alloc
|
||||
SET max_id = max_id + #{step}, update_dt = now()
|
||||
WHERE group_name = #{groupName} and namespace_id = #{namespaceId}
|
||||
</update>
|
||||
|
||||
<update id="updateMaxId">
|
||||
UPDATE sequence_alloc
|
||||
SET max_id = max_id + step, update_dt = now()
|
||||
WHERE group_name = #{groupName} and namespace_id = #{namespaceId}
|
||||
</update>
|
||||
</mapper>
|
@ -47,21 +47,12 @@
|
||||
source.expire_at, source.node_type, source.ext_attrs, source.context_path, source.create_dt, GETDATE());
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByExpireAt">
|
||||
DELETE FROM server_node
|
||||
WHERE expire_at <= #{endTime,jdbcType=TIMESTAMP}
|
||||
</delete>
|
||||
|
||||
<select id="countActivePod"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
|
||||
SELECT
|
||||
node_type AS nodeType,
|
||||
COUNT(*) AS total
|
||||
FROM server_node
|
||||
WHERE namespace_id IN
|
||||
<foreach collection="namespaceIds" item="namespaceId" separator="," open="(" close=")">
|
||||
#{namespaceId}
|
||||
</foreach>
|
||||
GROUP BY node_type
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -1,15 +0,0 @@
|
||||
<?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.SystemUserMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SystemUser">
|
||||
<id column="id" property="id" />
|
||||
<result column="username" property="username" />
|
||||
<result column="password" property="password" />
|
||||
<result column="role" property="role" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,14 +0,0 @@
|
||||
<?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.SystemUserPermissionMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.SystemUserPermission">
|
||||
<id column="id" property="id" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="system_user_id" property="systemUserId" />
|
||||
<result column="namespace_id" property="namespaceId" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,22 +0,0 @@
|
||||
<?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.WorkflowNodeMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.WorkflowNode">
|
||||
<id column="id" property="id" />
|
||||
<result column="namespace_id" property="namespaceId" />
|
||||
<result column="group_name" property="groupName" />
|
||||
<result column="job_id" property="jobId" />
|
||||
<result column="node_type" property="nodeType" />
|
||||
<result column="expression_type" property="expressionType" />
|
||||
<result column="fail_strategy" property="failStrategy" />
|
||||
<result column="workflow_node_status" property="workflowNodeStatus" />
|
||||
<result column="node_expression" property="nodeExpression" />
|
||||
<result column="create_dt" property="createDt" />
|
||||
<result column="update_dt" property="updateDt" />
|
||||
<result column="deleted" property="deleted" />
|
||||
<result column="ext_attrs" property="extAttrs" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@ -1,50 +0,0 @@
|
||||
<?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
|
||||
</where>
|
||||
ORDER BY a.id DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -8,16 +8,13 @@ import com.aizuda.easy.retry.server.common.util.DateUtils;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.SequenceAllocMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.SequenceAlloc;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.LinkedBlockingDeque;
|
||||
@ -186,13 +183,18 @@ public class SegmentIdGenerator implements IdGenerator, Lifecycle {
|
||||
public void updateSegmentFromDb(Pair<String, String> key, Segment segment) {
|
||||
SegmentBuffer buffer = segment.getBuffer();
|
||||
SequenceAlloc sequenceAlloc;
|
||||
LambdaUpdateWrapper<SequenceAlloc> wrapper = new LambdaUpdateWrapper<SequenceAlloc>()
|
||||
.set(SequenceAlloc::getMaxId, "max_id + step")
|
||||
.set(SequenceAlloc::getUpdateDt, new Date())
|
||||
.eq(SequenceAlloc::getGroupName, key.getKey())
|
||||
.eq(SequenceAlloc::getNamespaceId, key.getValue());
|
||||
if (!buffer.isInitOk()) {
|
||||
sequenceAllocMapper.updateMaxId(key.getKey(), key.getValue());
|
||||
sequenceAllocMapper.update(wrapper);
|
||||
sequenceAlloc = sequenceAllocMapper.selectOne(new LambdaQueryWrapper<SequenceAlloc>().eq(SequenceAlloc::getGroupName, key));
|
||||
buffer.setStep(sequenceAlloc.getStep());
|
||||
buffer.setMinStep(sequenceAlloc.getStep());//leafAlloc中的step为DB中的step
|
||||
} else if (buffer.getUpdateTimestamp() == 0) {
|
||||
sequenceAllocMapper.updateMaxId(key.getKey(), key.getValue());
|
||||
sequenceAllocMapper.update(wrapper);
|
||||
sequenceAlloc = sequenceAllocMapper.selectOne(new LambdaQueryWrapper<SequenceAlloc>().eq(SequenceAlloc::getGroupName, key));
|
||||
buffer.setUpdateTimestamp(System.currentTimeMillis());
|
||||
buffer.setStep(sequenceAlloc.getStep());
|
||||
@ -211,9 +213,13 @@ public class SegmentIdGenerator implements IdGenerator, Lifecycle {
|
||||
} else {
|
||||
nextStep = nextStep / 2 >= buffer.getMinStep() ? nextStep / 2 : nextStep;
|
||||
}
|
||||
EasyRetryLog.LOCAL.debug("leafKey[{}], step[{}], duration[{}mins], nextStep[{}]", key, buffer.getStep(), String.format("%.2f", ((double) duration / (1000 * 60))), nextStep);
|
||||
|
||||
sequenceAllocMapper.updateMaxIdByCustomStep(nextStep, key.getKey(), key.getValue());
|
||||
EasyRetryLog.LOCAL.debug("leafKey[{}], step[{}], duration[{}mins], nextStep[{}]", key, buffer.getStep(), String.format("%.2f", ((double) duration / (1000 * 60))), nextStep);
|
||||
LambdaUpdateWrapper<SequenceAlloc> wrapper1 = new LambdaUpdateWrapper<SequenceAlloc>()
|
||||
.set(SequenceAlloc::getMaxId, "max_id + " + nextStep)
|
||||
.set(SequenceAlloc::getUpdateDt, new Date())
|
||||
.eq(SequenceAlloc::getGroupName, key.getKey())
|
||||
.eq(SequenceAlloc::getNamespaceId, key.getValue());
|
||||
sequenceAllocMapper.update(wrapper1);
|
||||
sequenceAlloc = sequenceAllocMapper
|
||||
.selectOne(new LambdaQueryWrapper<SequenceAlloc>().eq(SequenceAlloc::getGroupName, key));
|
||||
buffer.setUpdateTimestamp(System.currentTimeMillis());
|
||||
|
@ -13,6 +13,8 @@ import com.aizuda.easy.retry.server.common.util.DateUtils;
|
||||
import com.aizuda.easy.retry.server.job.task.support.event.JobTaskFailAlarmEvent;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobTaskBatchMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobTaskBatch;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -57,8 +59,9 @@ public class JobTaskFailAlarmListener extends AbstractJobAlarm<JobTaskFailAlarmE
|
||||
// 拉取200条
|
||||
List<Long> jobTaskBatchIds = Lists.newArrayList(jobTaskBatchId);
|
||||
queue.drainTo(jobTaskBatchIds, 200);
|
||||
|
||||
List<JobBatchResponseDO> jobTaskBatchList = jobTaskBatchMapper.selectJobBatchListByIds(jobTaskBatchIds);
|
||||
QueryWrapper<JobTaskBatch> wrapper = new QueryWrapper<JobTaskBatch>()
|
||||
.in("a.id", jobTaskBatchIds).eq("a.deleted", 0);
|
||||
List<JobBatchResponseDO> jobTaskBatchList = jobTaskBatchMapper.selectJobBatchListByIds(wrapper);
|
||||
return AlarmInfoConverter.INSTANCE.toJobAlarmInfos(jobTaskBatchList);
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,8 @@ import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatch
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobSummaryMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobTaskBatchMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobSummary;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobTaskBatch;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -63,7 +65,12 @@ public class JobSummarySchedule extends AbstractSchedule implements Lifecycle {
|
||||
// 定时按日实时查询统计数据(00:00:00 - 23:59:59)
|
||||
LocalDateTime todayFrom = LocalDateTime.of(LocalDate.now(), LocalTime.MIN).plusDays(-i);
|
||||
LocalDateTime todayTo = LocalDateTime.of(LocalDate.now(), LocalTime.MAX).plusDays(-i);
|
||||
List<JobBatchSummaryResponseDO> summaryResponseDOList = jobTaskBatchMapper.summaryJobBatchList(SyetemTaskTypeEnum.JOB.getType(), todayFrom, todayTo);
|
||||
LambdaQueryWrapper<JobTaskBatch> wrapper = new LambdaQueryWrapper<JobTaskBatch>()
|
||||
.eq(JobTaskBatch::getSystemTaskType, SyetemTaskTypeEnum.JOB.getType())
|
||||
.between(JobTaskBatch::getCreateDt, todayFrom, todayTo)
|
||||
.groupBy(JobTaskBatch::getNamespaceId, JobTaskBatch::getGroupName,
|
||||
JobTaskBatch::getJobId, JobTaskBatch::getTaskBatchStatus, JobTaskBatch::getOperationReason);
|
||||
List<JobBatchSummaryResponseDO> summaryResponseDOList = jobTaskBatchMapper.summaryJobBatchList(wrapper);
|
||||
if (summaryResponseDOList == null || summaryResponseDOList.size() < 1) {
|
||||
continue;
|
||||
}
|
||||
|
@ -12,6 +12,9 @@ import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatch
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobSummaryMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobTaskBatchMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobSummary;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobTaskBatch;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.WorkflowTaskBatch;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -66,7 +69,11 @@ public class WorkflowJobSummarySchedule extends AbstractSchedule implements Life
|
||||
// 定时按日实时查询统计数据(00:00:00 - 23:59:59)
|
||||
LocalDateTime todayFrom = LocalDateTime.of(LocalDate.now(), LocalTime.MIN).plusDays(-i);
|
||||
LocalDateTime todayTo = LocalDateTime.of(LocalDate.now(), LocalTime.MAX).plusDays(-i);
|
||||
List<JobBatchSummaryResponseDO> summaryWorkflowResponseDOList = jobTaskBatchMapper.summaryWorkflowTaskBatchList(todayFrom, todayTo);
|
||||
LambdaQueryWrapper<WorkflowTaskBatch> wrapper = new LambdaQueryWrapper<WorkflowTaskBatch>()
|
||||
.between(WorkflowTaskBatch::getCreateDt, todayFrom, todayTo)
|
||||
.groupBy(WorkflowTaskBatch::getNamespaceId, WorkflowTaskBatch::getGroupName,
|
||||
WorkflowTaskBatch::getWorkflowId, WorkflowTaskBatch::getTaskBatchStatus, WorkflowTaskBatch::getOperationReason);
|
||||
List<JobBatchSummaryResponseDO> summaryWorkflowResponseDOList = jobTaskBatchMapper.summaryWorkflowTaskBatchList(wrapper);
|
||||
if (summaryWorkflowResponseDOList == null || summaryWorkflowResponseDOList.size() < 1) {
|
||||
continue;
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ import com.aizuda.easy.retry.template.datasource.persistence.dataobject.Dashboar
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.RetrySummaryMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.RetryTaskLogMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.RetrySummary;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.RetryTaskLog;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -60,7 +62,10 @@ public class RetrySummarySchedule extends AbstractSchedule implements Lifecycle
|
||||
// 重试按日实时查询统计数据(00:00:00 - 23:59:59)
|
||||
LocalDateTime todayFrom = LocalDateTime.of(LocalDate.now(), LocalTime.MIN).plusDays(-i);
|
||||
LocalDateTime todayTo = LocalDateTime.of(LocalDate.now(), LocalTime.MAX).plusDays(-i);
|
||||
List<DashboardRetryResponseDO> dashboardRetryResponseDOList = retryTaskLogMapper.retrySummaryRetryTaskLogList(todayFrom, todayTo);
|
||||
LambdaQueryWrapper<RetryTaskLog> wrapper = new LambdaQueryWrapper<RetryTaskLog>()
|
||||
.between(RetryTaskLog::getCreateDt, todayFrom, todayTo)
|
||||
.groupBy(RetryTaskLog::getNamespaceId, RetryTaskLog::getGroupName, RetryTaskLog::getSceneName);
|
||||
List<DashboardRetryResponseDO> dashboardRetryResponseDOList = retryTaskLogMapper.retrySummaryRetryTaskLogList(wrapper);
|
||||
if (dashboardRetryResponseDOList == null || dashboardRetryResponseDOList.size() < 1) {
|
||||
continue;
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ import com.aizuda.easy.retry.server.common.cache.CacheRegisterTable;
|
||||
import com.aizuda.easy.retry.server.common.register.ServerRegister;
|
||||
import com.aizuda.easy.retry.server.common.schedule.AbstractSchedule;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.ServerNodeMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.ServerNode;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -41,7 +43,7 @@ public class OfflineNodeSchedule extends AbstractSchedule implements Lifecycle {
|
||||
ServerRegister.DELAY_TIME + (ServerRegister.DELAY_TIME / 3));
|
||||
|
||||
// 先删除DB中需要下线的机器
|
||||
serverNodeMapper.deleteByExpireAt(endTime);
|
||||
serverNodeMapper.delete(new LambdaQueryWrapper<ServerNode>().le(ServerNode::getExpireAt, endTime));
|
||||
|
||||
Set<RegisterNodeInfo> allPods = CacheRegisterTable.getAllPods();
|
||||
Set<RegisterNodeInfo> waitOffline = allPods.stream().filter(registerNodeInfo -> registerNodeInfo.getExpireAt().isBefore(endTime)).collect(
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.aizuda.easy.retry.server.web.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.aizuda.easy.retry.common.core.enums.NodeTypeEnum;
|
||||
import com.aizuda.easy.retry.common.core.model.Result;
|
||||
@ -8,7 +9,6 @@ import com.aizuda.easy.retry.common.core.util.NetUtil;
|
||||
import com.aizuda.easy.retry.common.log.EasyRetryLog;
|
||||
import com.aizuda.easy.retry.server.common.dto.DistributeInstance;
|
||||
import com.aizuda.easy.retry.server.common.dto.ServerNodeExtAttrs;
|
||||
import com.aizuda.easy.retry.server.common.enums.DashboardLineEnum;
|
||||
import com.aizuda.easy.retry.server.common.enums.SyetemTaskTypeEnum;
|
||||
import com.aizuda.easy.retry.server.common.enums.SystemModeEnum;
|
||||
import com.aizuda.easy.retry.server.common.register.ServerRegister;
|
||||
@ -32,7 +32,7 @@ import com.aizuda.easy.retry.template.datasource.persistence.dataobject.Dashboar
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobSummaryMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.RetrySummaryMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.ServerNodeMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.ServerNode;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.*;
|
||||
import com.aizuda.easy.retry.template.datasource.utils.DbUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -79,15 +79,26 @@ public class DashBoardServiceImpl implements DashBoardService {
|
||||
List<String> groupNames = userSessionVO.isUser() ? userSessionVO.getGroupNames() : new ArrayList<>();
|
||||
DashboardCardResponseVO dashboardCardResponseVO = new DashboardCardResponseVO();
|
||||
// 重试任务
|
||||
DashboardCardResponseDO.RetryTask retryTaskDO = retrySummaryMapper.retryTask(namespaceId, groupNames);
|
||||
LambdaQueryWrapper<RetrySummary> wrapper2 = new LambdaQueryWrapper<RetrySummary>()
|
||||
.eq(RetrySummary::getNamespaceId, namespaceId)
|
||||
.in(CollUtil.isNotEmpty(groupNames), RetrySummary::getGroupName, groupNames);
|
||||
DashboardCardResponseDO.RetryTask retryTaskDO = retrySummaryMapper.retryTask(wrapper2);
|
||||
DashboardCardResponseVO.RetryTask retryTaskVO = RetrySummaryResponseVOConverter.INSTANCE.toRetryTask(retryTaskDO);
|
||||
dashboardCardResponseVO.setRetryTask(retryTaskVO);
|
||||
// 定时任务
|
||||
DashboardCardResponseDO.JobTask jobTaskDO = jobSummaryMapper.toJobTask(SyetemTaskTypeEnum.JOB.getType(), namespaceId, groupNames);
|
||||
LambdaQueryWrapper<JobSummary> wrapper = new LambdaQueryWrapper<JobSummary>()
|
||||
.eq(JobSummary::getSystemTaskType, SyetemTaskTypeEnum.JOB.getType())
|
||||
.eq(JobSummary::getNamespaceId, namespaceId)
|
||||
.in(CollUtil.isNotEmpty(groupNames), JobSummary::getGroupName, groupNames);
|
||||
DashboardCardResponseDO.JobTask jobTaskDO = jobSummaryMapper.toJobTask(wrapper);
|
||||
DashboardCardResponseVO.JobTask jobTaskVO = JobSummaryResponseVOConverter.INSTANCE.toTaskJob(jobTaskDO);
|
||||
dashboardCardResponseVO.setJobTask(jobTaskVO);
|
||||
// 工作流任务
|
||||
DashboardCardResponseDO.JobTask workFlowTaskDO = jobSummaryMapper.toJobTask(SyetemTaskTypeEnum.WORKFLOW.getType(), namespaceId, groupNames);
|
||||
LambdaQueryWrapper<JobSummary> wrapper1 = new LambdaQueryWrapper<JobSummary>()
|
||||
.eq(JobSummary::getSystemTaskType, SyetemTaskTypeEnum.WORKFLOW.getType())
|
||||
.eq(JobSummary::getNamespaceId, namespaceId)
|
||||
.in(CollUtil.isNotEmpty(groupNames), JobSummary::getGroupName, groupNames);
|
||||
DashboardCardResponseDO.JobTask workFlowTaskDO = jobSummaryMapper.toJobTask(wrapper1);
|
||||
DashboardCardResponseVO.WorkFlowTask workFlowTaskVO = JobSummaryResponseVOConverter.INSTANCE.toWorkFlowTask(workFlowTaskDO);
|
||||
dashboardCardResponseVO.setWorkFlowTask(workFlowTaskVO);
|
||||
// 重试任务柱状图
|
||||
@ -96,8 +107,11 @@ public class DashBoardServiceImpl implements DashBoardService {
|
||||
DashboardCardResponseVO.RetryTaskBar retryTaskBar = new DashboardCardResponseVO.RetryTaskBar().setX(LocalDateTime.of(LocalDate.now(), LocalTime.MIN).plusDays(-i).toLocalDate().toString()).setTaskTotal(0L);
|
||||
retryTaskBarMap.put(LocalDateTime.of(LocalDate.now(), LocalTime.MIN).plusDays(-i), retryTaskBar);
|
||||
}
|
||||
|
||||
List<DashboardCardResponseDO.RetryTask> retryTaskList = retrySummaryMapper.retryTaskBarList(namespaceId, groupNames);
|
||||
LambdaQueryWrapper<RetrySummary> wrapper3 = new LambdaQueryWrapper<RetrySummary>()
|
||||
.eq(RetrySummary::getNamespaceId, namespaceId)
|
||||
.in(CollUtil.isNotEmpty(groupNames), RetrySummary::getGroupName, groupNames)
|
||||
.orderByDesc(RetrySummary::getId);
|
||||
List<DashboardCardResponseDO.RetryTask> retryTaskList = retrySummaryMapper.retryTaskBarList(wrapper3);
|
||||
Map<LocalDateTime, LongSummaryStatistics> summaryStatisticsMap = retryTaskList.stream().collect(Collectors.groupingBy(DashboardCardResponseDO.RetryTask::getTriggerAt,
|
||||
Collectors.summarizingLong(i -> i.getMaxCountNum() + i.getRunningNum() + i.getSuspendNum() + i.getFinishNum())));
|
||||
for (Map.Entry<LocalDateTime, LongSummaryStatistics> map : summaryStatisticsMap.entrySet()) {
|
||||
@ -108,7 +122,10 @@ public class DashBoardServiceImpl implements DashBoardService {
|
||||
}
|
||||
dashboardCardResponseVO.setRetryTaskBarList(new ArrayList<>(retryTaskBarMap.values()));
|
||||
// 在线Pods
|
||||
List<ActivePodQuantityResponseDO> activePodQuantityDO = serverNodeMapper.countActivePod(Lists.newArrayList(userSessionVO.getNamespaceId(), ServerRegister.NAMESPACE_ID));
|
||||
LambdaQueryWrapper<ServerNode> wrapper4 = new LambdaQueryWrapper<ServerNode>()
|
||||
.in(ServerNode::getNamespaceId, Lists.newArrayList(userSessionVO.getNamespaceId(), ServerRegister.NAMESPACE_ID))
|
||||
.groupBy(ServerNode::getNodeType);
|
||||
List<ActivePodQuantityResponseDO> activePodQuantityDO = serverNodeMapper.countActivePod(wrapper4);
|
||||
Map<Integer, Long> map = activePodQuantityDO.stream().collect(Collectors.toMap(ActivePodQuantityResponseDO::getNodeType, ActivePodQuantityResponseDO::getTotal));
|
||||
Long clientTotal = map.getOrDefault(NodeTypeEnum.CLIENT.getType(), 0L);
|
||||
Long serverTotal = map.getOrDefault(NodeTypeEnum.SERVER.getType(), 0L);
|
||||
@ -133,7 +150,10 @@ public class DashBoardServiceImpl implements DashBoardService {
|
||||
if (DbTypeEnum.SQLSERVER == DbUtils.getDbType()) {
|
||||
pager.setCountId("sqlServer_jobTaskList_Count");
|
||||
}
|
||||
IPage<DashboardRetryLineResponseDO.Task> IPage = retrySummaryMapper.retryTaskList(namespaceId, groupNames, pager);
|
||||
LambdaQueryWrapper<SceneConfig> wrapper = new LambdaQueryWrapper<SceneConfig>()
|
||||
.eq(SceneConfig::getNamespaceId, namespaceId)
|
||||
.in(CollUtil.isNotEmpty(groupNames), SceneConfig::getGroupName, groupNames);
|
||||
IPage<DashboardRetryLineResponseDO.Task> IPage = retrySummaryMapper.retryTaskList(wrapper, pager);
|
||||
List<DashboardRetryLineResponseVO.Task> taskList = JobSummaryResponseVOConverter.INSTANCE.toDashboardRetryLineResponseVO(IPage.getRecords());
|
||||
PageResult<List<DashboardRetryLineResponseVO.Task>> pageResult = new PageResult<>(new PageDTO(IPage.getCurrent(), IPage.getSize(), IPage.getTotal()), taskList);
|
||||
dashboardRetryLineResponseVO.setTaskList(pageResult);
|
||||
@ -142,14 +162,26 @@ public class DashBoardServiceImpl implements DashBoardService {
|
||||
DateTypeEnum dateTypeEnum = DateTypeEnum.valueOf(type);
|
||||
LocalDateTime startDateTime = dateTypeEnum.getStartTime().apply(StrUtil.isNotBlank(startTime) ? LocalDateTime.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) : null);
|
||||
LocalDateTime endDateTime = dateTypeEnum.getEndTime().apply(StrUtil.isNotBlank(endTime) ? LocalDateTime.parse(endTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) : null);
|
||||
List<DashboardLineResponseDO> dashboardRetryLinkeResponseDOList = retrySummaryMapper.retryLineList(namespaceId, groupNames, groupName, type, startDateTime, endDateTime);
|
||||
LambdaQueryWrapper<RetrySummary> wrapper1 = new LambdaQueryWrapper<RetrySummary>()
|
||||
.in(CollUtil.isNotEmpty(groupNames), RetrySummary::getGroupName, groupNames)
|
||||
.eq(StrUtil.isNotBlank(groupName), RetrySummary::getGroupName, groupNames)
|
||||
.eq(RetrySummary::getNamespaceId, namespaceId)
|
||||
.between(RetrySummary::getTriggerAt, startDateTime, endDateTime);
|
||||
List<DashboardLineResponseDO> dashboardRetryLinkeResponseDOList = retrySummaryMapper.retryLineList(wrapper1);
|
||||
List<DashboardLineResponseVO> dashboardLineResponseVOList = DispatchQuantityResponseVOConverter.INSTANCE.toDashboardLineResponseVO(dashboardRetryLinkeResponseDOList);
|
||||
dateTypeEnum.getConsumer().accept(dashboardLineResponseVOList);
|
||||
dashboardLineResponseVOList.sort(Comparator.comparing(a -> a.getCreateDt()));
|
||||
dashboardRetryLineResponseVO.setDashboardLineResponseDOList(dashboardLineResponseVOList);
|
||||
|
||||
// 排行榜
|
||||
List<DashboardRetryLineResponseDO.Rank> rankList = retrySummaryMapper.dashboardRank(namespaceId, groupNames, groupName, startDateTime, endDateTime);
|
||||
LambdaQueryWrapper<RetrySummary> wrapper2 = new LambdaQueryWrapper<RetrySummary>()
|
||||
.in(CollUtil.isNotEmpty(groupNames), RetrySummary::getGroupName, groupNames)
|
||||
.eq(StrUtil.isNotBlank(groupName), RetrySummary::getGroupName, groupNames)
|
||||
.eq(RetrySummary::getNamespaceId, namespaceId)
|
||||
.ge(RetrySummary::getTriggerAt, startDateTime)
|
||||
.le(RetrySummary::getTriggerAt, endDateTime)
|
||||
.groupBy(RetrySummary::getNamespaceId, RetrySummary::getGroupName, RetrySummary::getSceneName);
|
||||
List<DashboardRetryLineResponseDO.Rank> rankList = retrySummaryMapper.dashboardRank(wrapper2);
|
||||
List<DashboardRetryLineResponseVO.Rank> ranks = SceneQuantityRankResponseVOConverter.INSTANCE.toDashboardRetryLineResponseVORank(rankList);
|
||||
dashboardRetryLineResponseVO.setRankList(ranks);
|
||||
return dashboardRetryLineResponseVO;
|
||||
@ -171,7 +203,10 @@ public class DashBoardServiceImpl implements DashBoardService {
|
||||
}
|
||||
// 任务类型
|
||||
Integer systemTaskType = SystemModeEnum.JOB.name().equals(mode) ? SyetemTaskTypeEnum.JOB.getType() : SyetemTaskTypeEnum.WORKFLOW.getType();
|
||||
IPage<DashboardRetryLineResponseDO.Task> IPage = jobSummaryMapper.jobTaskList(namespaceId, groupNames, pager);
|
||||
LambdaQueryWrapper<Job> wrapper1 = new LambdaQueryWrapper<Job>()
|
||||
.eq(Job::getNamespaceId, namespaceId)
|
||||
.in(CollUtil.isNotEmpty(groupNames), Job::getGroupName, groupNames);
|
||||
IPage<DashboardRetryLineResponseDO.Task> IPage = jobSummaryMapper.jobTaskList(wrapper1, pager);
|
||||
List<DashboardRetryLineResponseVO.Task> taskList = JobSummaryResponseVOConverter.INSTANCE.toDashboardRetryLineResponseVO(IPage.getRecords());
|
||||
PageResult<List<DashboardRetryLineResponseVO.Task>> pageResult = new PageResult<>(new PageDTO(IPage.getCurrent(), IPage.getSize(), IPage.getTotal()), taskList);
|
||||
dashboardRetryLineResponseVO.setTaskList(pageResult);
|
||||
@ -180,14 +215,27 @@ public class DashBoardServiceImpl implements DashBoardService {
|
||||
DateTypeEnum dateTypeEnum = DateTypeEnum.valueOf(type);
|
||||
LocalDateTime startDateTime = dateTypeEnum.getStartTime().apply(StrUtil.isNotBlank(startTime) ? LocalDateTime.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) : null);
|
||||
LocalDateTime endDateTime = dateTypeEnum.getEndTime().apply(StrUtil.isNotBlank(endTime) ? LocalDateTime.parse(endTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) : null);
|
||||
List<DashboardLineResponseDO> dashboardLineResponseDOList = jobSummaryMapper.jobLineList(systemTaskType, namespaceId, groupNames, groupName, DashboardLineEnum.modeOf(type).getDateFormat(), startDateTime, endDateTime);
|
||||
LambdaQueryWrapper<JobSummary> queryWrapper = new LambdaQueryWrapper<JobSummary>()
|
||||
.in(CollUtil.isNotEmpty(groupNames), JobSummary::getGroupName, groupNames)
|
||||
.eq(StrUtil.isNotBlank(groupName), JobSummary::getGroupName, groupName)
|
||||
.eq(JobSummary::getSystemTaskType, systemTaskType)
|
||||
.eq(JobSummary::getNamespaceId, namespaceId)
|
||||
.between(JobSummary::getTriggerAt, startDateTime, endDateTime);
|
||||
List<DashboardLineResponseDO> dashboardLineResponseDOList = jobSummaryMapper.jobLineList(queryWrapper);
|
||||
List<DashboardLineResponseVO> dashboardLineResponseVOList = DispatchQuantityResponseVOConverter.INSTANCE.toDashboardLineResponseVO(dashboardLineResponseDOList);
|
||||
dateTypeEnum.getConsumer().accept(dashboardLineResponseVOList);
|
||||
dashboardLineResponseVOList.sort(Comparator.comparing(a -> a.getCreateDt()));
|
||||
dashboardRetryLineResponseVO.setDashboardLineResponseDOList(dashboardLineResponseVOList);
|
||||
|
||||
// 排行榜
|
||||
List<DashboardRetryLineResponseDO.Rank> rankList = jobSummaryMapper.dashboardRank(systemTaskType, namespaceId, groupNames, groupName, startDateTime, endDateTime);
|
||||
LambdaQueryWrapper<JobSummary> wrapper = new LambdaQueryWrapper<JobSummary>()
|
||||
.in(CollUtil.isNotEmpty(groupNames), JobSummary::getGroupName, groupNames)
|
||||
.eq(StrUtil.isNotBlank(groupName), JobSummary::getGroupName, groupName)
|
||||
.ge(JobSummary::getTriggerAt, startDateTime).le(JobSummary::getTriggerAt, endDateTime)
|
||||
.eq(JobSummary::getSystemTaskType, systemTaskType)
|
||||
.eq(JobSummary::getNamespaceId, namespaceId)
|
||||
.groupBy(JobSummary::getNamespaceId, JobSummary::getGroupName, JobSummary::getBusinessId);
|
||||
List<DashboardRetryLineResponseDO.Rank> rankList = jobSummaryMapper.dashboardRank(wrapper);
|
||||
List<DashboardRetryLineResponseVO.Rank> ranks = SceneQuantityRankResponseVOConverter.INSTANCE.toDashboardRetryLineResponseVORank(rankList);
|
||||
dashboardRetryLineResponseVO.setRankList(ranks);
|
||||
return dashboardRetryLineResponseVO;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.aizuda.easy.retry.server.web.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.aizuda.easy.retry.client.model.ExecuteResult;
|
||||
@ -42,6 +43,7 @@ import com.aizuda.easy.retry.template.datasource.persistence.po.JobTask;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobTaskBatch;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.WorkflowNode;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -87,17 +89,25 @@ public class JobBatchServiceImpl implements JobBatchService {
|
||||
}
|
||||
}
|
||||
|
||||
JobBatchQueryDO jobBatchQueryDO = new JobBatchQueryDO();
|
||||
JobBatchQueryDO queryDO = new JobBatchQueryDO();
|
||||
if (StrUtil.isNotBlank(queryVO.getJobName())) {
|
||||
jobBatchQueryDO.setJobName(queryVO.getJobName() + "%");
|
||||
queryDO.setJobName(queryVO.getJobName() + "%");
|
||||
}
|
||||
|
||||
jobBatchQueryDO.setJobId(queryVO.getJobId());
|
||||
jobBatchQueryDO.setTaskBatchStatus(queryVO.getTaskBatchStatus());
|
||||
jobBatchQueryDO.setGroupNames(groupNames);
|
||||
jobBatchQueryDO.setNamespaceId(userSessionVO.getNamespaceId());
|
||||
List<JobBatchResponseDO> batchResponseDOList = jobTaskBatchMapper.selectJobBatchPageList(pageDTO,
|
||||
jobBatchQueryDO);
|
||||
queryDO.setJobId(queryVO.getJobId());
|
||||
queryDO.setTaskBatchStatus(queryVO.getTaskBatchStatus());
|
||||
queryDO.setGroupNames(groupNames);
|
||||
queryDO.setNamespaceId(userSessionVO.getNamespaceId());
|
||||
QueryWrapper<JobTaskBatch> wrapper = new QueryWrapper<JobTaskBatch>()
|
||||
.eq("a.namespace_id", queryDO.getNamespaceId())
|
||||
.eq("a.system_task_type", 3)
|
||||
.eq(queryDO.getJobId() != null, "a.job_id", queryDO.getJobId())
|
||||
.in(CollUtil.isNotEmpty(queryDO.getGroupNames()), "a.group_name", queryDO.getGroupNames())
|
||||
.eq(queryDO.getTaskBatchStatus() != null, "task_batch_status", queryDO.getTaskBatchStatus())
|
||||
.eq(StrUtil.isNotBlank(queryDO.getJobName()), "job_name", queryDO.getJobName())
|
||||
.eq("a.deleted", 0)
|
||||
.orderByDesc("a.id");
|
||||
List<JobBatchResponseDO> batchResponseDOList = jobTaskBatchMapper.selectJobBatchPageList(pageDTO, wrapper);
|
||||
|
||||
List<JobBatchResponseVO> batchResponseVOList = JobBatchResponseVOConverter.INSTANCE.toJobBatchResponseVOs(
|
||||
batchResponseDOList);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.aizuda.easy.retry.server.web.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.aizuda.easy.retry.common.core.util.JsonUtil;
|
||||
@ -13,14 +14,12 @@ import com.aizuda.easy.retry.server.web.service.JobNotifyConfigService;
|
||||
import com.aizuda.easy.retry.server.web.service.convert.JobNotifyConfigConverter;
|
||||
import com.aizuda.easy.retry.server.web.service.convert.JobNotifyConfigResponseVOConverter;
|
||||
import com.aizuda.easy.retry.server.web.util.UserSessionUtils;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchQueryDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobNotifyConfigQueryDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobNotifyConfigResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobNotifyConfigMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.Job;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobNotifyConfig;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -46,8 +45,8 @@ public class JobNotifyConfigServiceImpl implements JobNotifyConfigService {
|
||||
public PageResult<List<JobNotifyConfigResponseVO>> getJobNotifyConfigList(JobNotifyConfigQueryVO queryVO) {
|
||||
PageDTO<JobNotifyConfig> pageDTO = new PageDTO<>();
|
||||
UserSessionVO userSessionVO = UserSessionUtils.currentUserSession();
|
||||
JobNotifyConfigQueryDO jobNotifyConfigQueryDO = new JobNotifyConfigQueryDO();
|
||||
jobNotifyConfigQueryDO.setNamespaceId(userSessionVO.getNamespaceId());
|
||||
JobNotifyConfigQueryDO queryDO = new JobNotifyConfigQueryDO();
|
||||
queryDO.setNamespaceId(userSessionVO.getNamespaceId());
|
||||
|
||||
List<String> groupNames = Lists.newArrayList();
|
||||
if (userSessionVO.isUser()) {
|
||||
@ -63,11 +62,16 @@ public class JobNotifyConfigServiceImpl implements JobNotifyConfigService {
|
||||
}
|
||||
}
|
||||
|
||||
jobNotifyConfigQueryDO.setGroupNames(groupNames);
|
||||
queryDO.setGroupNames(groupNames);
|
||||
if (Objects.nonNull(queryVO.getJobId())) {
|
||||
jobNotifyConfigQueryDO.setJobId(queryVO.getJobId());
|
||||
queryDO.setJobId(queryVO.getJobId());
|
||||
}
|
||||
List<JobNotifyConfigResponseDO> batchResponseDOList = jobNotifyConfigMapper.selectJobNotifyConfigList(pageDTO, jobNotifyConfigQueryDO);
|
||||
QueryWrapper<JobNotifyConfig> queryWrapper = new QueryWrapper<JobNotifyConfig>()
|
||||
.eq("a.namespace_id", queryDO.getNamespaceId())
|
||||
.eq(queryDO.getJobId() != null, "a.job_id", queryDO.getJobId())
|
||||
.in(CollUtil.isNotEmpty(queryDO.getGroupNames()), "a.group_name", queryDO.getGroupNames())
|
||||
.orderByDesc("a.id");
|
||||
List<JobNotifyConfigResponseDO> batchResponseDOList = jobNotifyConfigMapper.selectJobNotifyConfigList(pageDTO, queryWrapper);
|
||||
return new PageResult<>(pageDTO, JobNotifyConfigResponseVOConverter.INSTANCE.batchConvert(batchResponseDOList));
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user