|
|
@ -211,5 +211,79 @@ |
|
|
|
q.rec_status = 0 |
|
|
|
and q.relevance_option_id = #{optionId} |
|
|
|
</select> |
|
|
|
<resultMap id="queryQuestionMap" type="com.ccsens.tcm.bean.vo.QuestionVo$subjectLists"> |
|
|
|
<id column="id" property="id"/> |
|
|
|
<result column="code" property="code"/> |
|
|
|
<result column="name" property="name"/> |
|
|
|
<collection property="optionVos" ofType="com.ccsens.tcm.bean.vo.QuestionVo$subjectLists"> |
|
|
|
<id column="id1" property="id"/> |
|
|
|
<result column="code" property="code"/> |
|
|
|
<result column="name" property="name"/> |
|
|
|
<collection property="questiTonVos" ofType="com.ccsens.tcm.bean.vo.QuestionVo$TopictQuestion"> |
|
|
|
<id property="id" column="id2"/> |
|
|
|
<result column="question" property="question"/> |
|
|
|
<result column="sort" property="sort"/> |
|
|
|
<result column="units" property="units"/> |
|
|
|
<result column="type" property="type"/> |
|
|
|
<result column="remark" property="remark"/> |
|
|
|
</collection> |
|
|
|
</collection> |
|
|
|
</resultMap> |
|
|
|
<select id="queryQuestion" resultMap="queryQuestionMap"> |
|
|
|
SELECT |
|
|
|
trc.id, |
|
|
|
trc.`code`, |
|
|
|
trc.`name`, |
|
|
|
trc1.id AS id1, |
|
|
|
trc1.`code` AS code1, |
|
|
|
trc1.`name` AS name1, |
|
|
|
tq.id AS id2, |
|
|
|
tq.question, |
|
|
|
tq.sort, |
|
|
|
tq.units, |
|
|
|
tq.type, |
|
|
|
tq.remark |
|
|
|
FROM |
|
|
|
t_report_code trc |
|
|
|
LEFT JOIN t_report_code trc1 ON trc1.parent_code = trc.CODE |
|
|
|
AND trc1.LEVEL = 2 |
|
|
|
AND trc1.rec_status = 0 |
|
|
|
LEFT JOIN t_question tq ON tq.CODE = trc1.CODE |
|
|
|
AND tq.rec_status = 0 |
|
|
|
WHERE |
|
|
|
trc.LEVEL = 1 |
|
|
|
AND trc.rec_status =0 |
|
|
|
</select> |
|
|
|
<resultMap id="queryQuestion1Map" type="com.ccsens.tcm.bean.vo.QuestionVo$subjectLists"> |
|
|
|
<id column="id" property="id"/> |
|
|
|
<result column="code" property="code"/> |
|
|
|
<result column="name" property="name"/> |
|
|
|
<collection property="questiTonVos" ofType="com.ccsens.tcm.bean.vo.QuestionVo$TopictQuestion"> |
|
|
|
<id property="id" column="id2"/> |
|
|
|
<result column="question" property="question"/> |
|
|
|
<result column="sort" property="sort"/> |
|
|
|
<result column="units" property="units"/> |
|
|
|
<result column="type" property="type"/> |
|
|
|
<result column="remark" property="remark"/> |
|
|
|
</collection> |
|
|
|
</resultMap> |
|
|
|
<select id="queryQuestion1" resultMap="queryQuestion1Map"> |
|
|
|
select trc.id, |
|
|
|
trc.`code`, |
|
|
|
trc.`name`, |
|
|
|
tq.id AS id2, |
|
|
|
tq.question, |
|
|
|
tq.sort, |
|
|
|
tq.units, |
|
|
|
tq.type, |
|
|
|
tq.remark |
|
|
|
FROM |
|
|
|
t_report_code trc, t_question tq |
|
|
|
WHERE |
|
|
|
trc.LEVEL = 1 |
|
|
|
AND trc.rec_status =0 |
|
|
|
and tq.CODE = trc.CODE |
|
|
|
AND tq.rec_status = 0 |
|
|
|
</select> |
|
|
|
|
|
|
|
</mapper> |