From 939e76b90691c8f4e66e437791bce9e11bc4bfad Mon Sep 17 00:00:00 2001
From: xiebin <vip_xiaobin810@163.com>
Date: Wed, 01 Apr 2026 17:08:38 +0800
Subject: [PATCH] opt:兼容人大金仓
---
drone-ops/drone-resource/src/main/java/org/sxkj/resource/mapper/AttachMapper.xml | 84 ++++++++++-------------------------------
1 files changed, 21 insertions(+), 63 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 3885eef..26fc830 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
@@ -22,32 +22,29 @@
<!--自定义分页查询-->
<select id="selectAttachPage" resultType="org.sxkj.resource.vo.AttachVO">
- select * from blade_attach where is_deleted = 0
- <if test="attach.nickName != null and attach.nickName != ''">
- AND (nick_name LIKE CONCAT('%', #{attach.nickName}, '%') OR name LIKE CONCAT('%', #{attach.nickName}, '%'))
- </if>
+ select
+ ba.*,
+ bd.dept_name,
+ coalesce(ba.nick_name,ba.original_name) nickName
+ from
+ blade_attach ba
+ left join
+ blade_dept bd on ba.create_dept = bd.id
+ where
+ ba.is_deleted = 0
<if test="attach.originalName!=null and attach.originalName!=''">
and original_name like concat('%',#{attach.originalName},'%')
- </if>
- <if test="attach.extension!=null and attach.extension!=''">
- and extension like concat('%',#{attach.extension},'%')
- </if>
- <if test="attach.startTime!=null and attach.startTime!=''">
- and date_format(create_time,'%Y-%m-%d') >= #{attach.startTime}
- </if>
- <if test="attach.endTime!=null and attach.endTime!=''">
- and date_format(create_time,'%Y-%m-%d') <= #{attach.endTime}
</if>
<if test="attach.resultType!=null">
and result_type = #{attach.resultType}
</if>
- <if test="attach.wayLineJobId!=null and attach.wayLineJobId!=''">
- and wayline_job_id = #{attach.wayLineJobId}
+ <if test="attach.deptList != null and attach.deptList.size > 0">
+ and ba.create_dept in
+ <foreach collection="attach.deptList" item="deptId" open="(" separator="," close=")">
+ #{deptId}
+ </foreach>
</if>
- <if test="attach.deviceSn!=null and attach.deviceSn!=''">
- and device_sn = #{attach.deviceSn}
- </if>
-
+ and result_type in (1,2,3,4,5)
order by create_time desc,id desc
</select>
<select id="findAiAttachImages" resultType="org.sxkj.resource.vo.AttachVO">
@@ -79,7 +76,6 @@
and info.is_deleted = 0
and attach.is_thumbnail = 0
and (rela.is_deleted = 0 or rela.is_deleted is null)
- and attach.is_generate_ai_img = 0
and wj.`status` in (2, 3, 5, 6, 7)
<if test="attach.jobName!=null and attach.jobName!=''">
and wj.name like concat('%',#{attach.jobName},'%')
@@ -491,57 +487,20 @@
</select>
<select id="getAttachList" resultType="org.sxkj.resource.vo.AttachVO">
- select attach.name, attach.wayline_job_id, job.name jobName
- 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
- <where>
+ select
+ attach.*
+ from
+ blade_attach attach
+ <where>
<if test="attachIds!=null and attachIds.size()>0">
and attach.id in
<foreach item="item" index="index" collection="attachIds" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
- <if test="wayLineJobIds!=null and wayLineJobIds.size()>0">
- and attach.wayline_job_id in
- <foreach item="item" index="index" collection="wayLineJobIds" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="startTime!=null and startTime !='' and endTime!=null and endTime !='' ">
- and DATE_FORMAT(FROM_UNIXTIME(job.execute_time/1000,'%Y-%m-%d %H:%i:%s'),'%Y-%m-%d %H:%i:%s') between
- #{startTime} and #{endTime}
- </if>
- <if test="dockSn!=null and dockSn!=''">
- and attach.device_sn = #{dockSn}
- </if>
- <if test="jobName!=null and jobName!=''">
- and job.name like concat('%',#{jobName},'%')
- </if>
<if test="fileName!=null and fileName!=''">
and attach.name like concat('%',#{fileName},'%')
</if>
- <if test="fileType!=null and fileType!=''">
- <choose>
- <when test="fileType=='visable'">
- and attach.media_category = 0
- </when>
- <when test="fileType=='ir'">
- and attach.media_category = 1
- </when>
- </choose>
- </if>
- <!-- <if test="resultType!=null and resultType!=''"> -->
- <!-- and attach.result_type = #{resultType} -->
- <!-- </if> -->
- <if test="resultTypes!=null and resultTypes.size()>0">
- and attach.result_type in
- <foreach collection="resultTypes" item="resultType" open="(" close=")" separator=",">
- #{resultType}
- </foreach>
- </if>
- AND attach.wayline_job_id IS NOT NULL
- AND job.NAME IS NOT NULL
AND attach.is_deleted = 0
</where>
</select>
@@ -861,7 +820,6 @@
a.is_thumbnail,
a.longitude,
a.latitude,
- a.is_generate_ai_img,
a.media_category,
a.media_create_time,
a.is_deleted
--
Gitblit v1.9.3