|
@@ -43,4 +43,28 @@
|
|
|
order by m.parent_question, m.order_no
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getByCaseEntryIds" resultType="com.diagbot.dto.QuestionEntryDTO">
|
|
|
+ select * from (
|
|
|
+ select a.id,substring_index(substring_index(a.cases_entry_ids,',',b.help_topic_id+1),',',-1) cases_entry_id
|
|
|
+ from
|
|
|
+ qc_question_info a
|
|
|
+ join
|
|
|
+ <![CDATA[
|
|
|
+ mysql.help_topic b
|
|
|
+ on b.help_topic_id < (length(a.cases_entry_ids) - length(replace(a.cases_entry_ids,',',''))+1)
|
|
|
+ ]]>
|
|
|
+ where a.is_deleted = 'N'
|
|
|
+ <if test="hospitalId != null">
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ order by a.ID) t
|
|
|
+ where t.cases_entry_id != ''
|
|
|
+ <if test="casesEntryIds != null and casesEntryIds.size > 0">
|
|
|
+ and t.cases_entry_id in
|
|
|
+ <foreach collection="casesEntryIds" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|