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 映射 -->
|
||||
<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)
|
||||
<foreach collection="list" item="item" separator="UNION ALL">
|
||||
SELECT
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
<update id="updateBatchNextTriggerAtById" parameterType="java.util.List">
|
||||
<foreach collection="list" item="item" open="BEGIN" separator=";" close=";END;">
|
||||
UPDATE job
|
||||
UPDATE sj_job
|
||||
SET next_trigger_at = #{item.nextTriggerAt}
|
||||
WHERE id = #{item.id}
|
||||
</foreach>
|
||||
|
@ -20,7 +20,7 @@
|
||||
</resultMap>
|
||||
|
||||
<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)
|
||||
<foreach collection="list" item="item" separator="UNION ALL">
|
||||
SELECT
|
||||
@ -42,7 +42,7 @@
|
||||
|
||||
<update id="batchUpdate" parameterType="java.util.List">
|
||||
<foreach collection="list" item="item" index="index" open="BEGIN" separator=";" close=";END;">
|
||||
UPDATE job_summary
|
||||
UPDATE sj_job_summary
|
||||
SET success_num = #{item.successNum},
|
||||
fail_num = #{item.failNum},
|
||||
fail_reason = #{item.failReason},
|
||||
@ -72,7 +72,7 @@
|
||||
fail_num,
|
||||
stop_num,
|
||||
cancel_num
|
||||
FROM job_summary
|
||||
FROM sj_job_summary
|
||||
${ew.customSqlSegment}
|
||||
)
|
||||
GROUP BY createDt
|
||||
@ -85,7 +85,7 @@
|
||||
COALESCE(sum(cancel_num), 0) AS cancelNum,
|
||||
COALESCE(sum(fail_num), 0) AS failNum,
|
||||
COALESCE(sum(success_num + fail_num + stop_num + cancel_num), 0) AS totalNum
|
||||
FROM job_summary
|
||||
FROM sj_job_summary
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
@ -94,13 +94,13 @@
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
<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 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>
|
||||
SUM(fail_num) AS total
|
||||
FROM job_summary
|
||||
FROM sj_job_summary
|
||||
${ew.customSqlSegment}
|
||||
HAVING SUM(fail_num) > 0
|
||||
ORDER BY total DESC)
|
||||
|
@ -22,7 +22,7 @@
|
||||
</sql>
|
||||
|
||||
<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,
|
||||
ext_attrs, create_dt)
|
||||
<foreach collection="retryDeadLetters" item="retryDeadLetter" separator="UNION ALL">
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
<select id="countRetryDeadLetterByCreateAt" resultType="int">
|
||||
SELECT COUNT(*)
|
||||
FROM retry_dead_letter_${partition}
|
||||
FROM sj_retry_dead_letter_${partition}
|
||||
WHERE create_dt BETWEEN #{startTime} AND #{endTime}
|
||||
</select>
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
</resultMap>
|
||||
|
||||
<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)
|
||||
<foreach collection="list" item="item" separator="UNION ALL">
|
||||
SELECT
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
<update id="batchUpdate" parameterType="java.util.List">
|
||||
<foreach collection="list" item="item" index="index" open="BEGIN" separator=";" close=";END;">
|
||||
UPDATE retry_summary
|
||||
UPDATE sj_retry_summary
|
||||
SET running_num = #{item.runningNum},
|
||||
finish_num = #{item.finishNum},
|
||||
max_count_num = #{item.maxCountNum},
|
||||
@ -53,7 +53,7 @@
|
||||
COALESCE(sum(max_count_num), 0) AS maxCountNum,
|
||||
COALESCE(sum(suspend_num), 0) AS suspendNum,
|
||||
COALESCE(sum(running_num + finish_num + max_count_num + suspend_num), 0) AS totalNum
|
||||
FROM retry_summary
|
||||
FROM sj_retry_summary
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
@ -63,7 +63,7 @@
|
||||
FROM
|
||||
(
|
||||
SELECT trigger_at, running_num, finish_num, max_count_num, suspend_num
|
||||
FROM retry_summary
|
||||
FROM sj_retry_summary
|
||||
${ew.customSqlSegment}
|
||||
)
|
||||
WHERE ROWNUM <![CDATA[ <= ]]> 7
|
||||
@ -84,7 +84,7 @@
|
||||
running_num,
|
||||
max_count_num,
|
||||
suspend_num
|
||||
FROM retry_summary
|
||||
FROM sj_retry_summary
|
||||
${ew.customSqlSegment}
|
||||
)
|
||||
GROUP BY createDt
|
||||
@ -98,7 +98,7 @@
|
||||
SELECT
|
||||
group_name || '/' || scene_name AS name,
|
||||
SUM(running_num + finish_num + max_count_num + suspend_num) AS total
|
||||
FROM retry_summary
|
||||
FROM sj_retry_summary
|
||||
${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)
|
||||
@ -110,7 +110,7 @@
|
||||
SELECT group_name AS groupName,
|
||||
SUM(CASE WHEN (scene_status = 1) THEN 1 ELSE 0 END) AS run,
|
||||
COUNT(*) AS total
|
||||
FROM scene_config
|
||||
FROM sj_retry_scene_config
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY namespace_id, group_name
|
||||
</select>
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
<!-- 定义批量新增的 SQL 映射 -->
|
||||
<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)
|
||||
<foreach collection="list" item="item" separator="UNION ALL">
|
||||
SELECT
|
||||
@ -45,7 +45,7 @@
|
||||
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 = 3) THEN 1 ELSE 0 END) AS suspendNum
|
||||
FROM retry_task_log
|
||||
FROM sj_retry_task_log
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -12,7 +12,7 @@
|
||||
</resultMap>
|
||||
|
||||
<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)
|
||||
<foreach collection="list" item="item" separator="UNION ALL">
|
||||
SELECT
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
<update id="batchUpdate" parameterType="java.util.List">
|
||||
<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}
|
||||
WHERE id = #{item.id}
|
||||
</foreach>
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
<!-- 定义批量新增的 SQL 映射 -->
|
||||
<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)
|
||||
<foreach collection="list" item="item" separator="UNION ALL">
|
||||
SELECT
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
<update id="updateBatchNextTriggerAtById" parameterType="java.util.List">
|
||||
<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}
|
||||
WHERE id = #{item.id}
|
||||
</foreach>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="false" keyProperty="id">
|
||||
<!-- 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)
|
||||
<foreach collection="records" item="item" index="index" separator="UNION ALL">
|
||||
SELECT
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
<update id="batchUpdateExpireAt" parameterType="java.util.List">
|
||||
<foreach collection="list" item="item" open="BEGIN" separator=";" close=";END;">
|
||||
UPDATE server_node
|
||||
UPDATE sj_server_node
|
||||
SET expire_at = #{item.expireAt}
|
||||
WHERE host_id = #{item.hostId}
|
||||
AND host_ip = #{item.hostIp}
|
||||
@ -51,7 +51,7 @@
|
||||
SELECT
|
||||
node_type AS nodeType,
|
||||
COUNT(*) AS total
|
||||
FROM server_node
|
||||
FROM sj_server_node
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
<update id="updateBatchNextTriggerAtById" parameterType="java.util.List">
|
||||
<foreach collection="list" item="item" open="BEGIN" separator=";" close=";END;">
|
||||
UPDATE workflow
|
||||
UPDATE sj_workflow
|
||||
SET next_trigger_at = #{item.nextTriggerAt}
|
||||
WHERE id = #{item.id}
|
||||
</foreach>
|
||||
|
Loading…
Reference in New Issue
Block a user