|
@@ -15,4 +15,56 @@
|
|
<result column="remark" property="remark" />
|
|
<result column="remark" property="remark" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
+ <select id="getSymptopInfo" resultType="com.diagbot.dto.RetrievalDTO">
|
|
|
|
+ SELECT c.`name`,c.id as questionId FROM icss_retrieval a
|
|
|
|
+ LEFT JOIN icss_retrieval_mapping b ON a.id = b.retrieval_id
|
|
|
|
+ LEFT JOIN icss_question_info c ON b.question_id = c.id
|
|
|
|
+ WHERE a.is_deleted = 'N' AND b.is_deleted = 'N' AND c.is_deleted = 'N'
|
|
|
|
+ AND (a.spell = #{InputStr} or a.`name` = #{InputStr})
|
|
|
|
+ AND c.type = #{type}
|
|
|
|
+ <if test="age != null and age != ''">
|
|
|
|
+ <![CDATA[ and c.age_begin <= #{age} ]]>
|
|
|
|
+ <![CDATA[ and c.age_end >= #{age} ]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sexType == 3">
|
|
|
|
+ and c.sex_type in ('1','2','3')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sexType != 3">
|
|
|
|
+ and c.sex_type in ('3',#{sexType})
|
|
|
|
+ </if>
|
|
|
|
+ UNION
|
|
|
|
+ SELECT c.`name`,c.id as questionId FROM icss_retrieval a
|
|
|
|
+ LEFT JOIN icss_retrieval_mapping b ON a.id = b.retrieval_id
|
|
|
|
+ LEFT JOIN icss_question_info c ON b.question_id = c.id
|
|
|
|
+ WHERE a.is_deleted = 'N' AND b.is_deleted = 'N' AND c.is_deleted = 'N'
|
|
|
|
+ AND (a.spell LIKE CONCAT(#{InputStr},'%') or a.`name` LIKE CONCAT(#{InputStr},'%'))
|
|
|
|
+ AND c.type = #{type}
|
|
|
|
+ <if test="age != null and age != ''">
|
|
|
|
+ <![CDATA[ and c.age_begin <= #{age} ]]>
|
|
|
|
+ <![CDATA[ and c.age_end >= #{age} ]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sexType == 3">
|
|
|
|
+ and c.sex_type in ('1','2','3')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sexType != 3">
|
|
|
|
+ and c.sex_type in ('3',#{sexType})
|
|
|
|
+ </if>
|
|
|
|
+ UNION
|
|
|
|
+ SELECT c.`name`,c.id as questionId FROM icss_retrieval a
|
|
|
|
+ LEFT JOIN icss_retrieval_mapping b ON a.id = b.retrieval_id
|
|
|
|
+ LEFT JOIN icss_question_info c ON b.question_id = c.id
|
|
|
|
+ WHERE a.is_deleted = 'N' AND b.is_deleted = 'N' AND c.is_deleted = 'N'
|
|
|
|
+ AND (a.spell LIKE CONCAT('%',#{InputStr},'%') or a.`name` LIKE CONCAT('%',#{InputStr},'%'))
|
|
|
|
+ AND c.type = #{type}
|
|
|
|
+ <if test="age != null and age != ''">
|
|
|
|
+ <![CDATA[ and c.age_begin <= #{age} ]]>
|
|
|
|
+ <![CDATA[ and c.age_end >= #{age} ]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sexType == 3">
|
|
|
|
+ and c.sex_type in ('1','2','3')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sexType != 3">
|
|
|
|
+ and c.sex_type in ('3',#{sexType})
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|