Explorar o código

根据标签id获取标签内容

zhoutg %!s(int64=6) %!d(string=hai) anos
pai
achega
d1e7151827

+ 1 - 2
icss-service/src/main/java/com/diagbot/dto/QuestionDTO.java

@@ -1,7 +1,6 @@
 package com.diagbot.dto;
 
 import com.diagbot.entity.QuestionDetail;
-import com.diagbot.entity.QuestionInfo;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -35,6 +34,6 @@ public class QuestionDTO {
     private String copyType;//是否显示 + (0:不显示 1 :显示)
     private List<QuestionDetail> questionDetailList = new ArrayList<>(); //标签明细表
     private List<QuestionDTO> questionMapping = new ArrayList<>();     //下级标签
-    private List<QuestionInfo> questionRelationList = new ArrayList<>(); //症状同级关联
+//    private List<QuestionDTO> questionRelationList = new ArrayList<>(); //同级标签
     private String remark;//备注
 }

+ 5 - 0
icss-service/src/main/java/com/diagbot/entity/QuestionInfo.java

@@ -62,6 +62,11 @@ public class QuestionInfo implements Serializable {
      */
     private Integer controlType;
 
+    /**
+     * 输入框的格式
+     */
+    private Integer inputFormat;
+
     /**
      * 子类型,(31:既往史 32:家族史 33:个人史 34:月经史 35:婚育史)
      */

+ 5 - 0
icss-service/src/main/java/com/diagbot/facade/QuestionFacade.java

@@ -50,6 +50,11 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
             res.setQuestionDetailList(questionDetailList);
         }
 
+        //获取同级标签
+//        List<QuestionInfo> questionRelation = this.getByQuestionRelation(paramMap);
+//        List<QuestionDTO> questionRelationDTO = BeanUtil.listCopyTo(questionRelation, QuestionDTO.class);
+//        res.setQuestionRelationList(questionRelationDTO);
+
         //获取子标签
         List<QuestionInfo> questionMapping = this.getByQuestionMapping(paramMap);
         List<QuestionDTO> sonQuestionList = BeanUtil.listCopyTo(questionMapping, QuestionDTO.class);

+ 8 - 0
icss-service/src/main/java/com/diagbot/mapper/QuestionInfoMapper.java

@@ -31,4 +31,12 @@ public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
      * @return
      */
     public List<QuestionInfo> getByQuestionMapping(Map map);
+
+    /**
+     *  根据questionRelation获取标签信息
+     * @param map 参数
+     * @return
+     */
+    public List<QuestionInfo> getByQuestionRelation(Map map);
+
 }

+ 8 - 0
icss-service/src/main/java/com/diagbot/service/QuestionInfoService.java

@@ -30,4 +30,12 @@ public interface QuestionInfoService extends IService<QuestionInfo> {
      * @return
      */
     public List<QuestionInfo> getByQuestionMapping(Map map);
+
+
+    /**
+     *  根据questionRelation获取标签信息
+     * @param map 参数
+     * @return
+     */
+    public List<QuestionInfo> getByQuestionRelation(Map map);
 }

+ 5 - 0
icss-service/src/main/java/com/diagbot/service/impl/QuestionInfoServiceImpl.java

@@ -29,4 +29,9 @@ public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, Que
     public List<QuestionInfo> getByQuestionMapping(Map map) {
         return baseMapper.getByQuestionMapping(map);
     }
+
+    @Override
+    public List<QuestionInfo> getByQuestionRelation(Map map) {
+        return baseMapper.getByQuestionRelation(map);
+    }
 }

+ 18 - 1
icss-service/src/main/resources/mapper/QuestionInfoMapper.xml

@@ -6,12 +6,13 @@
     <resultMap id="BaseResultMap" type="com.diagbot.entity.QuestionInfo">
         <id column="id" property="id" />
         <result column="name" property="name" />
-        <result column="show_name" property="showName" />
+        <result column="tag_name" property="tagName" />
         <result column="sex_type" property="sexType" />
         <result column="age_begin" property="ageBegin" />
         <result column="age_end" property="ageEnd" />
         <result column="type" property="type" />
         <result column="control_type" property="controlType" />
+        <result column="input_format" property="inputFormat" />
         <result column="sub_type" property="subType" />
         <result column="is_group" property="isGroup" />
         <result column="add_line" property="addLine" />
@@ -52,4 +53,20 @@
         order by m.order_no
     </select>
 
+
+
+    <select id="getByQuestionRelation" parameterType="java.util.Map" resultMap="BaseResultMap">
+        select t.* from icss_question_info t, icss_question_relation r
+        where t.is_deleted = 'N' and r.is_deleted = 'N' and r.sibling_question = t.id
+        and r.curent_question = #{id}
+        <if test="sexType != null">
+            and t.sex_type in (3, #{sexType})
+        </if>
+        <if test="age != null">
+            <![CDATA[ and t.age_begin <= #{age} ]]>
+            <![CDATA[ and t.age_end >= #{age} ]]>
+        </if>
+        order by r.order_no
+    </select>
+
 </mapper>