From ef412709a533e49235ff2f4775d5385f9646f5e1 Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期六, 02 三月 2024 09:36:10 +0800
Subject: [PATCH] 三维实景增加选择状态

---
 ard-work/src/main/resources/mapper/management3d/ArdTiles3dMapper.xml |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ard-work/src/main/resources/mapper/management3d/ArdTiles3dMapper.xml b/ard-work/src/main/resources/mapper/management3d/ArdTiles3dMapper.xml
index adfbdcb..b26a1ba 100644
--- a/ard-work/src/main/resources/mapper/management3d/ArdTiles3dMapper.xml
+++ b/ard-work/src/main/resources/mapper/management3d/ArdTiles3dMapper.xml
@@ -25,6 +25,7 @@
         <result property="createTime" column="create_time"/>
         <result property="updateBy" column="update_by"/>
         <result property="updateTime" column="update_time"/>
+        <result property="selected" column="selected"/>
     </resultMap>
 
     <sql id="selectArdTiles3dVo">
@@ -47,7 +48,8 @@
                c.create_by,
                c.create_time,
                c.update_by,
-               c.update_time
+               c.update_time,
+               c.selected
         from ard_tiles3d c
         left join sys_dept d on d.dept_id = c.dept_id
         left join sys_user u on u.user_id = c.user_id
@@ -56,6 +58,7 @@
     <select id="selectArdTiles3dList" parameterType="ArdTiles3d" resultMap="ArdTiles3dResult">
         <include refid="selectArdTiles3dVo"/>
         <where>
+            <if test="selected != null  and selected != ''">and c.selected = #{selected}</if>
             <if test="tilesId != null  and tilesId != ''">and c.tiles_id = #{tilesId}</if>
             <if test="tilesName != null  and tilesName != ''">and c.tiles_name like '%'||#{tilesName}||'%'</if>
             <if test="tilesUrl != null  and tilesUrl != ''">and c.tiles_url = #{tilesUrl}</if>
@@ -74,7 +77,9 @@
             <if test="dynamicScreenSpaceErrorDensity != null ">and c.dynamic_screen_space_error_density =
                 #{dynamicScreenSpaceErrorDensity}
             </if>
-            <if test="deptId != null ">and c.dept_id = #{deptId}</if>
+            <if test="deptId != null ">and (c.dept_id = #{deptId} OR c.dept_id IN ( SELECT t.dept_id FROM sys_dept t
+                WHERE cast(#{deptId} as varchar) = any(string_to_array(ancestors,',')) ))
+            </if>
             <if test="userId != null  and userId != ''">and c.user_id = #{userId}</if>
         </where>
         <!-- 鏁版嵁鑼冨洿杩囨护 -->
@@ -109,6 +114,7 @@
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
+            <if test="selected != null">selected,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="tilesId != null">#{tilesId},</if>
@@ -131,6 +137,7 @@
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
+            <if test="selected != null">#{selected},</if>
         </trim>
     </insert>
 
@@ -160,6 +167,7 @@
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="selected != null">selected = #{selected},</if>
         </trim>
         where tiles_id = #{tilesId}
     </update>
@@ -181,4 +189,4 @@
         from ard_tiles3d
         where dept_id = #{deptId}
     </select>
-</mapper>
\ No newline at end of file
+</mapper>

--
Gitblit v1.9.3