Browse Source

分页修改

zhoutg 5 năm trước cách đây
mục cha
commit
595e45355b

+ 6 - 0
mrman-service/src/main/java/com/diagbot/dto/QcEntryTypeDTO.java

@@ -19,4 +19,10 @@ public class QcEntryTypeDTO {
     private String entryName;
     // 质控类型集
     private String typeStr;
+    // 条目编码
+    private String code;
+    // 所属模块
+    private String casesName;
+    // 所属模块
+    private String casesId;
 }

+ 4 - 0
mrman-service/src/main/java/com/diagbot/vo/QcEntryTypePageVO.java

@@ -19,4 +19,8 @@ public class QcEntryTypePageVO extends Page {
     private String entryName;
     // 质控类型名称
     private String typeName;
+    // 条目编码
+    private String code;
+    // 所属模块
+    private String casesId;
 }

+ 23 - 16
mrman-service/src/main/resources/mapper/QcCasesEntryMapper.xml

@@ -150,19 +150,20 @@
 
     <select id="entryTypePage" resultType="com.diagbot.dto.QcEntryTypeDTO">
         SELECT
-            *
+            t.*, qc.cases_id,
+            qc.cases_name,
+            qc.`code`,
+            qc.`name` entry_name
         FROM
             (
                 SELECT
                     a1.entry_id,
-                    a1.entry_name,
                     a1.hospital_id,
                     GROUP_CONCAT(b1. NAME) type_str
                 FROM
                     (
                         SELECT
                             t1.id entry_id,
-                            t1.`name` entry_name,
                             t2.hospital_id
                         FROM
                             qc_cases_entry t1,
@@ -188,20 +189,26 @@
                 AND a1.hospital_id = b1.hospital_id
                 GROUP BY
                     a1.entry_id,
-                    a1.entry_name,
                     a1.hospital_id
-            ) t
-        <where>
-            <if test="hospitalId != null">
-                and t.hospital_id = #{hospitalId}
-            </if>
-            <if test="entryName != null and entryName != ''">
-                and t.entry_name like concat('%', #{entryName}, '%')
-            </if>
-            <if test="typeName != null and typeName != ''">
-                and t.type_str like concat('%', #{typeName}, '%')
-            </if>
-        </where>
+            ) t,
+            qc_cases_entry qc
+        WHERE
+            t.entry_id = qc.id
+        <if test="hospitalId != null">
+            and t.hospital_id = #{hospitalId}
+        </if>
+        <if test="entryName != null and entryName != ''">
+            and qc.name like concat('%', #{entryName}, '%')
+        </if>
+        <if test="code != null and code != ''">
+            and qc.code like concat('%', #{code}, '%')
+        </if>
+        <if test="casesId != null">
+            and qc.cases_id = #{casesId}
+        </if>
+        <if test="typeName != null and typeName != ''">
+            and t.type_str like concat('%', #{typeName}, '%')
+        </if>
     </select>
 
     <select id="entryTypeDetail" resultType="com.diagbot.dto.QcTypeByEntryDTO">