From 9cfa28b044846a6fa1ce5882abfba68a5263d091 Mon Sep 17 00:00:00 2001
From: 张晓波 <bingbo1993@126.com>
Date: 星期一, 11 十二月 2023 16:23:24 +0800
Subject: [PATCH] 设备点检类型名称返回

---
 hd/pipe/mobile/src/main/resources/mapping/CheckDeviceMapper.xml |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/hd/pipe/mobile/src/main/resources/mapping/CheckDeviceMapper.xml b/hd/pipe/mobile/src/main/resources/mapping/CheckDeviceMapper.xml
index 172cfdc..2d8790b 100644
--- a/hd/pipe/mobile/src/main/resources/mapping/CheckDeviceMapper.xml
+++ b/hd/pipe/mobile/src/main/resources/mapping/CheckDeviceMapper.xml
@@ -55,6 +55,7 @@
             t.check_content as checkContent,
             t.check_time as checkTime,
             t.check_type as checkType,
+            sd1.dict_name as checkTypeName,
             t.create_time as createTime,
             t.device_id as deviceId,
             bd.big_device_name as bigDeviceName,
@@ -67,6 +68,7 @@
         from t_check_device t
          left join t_big_device bd on t.device_id = bd.big_device_id
          left join sys_dict sd on sd.dict_id = bd.big_type
+         left join sys_dict sd1 on sd1.dict_id = t.check_type
          left join sys_users su on su.user_id = t.admin_user
         where t.id = #{id}
     </select>
@@ -88,6 +90,7 @@
         t.check_type as checkType,
         t.create_time as createTime,
         t.device_id as deviceId,
+        sd1.dict_name as checkTypeName,
         bd.big_device_name as bigDeviceName,
         bd.big_device_model as bigDeviceModel,
         bd.big_number as bigNumber,
@@ -98,20 +101,26 @@
         from t_check_device t
         left join t_big_device bd on t.device_id = bd.big_device_id
         left join sys_dict sd on sd.dict_id = bd.big_type
+        left join sys_dict sd1 on sd1.dict_id = t.check_type
         left join sys_users su on su.user_id = t.admin_user
         <where>
             <trim suffixOverrides=" AND ">
+                t.is_use = 1 AND
                 <if test="bigDeviceName !=null and bigDeviceName !=''">
-                    bd.big_device_name LIKE concat('%',#{bigDeviceName},'%')
+                    bd.big_device_name LIKE concat('%',#{bigDeviceName},'%') AND
+                </if>
+                <if test="bigNumber !=null and bigNumber !=''">
+                    bd.big_number LIKE concat('%',#{bigNumber},'%') AND
                 </if>
                 <if test="startTime !=null">
-                    t.check_time &gt;= #{startTime}
+                    t.check_time &gt;= #{startTime} AND
                 </if>
                 <if test="endTime !=null">
-                    t.check_time &lt;= #{endTime}
+                    t.check_time &lt;= #{endTime} AND
                 </if>
             </trim>
         </where>
+        order by t.create_time desc
     </select>
 
     <!--查询列表-->
@@ -223,7 +232,7 @@
     </delete>
 
     <select id="deviceList" resultType="hashmap">
-        select big_device_id as bigDeviceId,big_device_name as bigDeviceName from t_big_device
+        select big_device_id as bigDeviceId,concat(big_device_name,'-',big_device_model) as bigDeviceName from t_big_device
         where is_use = 1 and company_id = #{companyId}
     </select>
 

--
Gitblit v1.9.3