From eeb3b5c9c794a35d7b7f3c8e56f9eef8eb8d3451 Mon Sep 17 00:00:00 2001
From: xiebin <vip_xiaobin810@163.com>
Date: Wed, 01 Apr 2026 17:20:19 +0800
Subject: [PATCH] opt:兼容人大金仓

---
 drone-ops/drone-resource/src/main/java/org/sxkj/resource/mapper/AttachMapper.xml |   94 +++++++++++++++++++++++-----------------------
 1 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/drone-ops/drone-resource/src/main/java/org/sxkj/resource/mapper/AttachMapper.xml b/drone-ops/drone-resource/src/main/java/org/sxkj/resource/mapper/AttachMapper.xml
index 26fc830..6d56f41 100644
--- a/drone-ops/drone-resource/src/main/java/org/sxkj/resource/mapper/AttachMapper.xml
+++ b/drone-ops/drone-resource/src/main/java/org/sxkj/resource/mapper/AttachMapper.xml
@@ -29,7 +29,7 @@
         from
             blade_attach ba
         left join
-                blade_dept bd on ba.create_dept = bd.id
+                blade_dept bd on ba.create_dept = bd.id::VARCHAR
         where
             ba.is_deleted = 0
         <if test="attach.originalName!=null and attach.originalName!=''">
@@ -69,9 +69,9 @@
         wj.name AS job_name,
         rela.status
         from blade_attach attach
-        left join drone_job_event_rela rela on attach.id = rela.attach_id
-        left join wayline_job wj ON attach.wayline_job_id = wj.job_id
-        left join wayline_job_info info on wj.job_info_id = info.id
+        left join drone_job_event_rela rela on attach.id = rela.attach_id::VARCHAR
+        left join wayline_job wj ON attach.wayline_job_id = wj.job_id::VARCHAR
+        left join wayline_job_info info on wj.job_info_id = info.id::VARCHAR
         where attach.is_deleted = 0
         and info.is_deleted = 0
         and attach.is_thumbnail = 0
@@ -150,7 +150,7 @@
     <select id="findAllMd5ByAi" resultType="org.sxkj.resource.vo.EventImgMd5VO">
         select md5,original_md5
         from drone_job_event_rela rela
-        left join ai_event_record record on rela.ai_event_record_uuid=record.uuid
+        left join ai_event_record record on rela.ai_event_record_uuid = record.uuid::VARCHAR
         <where>
             and record.id in
             <foreach collection="aiRecordIds" item="eventRecordId" separator="," open="(" close=")">
@@ -183,7 +183,7 @@
         attach.create_time,
         rela.status
         from blade_attach attach
