|
|
@ -149,7 +149,7 @@ |
|
|
|
if(r.contents_type = 2,r.contents,null) as explains, |
|
|
|
|
|
|
|
if(r.contents_type = 1 and SUBSTRING_INDEX(r.contents,':',1) = o.submit_value, |
|
|
|
SUBSTRING(r.contents,char_length(o.submit_value)+1),null |
|
|
|
SUBSTRING(r.contents,char_length(o.submit_value)+2),null |
|
|
|
) as otherInformation |
|
|
|
FROM |
|
|
|
t_question q |
|
|
@ -189,6 +189,10 @@ |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<select id="getQuestionByOptionId" resultMap="getQuestionByOptionId"> |
|
|
|
SELECT |
|
|
|
* |
|
|
|
FROM |
|
|
|
( |
|
|
|
SELECT |
|
|
|
q.id as qid, |
|
|
|
q.question as qquestion, |
|
|
@ -201,14 +205,16 @@ |
|
|
|
o.show_value as oshow_value, |
|
|
|
o.submit_value as osubmit_value, |
|
|
|
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.id as recordId, |
|
|
|
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, |
|
|
|
SUBSTRING(r.contents,char_length(o.submit_value)+1),null |
|
|
|
SUBSTRING(r.contents,char_length(o.submit_value)+2),null |
|
|
|
) as otherInformation |
|
|
|
FROM |
|
|
|
t_question q |
|
|
@ -220,6 +226,8 @@ |
|
|
|
WHERE |
|
|
|
q.rec_status = 0 |
|
|
|
and q.relevance_option_id = #{optionId} |
|
|
|
)a |
|
|
|
ORDER BY a.qsort,a.osort,a.choose DESC,-a.otherInformation DESC |
|
|
|
</select> |
|
|
|
<resultMap id="queryQuestionMap" type="com.ccsens.tcm.bean.vo.QuestionVo$subjectLists"> |
|
|
|
<id column="id" property="id"/> |
|
|
|