2023-01-14 21:02:18 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
2023-04-18 23:03:33 +08:00
|
|
|
<mapper namespace="com.aizuda.easy.retry.server.persistence.mybatis.mapper.RetryTaskLogMapper">
|
|
|
|
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.server.persistence.mybatis.po.RetryTaskLog">
|
2023-01-14 20:46:02 +08:00
|
|
|
<id column="id" jdbcType="BIGINT" property="id"/>
|
2023-05-05 16:23:21 +08:00
|
|
|
<result column="unique_id" jdbcType="VARCHAR" property="uniqueId"/>
|
2023-01-14 20:46:02 +08:00
|
|
|
<result column="group_name" jdbcType="VARCHAR" property="groupName"/>
|
|
|
|
<result column="scene_name" jdbcType="VARCHAR" property="sceneName"/>
|
2023-05-04 18:46:34 +08:00
|
|
|
<result column="idempotent_id" jdbcType="VARCHAR" property="idempotentId"/>
|
2023-01-14 20:46:02 +08:00
|
|
|
<result column="biz_no" jdbcType="VARCHAR" property="bizNo"/>
|
|
|
|
<result column="executor_name" jdbcType="VARCHAR" property="executorName"/>
|
|
|
|
<result column="args_str" jdbcType="VARCHAR" property="argsStr"/>
|
|
|
|
<result column="ext_attrs" jdbcType="VARCHAR" property="extAttrs"/>
|
|
|
|
<result column="retry_status" jdbcType="TINYINT" property="retryStatus"/>
|
2023-06-04 18:46:09 +08:00
|
|
|
<result column="task_type" jdbcType="TINYINT" property="taskType"/>
|
2023-01-14 20:46:02 +08:00
|
|
|
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt"/>
|
|
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
2023-06-16 17:38:19 +08:00
|
|
|
id
|
|
|
|
, unique_id, group_name, scene_name, idempotent_id, biz_no, executor_name, args_str, ext_attrs, retry_status,
|
2023-06-04 18:46:09 +08:00
|
|
|
create_dt, task_type
|
2023-01-14 20:46:02 +08:00
|
|
|
</sql>
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
|
select
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
from retry_task_log
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
</select>
|
|
|
|
<select id="countTaskTotal" resultType="java.lang.Long">
|
|
|
|
select count(*)
|
2023-06-16 17:38:19 +08:00
|
|
|
from retry_task_log
|
2023-01-14 20:46:02 +08:00
|
|
|
</select>
|
|
|
|
<select id="countTaskByRetryStatus" resultType="java.lang.Long">
|
|
|
|
select count(*)
|
2023-06-16 17:38:19 +08:00
|
|
|
from retry_task_log
|
|
|
|
where retry_status = #{retryStatus}
|
2023-01-14 20:46:02 +08:00
|
|
|
</select>
|
|
|
|
<select id="rankSceneQuantity"
|
2023-06-16 17:38:19 +08:00
|
|
|
resultType="com.aizuda.easy.retry.server.web.model.response.SceneQuantityRankResponseVO">
|
|
|
|
select group_name, scene_name, count(*) as total
|
2023-01-14 20:46:02 +08:00
|
|
|
from retry_task_log
|
|
|
|
<where>
|
|
|
|
<if test="groupName != '' and groupName != null">
|
2023-06-16 17:38:19 +08:00
|
|
|
and group_name = #{groupName}
|
2023-01-14 20:46:02 +08:00
|
|
|
</if>
|
2023-01-14 20:46:11 +08:00
|
|
|
and create_dt >= #{startTime} and create_dt <= #{endTime}
|
2023-01-14 20:46:02 +08:00
|
|
|
</where>
|
|
|
|
group by group_name, scene_name
|
2023-06-16 17:38:19 +08:00
|
|
|
order by total desc
|
|
|
|
|
2023-01-14 20:46:02 +08:00
|
|
|
</select>
|
|
|
|
<select id="lineDispatchQuantity"
|
2023-06-16 17:38:19 +08:00
|
|
|
resultType="com.aizuda.easy.retry.server.web.model.response.DispatchQuantityResponseVO">
|
2023-01-14 20:46:11 +08:00
|
|
|
select
|
|
|
|
<choose>
|
|
|
|
<when test="type == 'day'">
|
|
|
|
DATE_FORMAT(create_dt,'%H')
|
|
|
|
</when>
|
|
|
|
<when test="type == 'week'">
|
|
|
|
DATE_FORMAT(create_dt,'%Y-%m-%d')
|
|
|
|
</when>
|
|
|
|
<when test="type =='month'">
|
|
|
|
DATE_FORMAT(create_dt,'%Y-%m-%d')
|
|
|
|
</when>
|
|
|
|
<when test="type == 'year'">
|
|
|
|
DATE_FORMAT(create_dt,'%Y-%m')
|
|
|
|
</when>
|
|
|
|
<otherwise>
|
|
|
|
DATE_FORMAT(create_dt,'%Y-%m-%d')
|
|
|
|
</otherwise>
|
|
|
|
</choose>
|
2023-06-16 17:38:19 +08:00
|
|
|
as createDt, count(*) as total
|
2023-01-14 20:46:11 +08:00
|
|
|
from retry_task_log
|
|
|
|
<where>
|
|
|
|
<if test="groupName != '' and groupName != null">
|
|
|
|
group_name = #{groupName}
|
|
|
|
</if>
|
|
|
|
<if test="retryStatus!=null ">
|
2023-06-16 17:38:19 +08:00
|
|
|
and retry_status = #{retryStatus}
|
2023-01-14 20:46:11 +08:00
|
|
|
</if>
|
|
|
|
|
|
|
|
and create_dt >= #{startTime} and create_dt <= #{endTime}
|
|
|
|
</where>
|
2023-06-16 17:38:19 +08:00
|
|
|
group by createDt
|
|
|
|
order by total desc
|
|
|
|
|
|
|
|
|
2023-01-14 20:46:02 +08:00
|
|
|
</select>
|
2023-01-14 21:02:18 +08:00
|
|
|
</mapper>
|