-        right join drone_job_event_rela rela on attach.id = rela.attach_id
+        right join drone_job_event_rela rela on attach.id = rela.attach_id::VARCHAR
         where attach.is_deleted = 0 and attach.is_thumbnail = 0
         <if test="attach.nickName != null and attach.nickName != ''">
             AND (nick_name LIKE CONCAT('%', #{attach.nickName}, '%') OR name LIKE CONCAT('%', #{attach.nickName}, '%'))
@@ -256,12 +256,12 @@
         </if>
         device.nickName nestName
         from blade_attach attach
-        left join wayline_job job on attach.wayline_job_id = job.job_id
-        left join wayline_job_info wji on wji.id = job.job_info_id
-        left join manage_device device on job.dock_sn = device.device_sn
-        left join manage_device_expansion mde on job.dock_sn = mde.device_sn
-        left join blade_region region on device.area_code = region.code
-        left join drone_job_event_rela rela on attach.id = rela.attach_id
+        left join wayline_job job on attach.wayline_job_id = job.job_id::VARCHAR
+        left join wayline_job_info wji on wji.id = job.job_info_id::VARCHAR
+        left join manage_device device on job.dock_sn = device.device_sn::VARCHAR
+        left join manage_device_expansion mde on job.dock_sn = mde.device_sn::VARCHAR
+        left join blade_region region on device.area_code = region.code::VARCHAR
+        left join drone_job_event_rela rela on attach.id = rela.attach_id::VARCHAR
         where
         attach.is_deleted = 0
         and wji.is_deleted = 0
@@ -358,7 +358,7 @@
                               and create_time &gt; #{startTime}
                               and create_time &lt; #{endTime}
                             GROUP BY create_dept) b
-                           on (a.id = b.create_dept)
+                           on (a.id = b.create_dept::VARCHAR)
     </select>
 
     <!--判断附件是否已存在-->
@@ -390,9 +390,9 @@
         device.area_code "dictKey",
         count(*)"num"
         from blade_attach attach
-        left join manage_device device on attach.device_sn=device.device_sn
-        left join wayline_job job on attach.wayline_job_id = job.job_id
-        left join wayline_job_info wji on wji.id = job.job_info_id
+        left join manage_device device on attach.device_sn = device.device_sn::VARCHAR
+        left join wayline_job job on attach.wayline_job_id = job.job_id::VARCHAR
+        left join wayline_job_info wji on wji.id = job.job_info_id::VARCHAR
         <where>
             and attach.is_deleted = 0
             and wji.is_deleted = 0
@@ -424,12 +424,12 @@
         device.area_code "dictKey"
         FROM
         odm_task_info oti
-        LEFT JOIN wayline_job wj ON wj.job_id = oti.wayline_job_id
-        LEFT JOIN manage_device device ON wj.dock_sn = device.device_sn
-        LEFT JOIN tb_lot_info tli ON tli.dkbh = wj.dkbh
+        LEFT JOIN wayline_job wj ON wj.job_id = oti.wayline_job_id::VARCHAR
+        LEFT JOIN manage_device device ON wj.dock_sn = device.device_sn::VARCHAR
+        LEFT JOIN tb_lot_info tli ON tli.dkbh = wj.dkbh::VARCHAR
         WHERE
         ( wj.job_type = 4 OR wj.job_type = 2 )
-        AND oti.running_progress = 1.00
+        AND oti.running_progress = 1.00::VARCHAR
         <if test="startDate!=null">
             and oti.create_time &gt;=#{startDate}
         </if>
@@ -456,11 +456,11 @@
             ST_AsText ( odm.geom ) "geom"
         </if>
         from blade_attach attach
-        left join manage_device device on attach.device_sn=device.device_sn
-        left join wayline_job job on attach.wayline_job_id = job.job_id
-        left join wayline_job_info wji on wji.id = job.job_info_id
+        left join manage_device device on attach.device_sn = device.device_sn::VARCHAR
+        left join wayline_job job on attach.wayline_job_id = job.job_id::VARCHAR
+        left join wayline_job_info wji on wji.id = job.job_info_id::VARCHAR
         <if test="resultType!=null and resultType!='' and resultType==4">
-            left join odm_task_info odm on attach.wayline_job_id=odm.wayline_job_id
+            left join odm_task_info odm on attach.wayline_job_id = odm.wayline_job_id::VARCHAR
         </if>
         <where>
             and attach.is_deleted = 0
@@ -517,7 +517,7 @@
         rela.event_name,
         ifnull(attach.result_type,2) "result_type"
         FROM blade_attach attach
-        LEFT JOIN drone_job_event_rela rela ON attach.id = rela.attach_id
+        LEFT JOIN drone_job_event_rela rela ON attach.id = rela.attach_id::VARCHAR
         WHERE
         attach.is_deleted = 0
         AND attach.is_thumbnail = 0
@@ -569,9 +569,9 @@
                device.nickname                                                                             nestName,
                CONCAT_WS(',', region.province_name, region.city_name, region.district_name)                region_name
         from blade_attach attach
-                 left join wayline_job job on attach.wayline_job_id = job.job_id
-                 left join manage_device device on attach.device_sn = device.device_sn
-                 left join blade_region region on device.area_code = region.code
+                 left join wayline_job job on attach.wayline_job_id = job.job_id::VARCHAR
+                 left join manage_device device on attach.device_sn = device.device_sn::VARCHAR
+                 left join blade_region region on device.area_code = region.code::VARCHAR
         where attach.id = #{id}
     </select>
 
@@ -592,10 +592,10 @@
                device.nickname,
                CONCAT_WS(',', region.province_name, region.city_name, region.district_name)                region_name
         from wayline_job job
-                 left join blade_attach attach on attach.wayline_job_id = job.job_id
-                 left join manage_device device on attach.device_sn = device.device_sn
-                 left join blade_region region on device.area_code = region.code
-                 left join drone_job_event_rela rela on attach.id = rela.attach_id
+                 left join blade_attach attach on attach.wayline_job_id = job.job_id::VARCHAR
+                 left join manage_device device on attach.device_sn = device.device_sn::VARCHAR
+                 left join blade_region region on device.area_code = region.code::VARCHAR
+                 left join drone_job_event_rela rela on attach.id = rela.attach_id::VARCHAR
         where job.job_id = #{jobId}
           and attach.result_type in (0, 2, 5)
     </select>
@@ -605,9 +605,9 @@
         attach.result_type type,
         count(attach.id) count
         FROM blade_attach attach
-        LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id
-        LEFT JOIN wayline_job_info wji on wji.id = wj.job_info_id
-        LEFT JOIN drone_job_event_rela rela on attach.id = rela.attach_id
+        LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id::VARCHAR
+        LEFT JOIN wayline_job_info wji on wji.id = wj.job_info_id::VARCHAR
+        LEFT JOIN drone_job_event_rela rela on attach.id = rela.attach_id::VARCHAR
         <where>
             <if test="param.deviceSn!=null and param.deviceSn!=''">
                 and attach.device_sn = #{param.deviceSn}
@@ -642,9 +642,9 @@
         ROUND( sum( wj3d.area ) / 1000000, 2 ) AS area
         FROM
         blade_attach attach
-        LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id
-        LEFT JOIN wayline_job_info wji ON wji.id = wj.job_info_id AND wji.is_deleted = 0
-        LEFT JOIN wayline_job_3d_record wj3d on wj3d.job_id = wj.job_id
+        LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id::VARCHAR
+        LEFT JOIN wayline_job_info wji ON wji.id = wj.job_info_id::VARCHAR AND wji.is_deleted = 0
+        LEFT JOIN wayline_job_3d_record wj3d on wj3d.job_id = wj.job_id::VARCHAR
         <where>
             <if test="param.deviceSn!=null and param.deviceSn!=''">
                 AND attach.device_sn = #{param.deviceSn}
@@ -691,9 +691,9 @@
         wj3d.area_code
         FROM
         blade_attach attach
-        LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id
-        LEFT JOIN wayline_job_info wji ON wji.id = wj.job_info_id AND wji.is_deleted = 0
-        LEFT JOIN wayline_job_3d_record wj3d on wj3d.job_id = wj.job_id
+        LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id::VARCHAR
+        LEFT JOIN wayline_job_info wji ON wji.id = wj.job_info_id::VARCHAR AND wji.is_deleted = 0
+        LEFT JOIN wayline_job_3d_record wj3d on wj3d.job_id = wj.job_id::VARCHAR
         <where>
             <if test="param.deviceSn!=null and param.deviceSn!=''">
                 AND attach.device_sn = #{param.deviceSn}
@@ -742,8 +742,8 @@
         count(attach.id) count,
         DATE_FORMAT(attach.create_time, #{param1.formatTime}) timeStr
         from blade_attach attach
-        LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id
-        left JOIN wayline_job_info wji ON wji.id = wj.job_info_id and wji.is_deleted = 0
+        LEFT JOIN wayline_job wj ON attach.wayline_job_id = wj.job_id::VARCHAR
+        left JOIN wayline_job_info wji ON wji.id = wj.job_info_id::VARCHAR and wji.is_deleted = 0
         <where>
             <if test="param1.deviceSn!=null and param1.deviceSn!=''">
                 and attach.device_sn = #{param1.deviceSn}
@@ -782,9 +782,9 @@
     <delete id="deleteAttach">
 
         UPDATE blade_attach ba
-            INNER JOIN wayline_job wj ON ba.wayline_job_id = wj.job_id
-            INNER JOIN wayline_job_info wji ON wj.job_info_id = wji.id
-            INNER JOIN wayline_job_record wjr ON wji.id = wjr.job_info_id
+            INNER JOIN wayline_job wj ON ba.wayline_job_id = wj.job_id::VARCHAR
+            INNER JOIN wayline_job_info wji ON wj.job_info_id = wji.id::VARCHAR
+            INNER JOIN wayline_job_record wjr ON wji.id = wjr.job_info_id::VARCHAR
             SET ba.is_deleted = 1,
                 ba.update_user = #{operator}
         WHERE ba.workspace_id = #{workspaceId}
@@ -826,7 +826,7 @@
         FROM
             blade_attach a
                 INNER JOIN
-            wayline_job j ON a.wayline_job_id = j.job_id
+            wayline_job j ON a.wayline_job_id = j.job_id::VARCHAR
         WHERE
             (
                 FIND_IN_SET(#{lotInfoId}, j.lot_info_id) > 0

--
Gitblit v1.9.3