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