feat: snail-job_1.0.0 oracle 迁移
This commit is contained in:
parent
6bf992651d
commit
5180fc9333
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- 定义批量新增的 SQL 映射 -->
|
<!-- 定义批量新增的 SQL 映射 -->
|
||||||
<insert id="batchInsert" parameterType="java.util.List">
|
<insert id="batchInsert" parameterType="java.util.List">
|
||||||
INSERT INTO job_log_message (namespace_id, group_name, job_id, task_batch_id, task_id,
|
INSERT INTO sj_job_log_message (namespace_id, group_name, job_id, task_batch_id, task_id,
|
||||||
log_num, message, create_dt, real_time)
|
log_num, message, create_dt, real_time)
|
||||||
<foreach collection="list" item="item" separator="UNION ALL">
|
<foreach collection="list" item="item" separator="UNION ALL">
|
||||||
SELECT
|
SELECT
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<update id="updateBatchNextTriggerAtById" parameterType="java.util.List">
|
<update id="updateBatchNextTriggerAtById" parameterType="java.util.List">
|
||||||
<foreach collection="list" item="item" open="BEGIN" separator=";" close=";END;">
|
<foreach collection="list" item="item" open="BEGIN" separator=";" close=";END;">
|
||||||
UPDATE job
|
UPDATE sj_job
|
||||||
SET next_trigger_at = #{item.nextTriggerAt}
|
SET next_trigger_at = #{item.nextTriggerAt}
|
||||||
WHERE id = #{item.id}
|
WHERE id = #{item.id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
|
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
|
||||||
INSERT INTO job_summary (namespace_id, group_name, business_id, trigger_at, system_task_type,
|
INSERT INTO sj_job_summary (namespace_id, group_name, business_id, trigger_at, system_task_type,
|
||||||
success_num,fail_num,fail_reason,stop_num,stop_reason, cancel_num,cancel_reason)
|
success_num,fail_num,fail_reason,stop_num,stop_reason, cancel_num,cancel_reason)
|
||||||
<foreach collection="list" item="item" separator="UNION ALL">
|
<foreach collection="list" item="item" separator="UNION ALL">
|
||||||
SELECT
|
SELECT
|
||||||
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
<update id="batchUpdate" parameterType="java.util.List">
|
<update id="batchUpdate" parameterType="java.util.List">
|
||||||
<foreach collection="list" item="item" index="index" open="BEGIN" separator=";" close=";END;">
|
<foreach collection="list" item="item" index="index" open="BEGIN" separator=";" close=";END;">
|
||||||
UPDATE job_summary
|
UPDATE sj_job_summary
|
||||||
SET success_num = #{item.successNum},
|
SET success_num = #{item.successNum},
|
||||||
fail_num = #{item.failNum},
|
fail_num = #{item.failNum},
|
||||||
fail_reason = #{item.failReason},
|
fail_reason = #{item.failReason},
|
||||||
@ -72,7 +72,7 @@
|
|||||||
fail_num,
|
fail_num,
|
||||||
stop_num,
|
stop_num,
|
||||||
cancel_num
|
cancel_num
|
||||||
FROM job_summary
|
FROM sj_job_summary
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
)
|
)
|
||||||
GROUP BY createDt
|
GROUP BY createDt
|
||||||
@ -85,7 +85,7 @@
|
|||||||
COALESCE(sum(cancel_num), 0) AS cancelNum,
|
COALESCE(sum(cancel_num), 0) AS cancelNum,
|
||||||
COALESCE(sum(fail_num), 0) AS failNum,
|
COALESCE(sum(fail_num), 0) AS failNum,
|
||||||
COALESCE(sum(success_num + fail_num + stop_num + cancel_num), 0) AS totalNum
|
COALESCE(sum(success_num + fail_num + stop_num + cancel_num), 0) AS totalNum
|
||||||
FROM job_summary
|
FROM sj_job_summary
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -94,13 +94,13 @@
|
|||||||
SELECT * FROM (
|
SELECT * FROM (
|
||||||
SELECT
|
SELECT
|
||||||
<if test="systemTaskType == 3">
|
<if test="systemTaskType == 3">
|
||||||
group_name || '/' || (SELECT job_name FROM job WHERE id = business_id) AS name,
|
group_name || '/' || (SELECT job_name FROM sj_job WHERE id = business_id) AS name,
|
||||||
</if>
|
</if>
|
||||||
<if test="systemTaskType == 4">
|
<if test="systemTaskType == 4">
|
||||||
group_name || '/' || (SELECT workflow_name FROM workflow WHERE id = business_id) AS name,
|
group_name || '/' || (SELECT workflow_name FROM sj_workflow WHERE id = business_id) AS name,
|
||||||
</if>
|
</if>
|
||||||
SUM(fail_num) AS total
|
SUM(fail_num) AS total
|
||||||
FROM job_summary
|
FROM sj_job_summary
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
HAVING SUM(fail_num) > 0
|
HAVING SUM(fail_num) > 0
|
||||||
ORDER BY total DESC)
|
ORDER BY total DESC)
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<insert id="insertBatch" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
|
<insert id="insertBatch" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
|
||||||
INSERT INTO retry_dead_letter (namespace_id, unique_id, group_name, scene_name,
|
INSERT INTO sj_retry_dead_letter (namespace_id, unique_id, group_name, scene_name,
|
||||||
idempotent_id, biz_no, executor_name, args_str,
|
idempotent_id, biz_no, executor_name, args_str,
|
||||||
ext_attrs, create_dt)
|
ext_attrs, create_dt)
|
||||||
<foreach collection="retryDeadLetters" item="retryDeadLetter" separator="UNION ALL">
|
<foreach collection="retryDeadLetters" item="retryDeadLetter" separator="UNION ALL">
|
||||||
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
<select id="countRetryDeadLetterByCreateAt" resultType="int">
|
<select id="countRetryDeadLetterByCreateAt" resultType="int">
|
||||||
SELECT COUNT(*)
|
SELECT COUNT(*)
|
||||||
FROM retry_dead_letter_${partition}
|
FROM sj_retry_dead_letter_${partition}
|
||||||
WHERE create_dt BETWEEN #{startTime} AND #{endTime}
|
WHERE create_dt BETWEEN #{startTime} AND #{endTime}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
|
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
|
||||||
INSERT INTO retry_summary (namespace_id, group_name, scene_name, trigger_at,
|
INSERT INTO sj_retry_summary (namespace_id, group_name, scene_name, trigger_at,
|
||||||
running_num, finish_num, max_count_num, suspend_num)
|
running_num, finish_num, max_count_num, suspend_num)
|
||||||
<foreach collection="list" item="item" separator="UNION ALL">
|
<foreach collection="list" item="item" separator="UNION ALL">
|
||||||
SELECT
|
SELECT
|
||||||
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
<update id="batchUpdate" parameterType="java.util.List">
|
<update id="batchUpdate" parameterType="java.util.List">
|
||||||
<foreach collection="list" item="item" index="index" open="BEGIN" separator=";" close=";END;">
|
<foreach collection="list" item="item" index="index" open="BEGIN" separator=";" close=";END;">
|
||||||
UPDATE retry_summary
|
UPDATE sj_retry_summary
|
||||||
SET running_num = #{item.runningNum},
|
SET running_num = #{item.runningNum},
|
||||||
finish_num = #{item.finishNum},
|
finish_num = #{item.finishNum},
|
||||||
max_count_num = #{item.maxCountNum},
|
max_count_num = #{item.maxCountNum},
|
||||||
@ -53,7 +53,7 @@
|
|||||||
COALESCE(sum(max_count_num), 0) AS maxCountNum,
|
COALESCE(sum(max_count_num), 0) AS maxCountNum,
|
||||||
COALESCE(sum(suspend_num), 0) AS suspendNum,
|
COALESCE(sum(suspend_num), 0) AS suspendNum,
|
||||||
COALESCE(sum(running_num + finish_num + max_count_num + suspend_num), 0) AS totalNum
|
COALESCE(sum(running_num + finish_num + max_count_num + suspend_num), 0) AS totalNum
|
||||||
FROM retry_summary
|
FROM sj_retry_summary
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -63,7 +63,7 @@
|
|||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT trigger_at, running_num, finish_num, max_count_num, suspend_num
|
SELECT trigger_at, running_num, finish_num, max_count_num, suspend_num
|
||||||
FROM retry_summary
|
FROM sj_retry_summary
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
)
|
)
|
||||||
WHERE ROWNUM <![CDATA[ <= ]]> 7
|
WHERE ROWNUM <![CDATA[ <= ]]> 7
|
||||||
@ -84,7 +84,7 @@
|
|||||||
running_num,
|
running_num,
|
||||||
max_count_num,
|
max_count_num,
|
||||||
suspend_num
|
suspend_num
|
||||||
FROM retry_summary
|
FROM sj_retry_summary
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
)
|
)
|
||||||
GROUP BY createDt
|
GROUP BY createDt
|
||||||
@ -98,7 +98,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
group_name || '/' || scene_name AS name,
|
group_name || '/' || scene_name AS name,
|
||||||
SUM(running_num + finish_num + max_count_num + suspend_num) AS total
|
SUM(running_num + finish_num + max_count_num + suspend_num) AS total
|
||||||
FROM retry_summary
|
FROM sj_retry_summary
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
HAVING SUM(running_num + finish_num + max_count_num + suspend_num) > 0
|
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)
|
ORDER BY SUM(running_num + finish_num + max_count_num + suspend_num) DESC)
|
||||||
@ -110,7 +110,7 @@
|
|||||||
SELECT group_name AS groupName,
|
SELECT group_name AS groupName,
|
||||||
SUM(CASE WHEN (scene_status = 1) THEN 1 ELSE 0 END) AS run,
|
SUM(CASE WHEN (scene_status = 1) THEN 1 ELSE 0 END) AS run,
|
||||||
COUNT(*) AS total
|
COUNT(*) AS total
|
||||||
FROM scene_config
|
FROM sj_retry_scene_config
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
GROUP BY namespace_id, group_name
|
GROUP BY namespace_id, group_name
|
||||||
</select>
|
</select>
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
<!-- 定义批量新增的 SQL 映射 -->
|
<!-- 定义批量新增的 SQL 映射 -->
|
||||||
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
|
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
|
||||||
INSERT INTO retry_task_log (unique_id, group_name, scene_name, idempotent_id, biz_no, executor_name,
|
INSERT INTO sj_retry_task_log (unique_id, group_name, scene_name, idempotent_id, biz_no, executor_name,
|
||||||
args_str, ext_attrs, task_type, create_dt, namespace_id)
|
args_str, ext_attrs, task_type, create_dt, namespace_id)
|
||||||
<foreach collection="list" item="item" separator="UNION ALL">
|
<foreach collection="list" item="item" separator="UNION ALL">
|
||||||
SELECT
|
SELECT
|
||||||
@ -45,7 +45,7 @@
|
|||||||
SUM(CASE WHEN (retry_status = 1) THEN 1 ELSE 0 END) AS finishNum,
|
SUM(CASE WHEN (retry_status = 1) THEN 1 ELSE 0 END) AS finishNum,
|
||||||
SUM(CASE WHEN (retry_status = 2) THEN 1 ELSE 0 END) AS maxCountNum,
|
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
|
SUM(CASE WHEN (retry_status = 3) THEN 1 ELSE 0 END) AS suspendNum
|
||||||
FROM retry_task_log
|
FROM sj_retry_task_log
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="batchInsert" parameterType="java.util.List">
|
<insert id="batchInsert" parameterType="java.util.List">
|
||||||
INSERT INTO retry_task_log_message (namespace_id, group_name, unique_id, log_num, message,
|
INSERT INTO sj_retry_task_log_message (namespace_id, group_name, unique_id, log_num, message,
|
||||||
create_dt, real_time)
|
create_dt, real_time)
|
||||||
<foreach collection="list" item="item" separator="UNION ALL">
|
<foreach collection="list" item="item" separator="UNION ALL">
|
||||||
SELECT
|
SELECT
|
||||||
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
<update id="batchUpdate" parameterType="java.util.List">
|
<update id="batchUpdate" parameterType="java.util.List">
|
||||||
<foreach collection="list" item="item" index="index" open="BEGIN" separator=";" close=";END;">
|
<foreach collection="list" item="item" index="index" open="BEGIN" separator=";" close=";END;">
|
||||||
UPDATE retry_task_log_message
|
UPDATE sj_retry_task_log_message
|
||||||
SET message = #{item.message}, log_num = #{item.logNum}
|
SET message = #{item.message}, log_num = #{item.logNum}
|
||||||
WHERE id = #{item.id}
|
WHERE id = #{item.id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
<!-- 定义批量新增的 SQL 映射 -->
|
<!-- 定义批量新增的 SQL 映射 -->
|
||||||
<insert id="batchInsert" parameterType="java.util.List">
|
<insert id="batchInsert" parameterType="java.util.List">
|
||||||
INSERT INTO retry_task (namespace_id, unique_id, group_name, scene_name, idempotent_id, biz_no,
|
INSERT INTO sj_retry_task (namespace_id, unique_id, group_name, scene_name, idempotent_id, biz_no,
|
||||||
executor_name, args_str, ext_attrs, next_trigger_at, task_type, retry_status, create_dt)
|
executor_name, args_str, ext_attrs, next_trigger_at, task_type, retry_status, create_dt)
|
||||||
<foreach collection="list" item="item" separator="UNION ALL">
|
<foreach collection="list" item="item" separator="UNION ALL">
|
||||||
SELECT
|
SELECT
|
||||||
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
<update id="updateBatchNextTriggerAtById" parameterType="java.util.List">
|
<update id="updateBatchNextTriggerAtById" parameterType="java.util.List">
|
||||||
<foreach collection="list" item="item" index="index" open="BEGIN" separator=";" close=";END;">
|
<foreach collection="list" item="item" index="index" open="BEGIN" separator=";" close=";END;">
|
||||||
UPDATE retry_task_${partition}
|
UPDATE sj_retry_task_${partition}
|
||||||
SET next_trigger_at = #{item.nextTriggerAt}
|
SET next_trigger_at = #{item.nextTriggerAt}
|
||||||
WHERE id = #{item.id}
|
WHERE id = #{item.id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
|
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
|
||||||
<!-- useGeneratedKeys="false" 否则报错ORA-00933: SQL command not properly ended -->
|
<!-- useGeneratedKeys="false" 否则报错ORA-00933: SQL command not properly ended -->
|
||||||
INSERT INTO server_node (namespace_id, group_name, host_id, host_ip, host_port,
|
INSERT INTO sj_server_node (namespace_id, group_name, host_id, host_ip, host_port,
|
||||||
expire_at, node_type, ext_attrs, create_dt)
|
expire_at, node_type, ext_attrs, create_dt)
|
||||||
<foreach collection="records" item="item" index="index" separator="UNION ALL">
|
<foreach collection="records" item="item" index="index" separator="UNION ALL">
|
||||||
SELECT
|
SELECT
|
||||||
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
<update id="batchUpdateExpireAt" parameterType="java.util.List">
|
<update id="batchUpdateExpireAt" parameterType="java.util.List">
|
||||||
<foreach collection="list" item="item" open="BEGIN" separator=";" close=";END;">
|
<foreach collection="list" item="item" open="BEGIN" separator=";" close=";END;">
|
||||||
UPDATE server_node
|
UPDATE sj_server_node
|
||||||
SET expire_at = #{item.expireAt}
|
SET expire_at = #{item.expireAt}
|
||||||
WHERE host_id = #{item.hostId}
|
WHERE host_id = #{item.hostId}
|
||||||
AND host_ip = #{item.hostIp}
|
AND host_ip = #{item.hostIp}
|
||||||
@ -51,7 +51,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
node_type AS nodeType,
|
node_type AS nodeType,
|
||||||
COUNT(*) AS total
|
COUNT(*) AS total
|
||||||
FROM server_node
|
FROM sj_server_node
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<update id="updateBatchNextTriggerAtById" parameterType="java.util.List">
|
<update id="updateBatchNextTriggerAtById" parameterType="java.util.List">
|
||||||
<foreach collection="list" item="item" open="BEGIN" separator=";" close=";END;">
|
<foreach collection="list" item="item" open="BEGIN" separator=";" close=";END;">
|
||||||
UPDATE workflow
|
UPDATE sj_workflow
|
||||||
SET next_trigger_at = #{item.nextTriggerAt}
|
SET next_trigger_at = #{item.nextTriggerAt}
|
||||||
WHERE id = #{item.id}
|
WHERE id = #{item.id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
Loading…
Reference in New Issue
Block a user