<iftest="testQuestionsId!=null and testQuestionsId!=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
select 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 =0
where tpi.rec_status=0
<iftest="testQuestionsId!=null and testQuestionsId!=0">
@ -210,7 +217,7 @@
WHERE
tpr.rec_status = 0
AND tpr.test_questions_id = #{item.testQuestionsId}
and tpr.contents_type != 2
and tpr.contents_type =0
<iftest="item.contents!=null and item.contents!=''">
AND tpr.contents LIKE concat('%',#{item.contents},'%')
</if>
@ -226,7 +233,7 @@
WHERE
tpr.rec_status = 0
AND tpr.test_questions_id = #{item1.testQuestionsId}
and tpr.contents_type != 2
and tpr.contents_type = 0
<iftest="item1.startTime!=null and item1.startTime!=''">