<iftest="testQuestionsId!=null and testQuestionsId!=0">
select if(locate('其他',tpr.contents),'其他',tpr.contents) as content,count(distinct tpr.patient_id) as nums from t_patient_information tpi left join t_patient_record tpr on tpi.id=tpr.patient_id and tpr.rec_status=0
select if( tpr.contents_type =1,'其他',tpr.contents) as content,count(distinct tpr.patient_id) as nums from t_patient_information tpi left join t_patient_record tpr on tpi.id=tpr.patient_id and tpr.rec_status=0 and tpr.contents_type != 2
where tpi.rec_status=0
<iftest="testQuestionsId!=null and testQuestionsId!=0">
and tpr.test_questions_id=#{testQuestionsId}
</if>
@ -209,6 +210,7 @@
WHERE
tpr.rec_status = 0
AND tpr.test_questions_id = #{item.testQuestionsId}
and tpr.contents_type != 2
<iftest="item.contents!=null and item.contents!=''">
AND tpr.contents LIKE concat('%',#{item.contents},'%')
</if>
@ -224,6 +226,7 @@
WHERE
tpr.rec_status = 0
AND tpr.test_questions_id = #{item1.testQuestionsId}
and tpr.contents_type != 2
<iftest="item1.startTime!=null and item1.startTime!=''">