From d4fe921568bc29d72644a55fd194adf7f9277cb5 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 22 十一月 2025 15:28:35 +0800
Subject: [PATCH] feat: 将旧系统数据同步到新系统
---
ruoyi-system/src/main/resources/mapper/system/SysTaskEmergencyMapper.xml | 65 +++++++++++++++++++++++++++++++-
1 files changed, 63 insertions(+), 2 deletions(-)
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysTaskEmergencyMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysTaskEmergencyMapper.xml
index cf83d3c..3318e20 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysTaskEmergencyMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysTaskEmergencyMapper.xml
@@ -223,8 +223,21 @@
<select id="selectPendingSyncTasks" resultMap="SysTaskEmergencyResult">
<include refid="selectSysTaskEmergencyVo"/>
where (sync_status = 0 or sync_status = 3)
+ and task_id in (
+ select task_id from sys_task
+ where task_type = 'EMERGENCY_TRANSFER'
+ and del_flag = '0'
+ )
order by id asc
- limit 100
+ <if test="offset != null and limit != null">
+ limit #{offset}, #{limit}
+ </if>
+ <if test="offset == null and limit != null">
+ limit #{limit}
+ </if>
+ <if test="offset == null and limit == null">
+ limit 100
+ </if>
</select>
<!-- 鏌ヨ寰呭悓姝ヨ皟搴﹀崟鐨勪换鍔★紙宸插悓姝ユ湇鍔″崟浣嗘湭鍚屾璋冨害鍗曪級 -->
@@ -233,8 +246,56 @@
where sync_status = 2
and legacy_service_ord_id is not null
and (dispatch_sync_status = 0 or dispatch_sync_status = 3 or dispatch_sync_status is null)
+ and task_id in (
+ select task_id from sys_task
+ where task_type = 'EMERGENCY_TRANSFER'
+ and task_status not in ('COMPLETED', 'CANCELLED') <!-- 杩囨护宸插畬鎴�/宸插彇娑堢殑浠诲姟 -->
+ and del_flag = '0'
+ )
order by id asc
- limit 100
+ <if test="offset != null and limit != null">
+ limit #{offset}, #{limit}
+ </if>
+ <if test="offset == null and limit != null">
+ limit #{limit}
+ </if>
+ <if test="offset == null and limit == null">
+ limit 100
+ </if>
+ </select>
+
+ <!-- 鏌ヨ宸插悓姝ヨ皟搴﹀崟涓旂姸鎬佹湭瀹屾垚鐨勪换鍔★紙鐢ㄤ簬鐘舵�佸悓姝ワ級 -->
+ <select id="selectSyncedTasksForStatusUpdate" resultMap="SysTaskEmergencyResult">
+ <include refid="selectSysTaskEmergencyVo"/>
+ where dispatch_sync_status = 2
+ and legacy_dispatch_ord_id is not null
+ and task_id in (
+ select task_id from sys_task
+ where task_type = 'EMERGENCY_TRANSFER'
+ and del_flag = '0'
+ )
+ order by id asc
+ <if test="offset != null and limit != null">
+ limit #{offset}, #{limit}
+ </if>
+ <if test="offset == null and limit != null">
+ limit #{limit}
+ </if>
+ <if test="offset == null and limit == null">
+ limit 200
+ </if>
+ </select>
+
+ <!-- 鏍规嵁鏃х郴缁熸湇鍔″崟ID鏌ヨ鎬ユ晳杞繍浠诲姟鎵╁睍淇℃伅 -->
+ <select id="selectByLegacyServiceOrdId" parameterType="Long" resultMap="SysTaskEmergencyResult">
+ <include refid="selectSysTaskEmergencyVo"/>
+ where legacy_service_ord_id = #{legacyServiceOrdId}
+ </select>
+
+ <!-- 鏍规嵁鏃х郴缁熻皟搴﹀崟ID鏌ヨ鎬ユ晳杞繍浠诲姟鎵╁睍淇℃伅 -->
+ <select id="selectByLegacyDispatchOrdId" parameterType="Long" resultMap="SysTaskEmergencyResult">
+ <include refid="selectSysTaskEmergencyVo"/>
+ where legacy_dispatch_ord_id = #{legacyDispatchOrdId}
</select>
</mapper>
--
Gitblit v1.9.1