From 6d9d9403e187ea02b3ccc70a0059b223ce288114 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期五, 21 六月 2024 18:00:27 +0800
Subject: [PATCH] 设备的检测项目显示

---
 cnas-server/src/main/resources/mapper/DeviceMapper.xml                   |   20 +++++++++++++++++---
 cnas-server/src/main/resources/mapper/LaboratoryMapper.xml               |    1 +
 performance-server/src/main/resources/mapper/EvaluateGroupMapper.xml     |    2 +-
 cnas-server/src/main/java/com/yuanchu/mom/dto/DeviceDto.java             |    2 +-
 performance-server/src/main/resources/mapper/EvaluateLeaderMapper.xml    |    2 +-
 performance-server/src/main/resources/mapper/EvaluateCompetentMapper.xml |    2 +-
 cnas-server/src/main/java/com/yuanchu/mom/pojo/Laboratory.java           |    6 +++++-
 performance-server/src/main/resources/mapper/EvaluateMapper.xml          |    2 +-
 8 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/cnas-server/src/main/java/com/yuanchu/mom/dto/DeviceDto.java b/cnas-server/src/main/java/com/yuanchu/mom/dto/DeviceDto.java
index 8bd8ce8..5963016 100644
--- a/cnas-server/src/main/java/com/yuanchu/mom/dto/DeviceDto.java
+++ b/cnas-server/src/main/java/com/yuanchu/mom/dto/DeviceDto.java
@@ -22,5 +22,5 @@
 
     @ValueTableShow(13)
     @ApiModelProperty(value = "妫�楠岄」鐩�")
-    private Integer insProductItem;
+    private String insProductItem;
 }
diff --git a/cnas-server/src/main/java/com/yuanchu/mom/pojo/Laboratory.java b/cnas-server/src/main/java/com/yuanchu/mom/pojo/Laboratory.java
index ec07416..10e33d5 100644
--- a/cnas-server/src/main/java/com/yuanchu/mom/pojo/Laboratory.java
+++ b/cnas-server/src/main/java/com/yuanchu/mom/pojo/Laboratory.java
@@ -27,9 +27,13 @@
     private String laboratoryName;
 
     @ValueTableShow(3)
-    @ApiModelProperty(value = "瀹為獙瀹ょ紪鐮�")
+    @ApiModelProperty(value = "瀹為獙瀹ょ紪鍙�")
     private String laboratoryNumber;
 
+    @ValueTableShow(3)
+    @ApiModelProperty(value = "瀹為獙瀹や唬鍙�")
+    private String laboratoryCode;
+
     @ValueTableShow(4)
     @ApiModelProperty(value = "璐熻矗浜虹數璇�")
     private String phoneNumber;
diff --git a/cnas-server/src/main/resources/mapper/DeviceMapper.xml b/cnas-server/src/main/resources/mapper/DeviceMapper.xml
index 44655bd..6eaebf9 100644
--- a/cnas-server/src/main/resources/mapper/DeviceMapper.xml
+++ b/cnas-server/src/main/resources/mapper/DeviceMapper.xml
@@ -93,11 +93,25 @@
     <select id="selectDeviceParameterPage" resultType="com.yuanchu.mom.dto.DeviceDto">
         select * from(
         SELECT
-        d.*, u.name equipmentManagerUser, l.laboratory_name laboratoryName
+        d.*,
+        GROUP_CONCAT(
+        CONCAT_WS(', ',
+        TRIM(BOTH '["]' FROM SUBSTRING_INDEX(REPLACE(sample, '[["', ''), '"]]', 1)),
+        inspection_item,
+        inspection_item_subclass
+        )
+        SEPARATOR ';'
+        ) AS insProductItem,
+        u.name ,
+        l.laboratory_name
         FROM
         device d
-        left join `user` u on u.id = d.equipment_manager
-        left join laboratory l on l.id = d.subordinate_departments_id
+        LEFT JOIN `user` u ON u.id = d.equipment_manager
+        LEFT JOIN laboratory l ON l.id = d.subordinate_departments_id
+        LEFT JOIN structure_item_parameter sip ON FIND_IN_SET(sip.id, d.ins_product_ids)
+        GROUP BY
+        d.id,
+        u.name, l.laboratory_name
         ) a
         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
             ${ew.customSqlSegment}
