|
@ -123,7 +123,8 @@ |
|
|
|
|
|
|
|
|
<select id="getQuestionByCodeAndPatientId" resultMap="getQuestionByCodeAndPatientId"> |
|
|
<select id="getQuestionByCodeAndPatientId" resultMap="getQuestionByCodeAndPatientId"> |
|
|
SELECT |
|
|
SELECT |
|
|
* |
|
|
*, |
|
|
|
|
|
tpr.contents AS explains |
|
|
FROM |
|
|
FROM |
|
|
( |
|
|
( |
|
|
SELECT |
|
|
SELECT |
|
@ -146,7 +147,6 @@ |
|
|
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, |
|
|
r.contents as answer, |
|
|
r.contents as answer, |
|
|
if(r.contents_type = 2,r.contents,null) as explains, |
|
|
|
|
|
|
|
|
|
|
|
if(r.contents_type = 1 and SUBSTRING_INDEX(r.contents,':',1) = o.submit_value, |
|
|
if(r.contents_type = 1 and SUBSTRING_INDEX(r.contents,':',1) = o.submit_value, |
|
|
SUBSTRING(r.contents,char_length(o.submit_value)+2),null |
|
|
SUBSTRING(r.contents,char_length(o.submit_value)+2),null |
|
@ -163,8 +163,15 @@ |
|
|
and q.rec_status = 0 |
|
|
and q.rec_status = 0 |
|
|
and q.`code` = #{code} |
|
|
and q.`code` = #{code} |
|
|
|
|
|
|
|
|
)a |
|
|
) qq, |
|
|
ORDER BY a.qsort,a.osort,a.choose DESC,-a.otherInformation DESC |
|
|
t_patient_record tpr |
|
|
|
|
|
where |
|
|
|
|
|
tpr.test_questions_id = qq.qid |
|
|
|
|
|
AND tpr.contents_type = 2 |
|
|
|
|
|
AND tpr.patient_id = #{patientId} |
|
|
|
|
|
AND tpr.collect_time = #{nums} |
|
|
|
|
|
AND tpr.rec_status = 0 |
|
|
|
|
|
ORDER BY qq.qsort,qq.osort,qq.choose DESC,-qq.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"> |
|
|