浏览代码

只能预问诊后台维护,标签分页检索

wangyu 5 年之前
父节点
当前提交
17d55d0138

+ 2 - 0
precman-service/src/main/java/com/diagbot/dto/QuestionPageDTO.java

@@ -159,6 +159,8 @@ public class QuestionPageDTO implements Serializable {
 
     private String formulaCode; //公式编码
 
+    private String combinationName;
+
     /**
      * 备注
      */

+ 2 - 0
precman-service/src/main/java/com/diagbot/vo/QuestionPageVO.java

@@ -20,4 +20,6 @@ public class QuestionPageVO extends Page {
     private List<Integer> tagTypeList;
     private List<Integer> controlTypeList;
     private List<Integer> notTypeList;
+    private String combinationName;//组合项名称
+    private String name;//界面名称
 }

+ 113 - 4
precman-service/src/main/resources/mapper/QuestionInfoMapper.xml

@@ -99,11 +99,61 @@
 
 
     <select id="getList" resultType="com.diagbot.dto.QuestionPageDTO">
-        SELECT a.* FROM `prec_question_info` a
-        WHERE a.is_deleted = 'N'
+        SELECT e.* FROM(SELECT
+        a.id,
+        a.is_deleted,
+        a.gmt_create,
+        a.gmt_modified,
+        a.creator,
+        a.modifier,
+        a.tag_name,
+        a.`name`,
+        a.description,
+        a.`sex_type`,
+        a.age_begin,
+        a.age_end,
+        a.tag_type,
+        a.control_type,
+        a.type,
+        a.item_type,
+        a.label_prefix,
+        a.label_suffix,
+        a.url,
+        a.spec_flag,
+        a.required,
+        a.explains,
+        c.tag_name combinationName,
+        a.remark
+        FROM
+        `prec_question_info` a,
+        prec_question_info c,
+        prec_question_mapping b
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND a.id = b.son_question
+        AND c.id = b.parent_question
+        <if test="combinationName != null and combinationName != ''">
+            AND b.parent_question IN (-- 搜索所有组合项的id
+            SELECT
+            f.id
+            FROM
+            `prec_question_info` f
+            WHERE
+            f.is_deleted = 'N'
+            )
+        </if>
+        <if test="combinationName != null and combinationName != ''">
+            AND c.tag_name like concat ('%', #{combinationName}, '%')
+        </if>
+
         <if test="type != null and type != ''">
             AND a.type = #{type}
         </if>
+        <if test="name != null and name != ''">
+            AND a.name like concat ('%', #{name}, '%')
+        </if>
         <if test="tagName != null and tagName != ''">
             AND a.tag_name like concat ('%', #{tagName}, '%')
         </if>
@@ -125,8 +175,67 @@
                 #{controlType}
             </foreach>
         </if>
-        order by a.gmt_modified desc
-
+        <if test="combinationName == null or combinationName == ''">
+            UNION
+            SELECT d.id,
+            d.is_deleted,
+            d.gmt_create,
+            d.gmt_modified,
+            d.creator,
+            d.modifier,
+            d.tag_name,
+            d.`name`,
+            d.description,
+            d.`sex_type`,
+            d.age_begin,
+            d.age_end,
+            d.tag_type,
+            d.control_type,
+            d.type,
+            d.item_type,
+            d.label_prefix,
+            d.label_suffix,
+            d.url,
+            d.spec_flag,
+            d.required,
+            d.explains,
+            null combinationName,
+            d.remark FROM prec_question_info d
+            WHERE
+            d.is_deleted = 'N'
+            <if test="type != null and type != ''">
+                AND d.type = #{type}
+            </if>
+            <if test="tagName != null and tagName != ''">
+                AND d.tag_name like concat ('%', #{tagName}, '%')
+            </if>
+            <if test="name != null and name != ''">
+                AND d.name like concat ('%', #{name}, '%')
+            </if>
+            <if test="notTypeList != null and notTypeList.size() > 0 ">
+                and d.type not in
+                <foreach  collection="notTypeList" item="notType" open="("  separator=","  close=")">
+                    #{notType}
+                </foreach>
+            </if>
+            <if test="tagTypeList != null and tagTypeList.size() > 0 ">
+                and d.tag_type in
+                <foreach  collection="tagTypeList" item="tagType" open="("  separator=","  close=")">
+                    #{tagType}
+                </foreach>
+            </if>
+            <if test="controlTypeList != null and controlTypeList.size() > 0 ">
+                and d.control_type in
+                <foreach  collection="controlTypeList" item="controlType" open="("  separator=","  close=")">
+                    #{controlType}
+                </foreach>
+            </if>
+        </if>
+            ) e
+            GROUP BY
+            e.id
+            order by
+            e.gmt_modified desc
     </select>