gtsoft-snail-job-server/easy-retry-server/src/main/resources/mapper/RetryDeadLetterMapper.xml

42 lines
2.3 KiB
XML
Raw Normal View History

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">
<mapper namespace="com.aizuda.easy.retry.server.persistence.mybatis.mapper.RetryDeadLetterMapper">
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.server.persistence.mybatis.po.RetryDeadLetter">
2023-01-14 21:02:18 +08:00
<id column="id" jdbcType="BIGINT" property="id" />
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
<result column="scene_name" jdbcType="VARCHAR" property="sceneName" />
<result column="idempotent_id" jdbcType="VARCHAR" property="idempotentId" />
2023-01-14 21:02:18 +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="create_dt" jdbcType="TIMESTAMP" property="createDt" />
</resultMap>
<sql id="Base_Column_List">
id, group_name, scene_name, idempotent_id, biz_no, executor_name, args_str, ext_attrs, create_dt
2023-01-14 21:02:18 +08:00
</sql>
<insert id="insertBatch">
insert into retry_dead_letter_${partition} (id, group_name, scene_name,
idempotent_id, biz_no, executor_name, args_str,
2023-01-14 21:02:18 +08:00
ext_attrs, create_dt
)
values
<foreach collection="retryDeadLetters" item="retryDeadLetter" separator=",">
(#{retryDeadLetter.id,jdbcType=BIGINT}, #{retryDeadLetter.groupName,jdbcType=VARCHAR}, #{retryDeadLetter.sceneName,jdbcType=VARCHAR},
#{retryDeadLetter.idempotentId,jdbcType=VARCHAR}, #{retryDeadLetter.bizNo,jdbcType=VARCHAR}, #{retryDeadLetter.executorName,jdbcType=VARCHAR}, #{retryDeadLetter.argsStr,jdbcType=VARCHAR},
2023-01-14 21:02:18 +08:00
#{retryDeadLetter.extAttrs,jdbcType=VARCHAR}, #{retryDeadLetter.createDt,jdbcType=TIMESTAMP})
</foreach>
</insert>
<select id="countRetryDeadLetterByCreateAt" resultType="int">
select
count(*)
from retry_dead_letter_${partition} where create_dt>= #{startTime} and create_dt &lt;=#{endTime}
</select>
<select id="searchAllByPage" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from retry_dead_letter_${partition};
</select>
</mapper>