diff --git a/cnas-server/src/main/resources/mapper/LaboratoryMapper.xml b/cnas-server/src/main/resources/mapper/LaboratoryMapper.xml
index bba2d21..1251b4f 100644
--- a/cnas-server/src/main/resources/mapper/LaboratoryMapper.xml
+++ b/cnas-server/src/main/resources/mapper/LaboratoryMapper.xml
@@ -10,6 +10,7 @@
         select l.id,
         laboratory_name,
         laboratory_number,
+        laboratory_code,
         phone_number,
         head,
         l.address,
diff --git a/performance-server/src/main/resources/mapper/EvaluateCompetentMapper.xml b/performance-server/src/main/resources/mapper/EvaluateCompetentMapper.xml
index 205c05e..e3adc2f 100644
--- a/performance-server/src/main/resources/mapper/EvaluateCompetentMapper.xml
+++ b/performance-server/src/main/resources/mapper/EvaluateCompetentMapper.xml
@@ -27,7 +27,7 @@
         from evaluate_competent ec
         left join evaluate e on ec.evaluate_id = e.id
         left join user u on e.user_id = u.id
-        left join department_lims dl on depart_lims_id like concat('%',dl.id,'%')
+        left join department_lims dl on FIND_IN_SET(dl.id, depart_lims_id)
         where 1=1
         <if test="month!=null and month!=''">
             and e.month=#{month}
diff --git a/performance-server/src/main/resources/mapper/EvaluateGroupMapper.xml b/performance-server/src/main/resources/mapper/EvaluateGroupMapper.xml
index e80061d..50c8939 100644
--- a/performance-server/src/main/resources/mapper/EvaluateGroupMapper.xml
+++ b/performance-server/src/main/resources/mapper/EvaluateGroupMapper.xml
@@ -25,7 +25,7 @@
         from evaluate_group eg
         left join evaluate e on eg.evaluate_id = e.id
         left join user u on e.user_id = u.id
-        left join department_lims dl on depart_lims_id like concat('%',dl.id,'%')
+        left join department_lims dl on FIND_IN_SET(dl.id, depart_lims_id)
         where 1=1
         <if test="month!=null and month!=''">
             and e.month=#{month}
diff --git a/performance-server/src/main/resources/mapper/EvaluateLeaderMapper.xml b/performance-server/src/main/resources/mapper/EvaluateLeaderMapper.xml
index b7f0755..d30a997 100644
--- a/performance-server/src/main/resources/mapper/EvaluateLeaderMapper.xml
+++ b/performance-server/src/main/resources/mapper/EvaluateLeaderMapper.xml
@@ -25,7 +25,7 @@
         from evaluate_leader el
         left join evaluate e on el.evaluate_id = e.id
         left join user u on e.user_id = u.id
-        left join department_lims dl on depart_lims_id like concat('%',dl.id,'%')
+        left join department_lims dl on FIND_IN_SET(dl.id, depart_lims_id)
         where 1=1
         <if test="month!=null and month!=''">
             and e.month=#{month}
diff --git a/performance-server/src/main/resources/mapper/EvaluateMapper.xml b/performance-server/src/main/resources/mapper/EvaluateMapper.xml
index e55ca24..92ad065 100644
--- a/performance-server/src/main/resources/mapper/EvaluateMapper.xml
+++ b/performance-server/src/main/resources/mapper/EvaluateMapper.xml
@@ -28,7 +28,7 @@
         left join evaluate_group eg on e.id = eg.evaluate_id
         left join evaluate_leader el on e.id = el.evaluate_id
         left join user u on e.user_id = u.id
-        left join department_lims dl on depart_lims_id like concat('%',dl.id,'%') ) A
+        left join department_lims dl on  FIND_IN_SET(dl.id, depart_lims_id) ) A
         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
             ${ew.customSqlSegment}
         </if>

--
Gitblit v1.9.3