feat: snail-job_1.0.0 mariadb 迁移
This commit is contained in:
parent
5180fc9333
commit
f3d04a8786
@ -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)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
|
@ -27,7 +27,7 @@
|
||||
</resultMap>
|
||||
|
||||
<update id="updateBatchNextTriggerAtById" parameterType="java.util.List">
|
||||
UPDATE job rt,
|
||||
UPDATE sj_job rt,
|
||||
(
|
||||
<foreach collection="list" item="item" index="index" separator="UNION ALL">
|
||||
SELECT
|
||||
|
@ -20,7 +20,7 @@
|
||||
</resultMap>
|
||||
|
||||
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" 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)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
@ -42,7 +42,7 @@
|
||||
</insert>
|
||||
|
||||
<update id="batchUpdate" parameterType="java.util.List">
|
||||
UPDATE job_summary rt,
|
||||
UPDATE sj_job_summary rt,
|
||||
(
|
||||
<foreach collection="list" item="item" index="index" separator="UNION ALL">
|
||||
SELECT
|
||||
@ -77,7 +77,7 @@
|
||||
IFNULL(SUM(cancel_num), 0) AS cancel,
|
||||
IFNULL(SUM(fail_num), 0) AS fail,
|
||||
IFNULL(SUM(success_num + fail_num + stop_num + cancel_num), 0) AS total
|
||||
FROM job_summary
|
||||
FROM sj_job_summary
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY DATE_FORMAT(trigger_at, #{dateFormat})
|
||||
</select>
|
||||
@ -90,7 +90,7 @@
|
||||
IFNULL(SUM(cancel_num), 0) AS cancelNum,
|
||||
IFNULL(SUM(fail_num), 0) AS failNum,
|
||||
IFNULL(SUM(success_num + fail_num + stop_num + cancel_num), 0) AS totalNum
|
||||
FROM job_summary
|
||||
FROM sj_job_summary
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
@ -98,13 +98,13 @@
|
||||
resultType="com.aizuda.snailjob.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO$Rank">
|
||||
SELECT
|
||||
<if test="systemTaskType == 3">
|
||||
CONCAT(group_name, '/', (SELECT job_name FROM job WHERE id = business_id)) name,
|
||||
CONCAT(group_name, '/', (SELECT job_name FROM sj_job WHERE id = business_id)) name,
|
||||
</if>
|
||||
<if test="systemTaskType == 4">
|
||||
CONCAT(group_name, '/', (SELECT workflow_name FROM workflow WHERE id = business_id)) name,
|
||||
CONCAT(group_name, '/', (SELECT workflow_name FROM sj_workflow WHERE id = business_id)) name,
|
||||
</if>
|
||||
SUM(fail_num) AS total
|
||||
FROM job_summary
|
||||
FROM sj_job_summary
|
||||
${ew.customSqlSegment}
|
||||
HAVING total > 0
|
||||
ORDER BY total DESC
|
||||
@ -116,7 +116,7 @@
|
||||
SELECT group_name AS groupName,
|
||||
SUM(CASE WHEN (job_status = 1) THEN 1 ELSE 0 END) AS run,
|
||||
COUNT(*) AS total
|
||||
FROM job
|
||||
FROM sj_job
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY namespace_id, group_name
|
||||
</select>
|
||||
|
@ -21,7 +21,7 @@
|
||||
</sql>
|
||||
|
||||
<insert id="insertBatch">
|
||||
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
|
||||
)
|
||||
|
@ -16,9 +16,8 @@
|
||||
</resultMap>
|
||||
|
||||
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO
|
||||
retry_summary (namespace_id, group_name, scene_name, trigger_at, running_num, finish_num, max_count_num,
|
||||
suspend_num)
|
||||
INSERT INTO sj_retry_summary (namespace_id, group_name, scene_name, trigger_at,
|
||||
running_num, finish_num, max_count_num, suspend_num)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
@ -35,7 +34,7 @@
|
||||
</insert>
|
||||
|
||||
<update id="batchUpdate" parameterType="java.util.List">
|
||||
UPDATE retry_summary rt,
|
||||
UPDATE sj_retry_summary rt,
|
||||
(
|
||||
<foreach collection="list" item="item" index="index" separator="UNION ALL">
|
||||
SELECT
|
||||
@ -66,7 +65,7 @@
|
||||
IFNULL(SUM(max_count_num), 0) AS maxCountNum,
|
||||
IFNULL(SUM(suspend_num), 0) AS suspendNum,
|
||||
IFNULL(SUM(running_num + finish_num + max_count_num + suspend_num), 0) AS totalNum
|
||||
FROM retry_summary
|
||||
FROM sj_retry_summary
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
@ -77,7 +76,7 @@
|
||||
finish_num,
|
||||
max_count_num,
|
||||
suspend_num
|
||||
FROM retry_summary
|
||||
FROM sj_retry_summary
|
||||
${ew.customSqlSegment}
|
||||
LIMIT 7
|
||||
</select>
|
||||
@ -91,7 +90,7 @@
|
||||
IFNULL(SUM(max_count_num), 0) AS maxCountNum,
|
||||
IFNULL(SUM(suspend_num), 0) AS suspendNum,
|
||||
IFNULL(SUM(finish_num + running_num + max_count_num + suspend_num), 0) AS total
|
||||
FROM retry_summary
|
||||
FROM sj_retry_summary
|
||||
${ew.customSqlSegment}
|
||||
GROUP BY createDt
|
||||
</select>
|
||||
@ -100,7 +99,7 @@
|
||||
resultType="com.aizuda.snailjob.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
|
||||
FROM sj_retry_summary
|
||||
${ew.customSqlSegment}
|
||||
HAVING total > 0
|
||||
ORDER BY total DESC
|
||||
@ -112,7 +111,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>
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
<!-- 定义批量新增的 SQL 映射 -->
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
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)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
@ -43,7 +43,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>
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
<!-- 定义批量新增的 SQL 映射 -->
|
||||
<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)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
@ -32,7 +32,7 @@
|
||||
</insert>
|
||||
|
||||
<update id="batchUpdate" parameterType="java.util.List">
|
||||
UPDATE retry_task_log_message jlm,
|
||||
UPDATE sj_retry_task_log_message jlm,
|
||||
(
|
||||
<foreach collection="list" item="item" index="index" separator="UNION ALL">
|
||||
SELECT
|
||||
|
@ -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, executor_name, args_str, ext_attrs, next_trigger_at, task_type, retry_status, create_dt)
|
||||
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)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
@ -49,7 +49,7 @@
|
||||
</insert>
|
||||
|
||||
<update id="updateBatchNextTriggerAtById" parameterType="java.util.List">
|
||||
UPDATE retry_task_${partition} rt,
|
||||
UPDATE sj_retry_task_${partition} rt,
|
||||
(
|
||||
<foreach collection="list" item="item" index="index" separator="UNION ALL">
|
||||
SELECT
|
||||
|
@ -40,7 +40,7 @@
|
||||
</insert>
|
||||
|
||||
<update id="batchUpdateExpireAt" parameterType="java.util.List">
|
||||
UPDATE server_node rt,
|
||||
UPDATE sj_server_node rt,
|
||||
(
|
||||
<foreach collection="list" item="item" index="index" separator="UNION ALL">
|
||||
SELECT
|
||||
@ -58,7 +58,7 @@
|
||||
resultType="com.aizuda.snailjob.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
|
||||
SELECT node_type AS nodeType,
|
||||
COUNT(*) AS total
|
||||
FROM server_node
|
||||
FROM sj_server_node
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</resultMap>
|
||||
|
||||
<update id="updateBatchNextTriggerAtById" parameterType="java.util.List">
|
||||
UPDATE workflow rt,
|
||||
UPDATE sj_workflow rt,
|
||||
(
|
||||
<foreach collection="list" item="item" index="index" separator="UNION ALL">
|
||||
SELECT
|
||||
|
Loading…
Reference in New Issue
Block a user