|
@@ -71,6 +71,29 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
+ <if test="filter != null and filter == 1">
|
|
|
+ and a.id not in
|
|
|
+ (
|
|
|
+ select DISTINCT cases_entry_id from (
|
|
|
+ select aa.id,substring_index(substring_index(aa.cases_entry_ids,',',bb.help_topic_id+1),',',-1) cases_entry_id
|
|
|
+ from
|
|
|
+ qc_question_info aa
|
|
|
+ join
|
|
|
+ <![CDATA[
|
|
|
+ mysql.help_topic bb
|
|
|
+ on bb.help_topic_id < (length(aa.cases_entry_ids) - length(replace(aa.cases_entry_ids,',',''))+1)
|
|
|
+ ]]>
|
|
|
+ where aa.is_deleted = 'N'
|
|
|
+ <if test="hospitalId != null">
|
|
|
+ AND aa.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="modeId != null and modeId != ''">
|
|
|
+ AND aa.mode_id = #{modeId}
|
|
|
+ </if>
|
|
|
+ ) tt
|
|
|
+ where tt.cases_entry_id != ''
|
|
|
+ )
|
|
|
+ </if>
|
|
|
ORDER BY a.cases_id,a.id
|
|
|
</select>
|
|
|
|