From cbd9fc08698119dfdc4a79c783de5cf3d69c7339 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Tue, 07 Apr 2026 20:30:21 +0800
Subject: [PATCH] opt: 人大金仓数据库改造

---
 drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml |   28 +++++++++++++++++++---------
 1 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml
index f2fcf1c..f82eecf 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml
@@ -55,10 +55,10 @@
                 and device_type::text = #{param2.deviceType}::text
             </if>
             <if test="param2.deviceModel != null and param2.deviceModel != ''">
-                and device_model = #{param2.deviceModel}
+                and device_model::text = #{param2.deviceModel}::text
             </if>
             <if test="param2.deviceSpecification != null and param2.deviceSpecification != ''">
-                and device_specification = #{param2.deviceSpecification}
+                and device_specification::text = #{param2.deviceSpecification}::text
             </if>
             <if test="param2.effectiveRangeKmIsNotNull != null and param2.effectiveRangeKmIsNotNull == 1">
                 and effective_range_km is not null
@@ -68,13 +68,13 @@
                 and (effective_range_km is null or effective_range_km = 0)
             </if>
             <if test="param2.manufacturer != null and param2.manufacturer != ''">
-                and manufacturer = #{param2.manufacturer}
+                and manufacturer::text = #{param2.manufacturer}::text
             </if>
             <if test="param2.source != null and param2.source != ''">
-                and source = #{param2.source}
+                and source::text = #{param2.source}::text
             </if>
             <if test="param2.belongDept != null and param2.belongDept != ''">
-                and belong_dept = #{param2.belongDept}
+                and belong_dept::text = #{param2.belongDept}::text
             </if>
             <if test="param2.deviceStatusList != null and param2.deviceStatusList != ''">
                 and status::text in
@@ -97,10 +97,9 @@
                     #{deptId}::text
                 </foreach>
                 <if test="param2.currentDeptId != null and param2.currentDeptId != '' ">
-                    or id in (
-                    SELECT device_id FROM ja_fw_device_per_share
-                    WHERE
-                    loan_to_dept_id = #{param2.currentDeptId}::bigint
+                    or id::text in (
+                    SELECT device_id::text FROM ja_fw_device_per_share
+                    WHERE loan_to_dept_id = #{param2.currentDeptId}::bigint
                     AND is_deleted = 0
                     )
                 </if>
@@ -816,4 +815,15 @@
         d.final_outbound_area
     </select>
 
+    <!-- 批量更新设备启用状态 -->
+    <update id="batchUpdateIsEnabled">
+        UPDATE ja_fw_device
+        SET is_enabled = #{isEnabled}
+        WHERE id IN
+        <foreach collection="deviceIds" item="id" open="(" separator="," close=")">
+            #{id}::bigint
+        </foreach>
+        AND is_deleted = 0
+    </update>
+
 </mapper>

--
Gitblit v1.9.3