@ -99,15 +99,14 @@
and q.relevance_option_id = #{optionId}
</select>
<resultMap id= "getQuestionByCodeAndPatientId" type= "com.ccsens.tcm.bean.vo.QuestionVo$PatientQuestionNum" >
<id column= "collect_time" property= "reportNums" />
<collection property= "questionList" ofType= "com.ccsens.tcm.bean.vo.QuestionVo$PatientQuestion" >
<resultMap id= "getQuestionByCodeAndPatientId" type= "com.ccsens.tcm.bean.vo.QuestionVo$PatientQuestion" >
<id column= "qid" jdbcType= "BIGINT" property= "id" />
<result column= "qquestion" jdbcType= "VARCHAR" property= "question" />
<result column= "qsort" jdbcType= "INTEGER" property= "sort" />
<result column= "qunits" jdbcType= "VARCHAR" property= "units" />
<result column= "qtype" jdbcType= "TINYINT" property= "type" />
<result column= "qremark" jdbcType= "VARCHAR" property= "remark" />
<result column= "recordId" jdbcType= "VARCHAR" property= "recordId" />
<result column= "answer" jdbcType= "VARCHAR" property= "answer" />
<collection property= "optionVos" ofType= "com.ccsens.tcm.bean.vo.QuestionVo$PatientOption" >
<id column= "oid" jdbcType= "BIGINT" property= "id" />
@ -117,7 +116,6 @@
<result column= "oafter_operation" jdbcType= "TINYINT" property= "afterOperation" />
<result column= "choose" jdbcType= "TINYINT" property= "choose" />
</collection>
</collection>
</resultMap>
@ -134,10 +132,11 @@
o.show_value as oshow_value,
o.submit_value as osubmit_value,
o.after_operation as oafter_operation,
if(o.submit_value = r.contents,true,false) as choose,
if(q.type > 2 and q.type < 13 and q.type != 6,if( o.submit_value = r.contents,true,false),null ) as choose,
r.patient_id,
r.id as recordId,
if(r.collect_time is null, 0,r.collect_time) as collect_time,
if(LEFT(r.contents,3) = '其他:',SUBSTRING(r.contents,4),'' ) as answer
if(LEFT(r.contents,3) = '其他:',SUBSTRING(r.contents,4),r.contents ) as answer
FROM
t_question q
LEFT JOIN t_question_option o on q.id = o.question_id and o.rec_status = 0
@ -158,6 +157,7 @@
<result column= "qunits" jdbcType= "VARCHAR" property= "units" />
<result column= "qtype" jdbcType= "TINYINT" property= "type" />
<result column= "qremark" jdbcType= "VARCHAR" property= "remark" />
<result column= "recordId" jdbcType= "VARCHAR" property= "recordId" />
<result column= "answer" jdbcType= "VARCHAR" property= "answer" />
<collection property= "optionVos" ofType= "com.ccsens.tcm.bean.vo.QuestionVo$PatientOption" >
<id column= "oid" jdbcType= "BIGINT" property= "id" />
@ -182,9 +182,10 @@
o.show_value as oshow_value,
o.submit_value as osubmit_value,
o.after_operation as oafter_operation,
if(o.submit_value = r.contents,true,false) as choose,
if(q.type > 2 and q.type < 13 and q.type != 6,if( o.submit_value = r.contents,true,false),null ) as choose,
r.patient_id,
if(LEFT(r.contents,3) = '其他:',SUBSTRING(r.contents,4),'') as answer
r.id as recordId,
if(LEFT(r.contents,3) = '其他:',SUBSTRING(r.contents,4),r.contents) as answer
FROM
t_question q
LEFT JOIN t_question_option o on q.id = o.question_id and o.rec_status = 0
@ -193,8 +194,7 @@
and collect_time = #{nums}
</if>
WHERE
q.relevance_option_id = 0
and q.rec_status = 0
q.rec_status = 0
and q.relevance_option_id = #{optionId}
</select>