From 5f2ee03958a1a16dc27195c76ea7cffb422c95d1 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期五, 19 十二月 2025 22:40:34 +0800
Subject: [PATCH] feat: 任务修改接口,删除一些不要的字段同步

---
 ruoyi-system/src/main/resources/mapper/system/SysTaskEmergencyMapper.xml |  119 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 116 insertions(+), 3 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..d5f526f 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysTaskEmergencyMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysTaskEmergencyMapper.xml
@@ -44,6 +44,13 @@
         <result property="dispatchSyncStatus"      column="dispatch_sync_status"    />
         <result property="dispatchSyncTime"        column="dispatch_sync_time"      />
         <result property="dispatchSyncErrorMsg"    column="dispatch_sync_error_msg" />
+        <result property="needResync"              column="need_resync"             />
+        <result property="legacyServiceOrdNo"      column="legacy_service_ord_no"   />
+        <result property="legacyDispatchOrdNo"     column="legacy_dispatch_ord_no"  />
+        <result property="legacyServiceNsTime"     column="legacy_service_ns_time"  />
+        <result property="legacyDispatchNsTime"    column="legacy_dispatch_ns_time" />
+        <result property="legacyDispatchOrdClass"  column="legacy_dispatch_ord_class" />
+        <result property="legacyServiceOrdClass"   column="legacy_service_ord_class" />
         <result property="createTime"              column="create_time"             />
         <result property="updateTime"              column="update_time"             />
         <result property="createBy"                column="create_by"               />
@@ -58,7 +65,7 @@
                hospital_in_department_id, hospital_in_bed_number, hospital_in_address, hospital_in_longitude, 
                hospital_in_latitude, transfer_distance, transfer_price, passenger_contact, 
                passenger_phone, disease_ids, document_type_id, task_type_id, legacy_service_ord_id, legacy_dispatch_ord_id, 
-               sync_status, sync_time, sync_error_msg, dispatch_sync_status, dispatch_sync_time, dispatch_sync_error_msg,
+               sync_status, sync_time, sync_error_msg, dispatch_sync_status, dispatch_sync_time, dispatch_sync_error_msg, need_resync, legacy_service_ord_no, legacy_dispatch_ord_no, legacy_service_ns_time, legacy_dispatch_ns_time, legacy_dispatch_ord_class, legacy_service_ord_class,
                create_time, update_time, create_by, update_by
         from sys_task_emergency
     </sql>
@@ -114,6 +121,13 @@
             <if test="dispatchSyncStatus != null">dispatch_sync_status,</if>
             <if test="dispatchSyncTime != null">dispatch_sync_time,</if>
             <if test="dispatchSyncErrorMsg != null">dispatch_sync_error_msg,</if>
+            <if test="needResync != null">need_resync,</if>
+            <if test="legacyServiceOrdNo != null">legacy_service_ord_no,</if>
+            <if test="legacyDispatchOrdNo != null">legacy_dispatch_ord_no,</if>
+            <if test="legacyServiceNsTime != null">legacy_service_ns_time,</if>
+            <if test="legacyDispatchNsTime != null">legacy_dispatch_ns_time,</if>
+            <if test="legacyDispatchOrdClass != null">legacy_dispatch_ord_class,</if>
+            <if test="legacyServiceOrdClass != null">legacy_service_ord_class,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="createBy != null">create_by,</if>
@@ -158,6 +172,13 @@
             <if test="dispatchSyncStatus != null">#{dispatchSyncStatus},</if>
             <if test="dispatchSyncTime != null">#{dispatchSyncTime},</if>
             <if test="dispatchSyncErrorMsg != null">#{dispatchSyncErrorMsg},</if>
+            <if test="needResync != null">#{needResync},</if>
+            <if test="legacyServiceOrdNo != null">#{legacyServiceOrdNo},</if>
+            <if test="legacyDispatchOrdNo != null">#{legacyDispatchOrdNo},</if>
+            <if test="legacyServiceNsTime != null">#{legacyServiceNsTime},</if>
+            <if test="legacyDispatchNsTime != null">#{legacyDispatchNsTime},</if>
+            <if test="legacyDispatchOrdClass != null">#{legacyDispatchOrdClass},</if>
+            <if test="legacyServiceOrdClass != null">#{legacyServiceOrdClass},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="createBy != null">#{createBy},</if>
@@ -205,6 +226,13 @@
             <if test="dispatchSyncStatus != null">dispatch_sync_status = #{dispatchSyncStatus},</if>
             <if test="dispatchSyncTime != null">dispatch_sync_time = #{dispatchSyncTime},</if>
             <if test="dispatchSyncErrorMsg != null">dispatch_sync_error_msg = #{dispatchSyncErrorMsg},</if>
+            <if test="needResync != null">need_resync = #{needResync},</if>
+            <if test="legacyServiceOrdNo != null">legacy_service_ord_no = #{legacyServiceOrdNo},</if>
+            <if test="legacyDispatchOrdNo != null">legacy_dispatch_ord_no = #{legacyDispatchOrdNo},</if>
+            <if test="legacyServiceNsTime != null">legacy_service_ns_time = #{legacyServiceNsTime},</if>
+            <if test="legacyDispatchNsTime != null">legacy_dispatch_ns_time = #{legacyDispatchNsTime},</if>
+            <if test="legacyDispatchOrdClass != null">legacy_dispatch_ord_class = #{legacyDispatchOrdClass},</if>
+            <if test="legacyServiceOrdClass != null">legacy_service_ord_class = #{legacyServiceOrdClass},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
         </trim>
@@ -223,8 +251,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 +274,80 @@
         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>
+    
+    <!-- 鏌ヨ闇�瑕侀噸鏂板悓姝ョ殑浠诲姟锛堣溅杈嗘垨浜哄憳鍙樻洿锛� -->
+    <select id="selectNeedResyncTasks" resultMap="SysTaskEmergencyResult">
+        <include refid="selectSysTaskEmergencyVo"/>
+        where need_resync = 1
+          and 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 task_status not in ('COMPLETED', 'CANCELLED')
+                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 100
+        </if>
     </select>
 
 </mapper>

--
Gitblit v1.9.1