|
@ -122,6 +122,10 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getQuestionByCodeAndPatientId" resultMap="getQuestionByCodeAndPatientId"> |
|
|
<select id="getQuestionByCodeAndPatientId" resultMap="getQuestionByCodeAndPatientId"> |
|
|
|
|
|
SELECT |
|
|
|
|
|
* |
|
|
|
|
|
FROM |
|
|
|
|
|
( |
|
|
SELECT |
|
|
SELECT |
|
|
q.id as qid, |
|
|
q.id as qid, |
|
|
q.question as qquestion, |
|
|
q.question as qquestion, |
|
@ -134,7 +138,10 @@ |
|
|
o.show_value as oshow_value, |
|
|
o.show_value as oshow_value, |
|
|
o.submit_value as osubmit_value, |
|
|
o.submit_value as osubmit_value, |
|
|
o.after_operation as oafter_operation, |
|
|
o.after_operation as oafter_operation, |
|
|
if(q.type > 2 and q.type <13 and q.type != 6,if(o.submit_value = r.contents,true,false),null) as choose, |
|
|
IF (q.type > 2 AND q.type < 13 AND q.type != 6, |
|
|
|
|
|
IF ((o.submit_value = r.contents) or(r.contents_type = 1 AND SUBSTRING_INDEX( r.contents, ':', 1 ) = o.submit_value), TRUE, FALSE ), |
|
|
|
|
|
NULL |
|
|
|
|
|
) AS choose, |
|
|
r.patient_id, |
|
|
r.patient_id, |
|
|
r.id as recordId, |
|
|
r.id as recordId, |
|
|
if(r.collect_time is null, 0,r.collect_time) as collect_time, |
|
|
if(r.collect_time is null, 0,r.collect_time) as collect_time, |
|
@ -155,6 +162,9 @@ |
|
|
q.relevance_option_id = 0 |
|
|
q.relevance_option_id = 0 |
|
|
and q.rec_status = 0 |
|
|
and q.rec_status = 0 |
|
|
and q.`code` = #{code} |
|
|
and q.`code` = #{code} |
|
|
|
|
|
|
|
|
|
|
|
)a |
|
|
|
|
|
ORDER BY a.qsort,a.osort,a.choose DESC,-a.otherInformation DESC |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<resultMap id="getQuestionByOptionId" type="com.ccsens.tcm.bean.vo.QuestionVo$PatientQuestion"> |
|
|
<resultMap id="getQuestionByOptionId" type="com.ccsens.tcm.bean.vo.QuestionVo$PatientQuestion"> |
|
|