From dab98d2c0f573d8e17a7786a879e595e6d535a9a Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Wed, 28 Jan 2026 19:45:36 +0800
Subject: [PATCH] 工单-机构权限控制
---
drone-ops/drone-resource/src/main/java/org/sxkj/resource/mapper/AttachMapper.xml | 53 +++++++++++------------------------------------------
1 files changed, 11 insertions(+), 42 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 d5bfbc8..3de25cc 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
@@ -38,6 +38,12 @@
<if test="attach.resultType!=null">
and result_type = #{attach.resultType}
</if>
+ <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>
and result_type in (1,2,3,4,5)
order by create_time desc,id desc
</select>
@@ -481,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>
--
Gitblit v1.9.3