From 2f07589b54d56085af77b50d580890cd4130b444 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期一, 19 十月 2026 15:19:53 +0800
Subject: [PATCH] 设备模块后端业务规则、计划接口与日期联动
---
cnas-device/src/main/resources/mapper/DeviceMapper.xml | 32 +++++++++++++++++---------------
1 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/cnas-device/src/main/resources/mapper/DeviceMapper.xml b/cnas-device/src/main/resources/mapper/DeviceMapper.xml
index 5460a17..b84746b 100644
--- a/cnas-device/src/main/resources/mapper/DeviceMapper.xml
+++ b/cnas-device/src/main/resources/mapper/DeviceMapper.xml
@@ -97,7 +97,7 @@
cmr.calibration_date as last_calibration_date_two,
cmr.next_calibration_date as next_calibration_date_two,
GROUP_CONCAT(distinct inspection_item SEPARATOR ';') AS insProductItem,
- u.name ,
+ u.name AS equipment_manager_user,
sd.dept_name AS laboratory_name
FROM
device d
@@ -130,13 +130,7 @@
<resultMap id="treeDeviceDto" type="map">
<result property="label" column="laboratory_name"/>
<result property="value" column="value" />
- <collection property="children" resultMap="storagePointMap" javaType="List"/>
- </resultMap>
-
- <resultMap id="storagePointMap" type="map">
- <result property="value" column="value"/>
- <result property="label" column="storage_point"/>
- <collection property="children" resultMap="deviceNameMap" javaType="List"/>
+ <collection property="children" resultMap="deviceNameMap" javaType="List" notNullColumn="id"/>
</resultMap>
<resultMap id="deviceNameMap" type="map">
@@ -144,24 +138,32 @@
<result property="label" column="device_name"/>
<result property="activationDate" column="activation_date"/>
<result property="managementNumber" column="management_number"/>
+ <result property="storagePoint" column="storage_point"/>
</resultMap>
<select id="treeDevice" resultMap="treeDeviceDto">
select
+ c.laboratory_name,
d.id,
- case when sd.dept_name is null || sd.dept_name ='' then '鍏朵粬' else sd.dept_name end as laboratory_name,
- case when d.storage_point is null || d.storage_point ='' then '鍏朵粬' else d.storage_point end as storage_point,
d.device_name,
d.management_number,
- null as value,
- d.activation_date
- from device d
- LEFT JOIN sys_dept sd ON sd.dept_id = d.subordinate_departments_id AND sd.del_flag = '0'
+ d.storage_point,
+ d.activation_date,
+ null as value
+ from (
+ select 1 as sort_no, '鍏ㄩ儴' as laboratory_name
+ union all
+ select 2 as sort_no, '璁惧' as laboratory_name
+ union all
+ select 3 as sort_no, '璁¢噺鍣ㄥ叿' as laboratory_name
+ ) c
+ left join device d on c.sort_no = 1 or d.large_category = c.laboratory_name
<where>
<if test="deviceName!=null and deviceName!=''">
- and device_name like concat('%',#{deviceName},'%')
+ and d.device_name like concat('%',#{deviceName},'%')
</if>
</where>
+ order by c.sort_no, d.id
</select>
<select id="selectDeviceByCode" resultType="com.ruoyi.device.dto.DeviceDto">
--
Gitblit v1.9.3