|
|
|
@ -765,6 +765,35 @@ group by ee.id |
|
|
|
ORDER BY a.qsort,a.sort |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryZytzbsScaleAnswer" resultMap="queryReportAnswer"> |
|
|
|
SELECT |
|
|
|
cst.consti_name AS parentCode, |
|
|
|
q.type, |
|
|
|
q.operate_type AS operateType, |
|
|
|
q.question AS questionName, |
|
|
|
o.display AS answer, |
|
|
|
a.option_id AS optionId, |
|
|
|
q.id as questionId, |
|
|
|
a.score, |
|
|
|
(select path from ems_patient_recording where question_id = q.id and evaluation_id = #{evaluationId}) AS recordingPath |
|
|
|
FROM |
|
|
|
qms_scale s |
|
|
|
LEFT JOIN tzbs_qms_scale_consti cst ON s.CODE = cst.scale_code |
|
|
|
LEFT JOIN tzbs_qms_scale_cognitive rel ON cst.consti_code = rel.consti_code |
|
|
|
LEFT JOIN qms_question q ON rel.ques_code = q.question_code |
|
|
|
LEFT JOIN (select * from ams_patient_answer_score where evaluation_id = #{evaluationId}) a ON a.question_id = q.id |
|
|
|
LEFT JOIN qms_question_option o ON a.option_id = o.id |
|
|
|
WHERE |
|
|
|
s.del_flag = 0 |
|
|
|
AND s.`code` = #{scaleCode} |
|
|
|
AND (q.sex = #{sex} OR q.sex IS NULL) |
|
|
|
ORDER BY |
|
|
|
cst.consti_code |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
<resultMap id="QuestionMap" type="com.ccsens.system.domain.vo.RmsVo$QuestionAndAnswer"> |
|
|
|
<id column="id" property="id"/> |
|
|
|
<result column="question" property="question"/> |
|
|
|
@ -1489,6 +1518,31 @@ group by ee.id |
|
|
|
GROUP BY qq.id |
|
|
|
ORDER BY qq.sort |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryReportQuestionAndAnswer1" |
|
|
|
resultType="com.ccsens.system.domain.vo.ReportDetailVo$QuestionInfo"> |
|
|
|
SELECT |
|
|
|
cst.consti_name as parentCode, |
|
|
|
|
|
|
|
q.question as questionName, |
|
|
|
a.answer, |
|
|
|
a.score |
|
|
|
FROM |
|
|
|
qms_scale s |
|
|
|
LEFT JOIN tzbs_qms_scale_consti cst ON s.CODE = cst.scale_code |
|
|
|
AND cst.del_flag = 0 |
|
|
|
LEFT JOIN tzbs_qms_scale_cognitive rel ON cst.consti_code = rel.consti_code |
|
|
|
AND rel.del_flag = 0 |
|
|
|
LEFT JOIN qms_question q ON rel.ques_code = q.question_code and q.del_flag = 0 |
|
|
|
LEFT JOIN ams_patient_answer_score a ON a.question_id = q.id and a.del_flag = 0 |
|
|
|
where |
|
|
|
s.del_flag = 0 and |
|
|
|
a.evaluation_id = 2013641875419959296 and s.`code` = "TZBS_BZ" |
|
|
|
-- and q.sex = #{sex} or q.sex is null |
|
|
|
ORDER BY |
|
|
|
cst.consti_code |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="queryReportGroupCognitiveAndAnswer" |
|
|
|
resultType="com.ccsens.system.domain.vo.ReportDetailVo$GroupCognitive"> |
|
|
|
WITH RECURSIVE t as ( |
|
|
|
|