select if(LOCATE('其他'),'其他',tpr.contents) as content,count(*) as nums from t_patient_information tpi left join t_patient_record tpr on tpi.id=tpr.patient_id and tpr.rec_status=0
<iftest="testQuestionsId!=null and testQuestionsId!=0">
select if(locate('其他',tpr.contents),'其他',tpr.contents) as content,count(*) as nums from t_patient_information tpi left join t_patient_record tpr on tpi.id=tpr.patient_id and tpr.rec_status=0
where tpi.rec_status=0
<iftest="testQuestionsId!=null and testQuestionsId!=0">
and tpr.test_questions_id=#{testQuestionsId}
</if>
</if>
<iftest="testQuestionsId==null or testQuestionsId==0">
SELECT
'' as content,
count( * ) AS nums
FROM
t_patient_information tpi
WHERE
tpi.rec_status = 0
</if>
and tpi.id in (
SELECT
tpi.id
@ -224,7 +236,7 @@
)
</if>
)
<iftest="testQuestionsId!=null">
<iftest="testQuestionsId!=null and testQuestionsId!=0">