| | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="exportData" resultMap="exportDataMap"> |
| | | SELECT |
| | | DISTINCT |
| | | q.id, |
| | | q.question_type, |
| | | q.correct as answer, |
| | | ttc.content |
| | | FROM |
| | | t_question q |
| | | INNER JOIN t_text_content ttc on q.info_text_content_id = ttc.id AND q.deleted = 0 |
| | | INNER JOIN t_question_subject tqs on q.id = tqs.question_id |
| | | <where> |
| | | <if test="query.subjectIds != null and query.subjectIds.size > 0"> |
| | | AND tqs.subject_id IN |
| | | <foreach collection="query.subjectIds" open="(" separator="," close=")" item="subjectId"> |
| | | #{subjectId} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <resultMap id="exportDataMap" type="com.mindskip.xzs.vo.QuestionExportData"> |
| | | <result column="question_type" property="questionType"/> |
| | | <result column="title" property="title"/> |
| | | <result column="analyze" property="analyze"/> |
| | | <result column="content" property="content"/> |
| | | <result column="correct" property="answer"/> |
| | | <collection property="subjectList" column="id" ofType="string" select="selectSubjects"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="exportMap" type="com.mindskip.xzs.vo.QuestionImportVO"> |
| | | <result column="question_type" property="questionType"/> |
| | | <result column="title" property="title"/> |
| | |
| | | ON tqs.subject_id = ts.id AND tqs.question_id = #{id} AND tqs.deleted = 0 AND ts.deleted = 0 |
| | | </select> |
| | | |
| | | <select id="getQuestionSubjects" resultType="string"> |
| | | SELECT ts.name |
| | | FROM t_question_subject tqs |
| | | INNER JOIN t_subject ts |
| | | ON tqs.subject_id = ts.id AND tqs.question_id = #{questionId} AND tqs.deleted = 0 AND ts.deleted = 0 |
| | | </select> |
| | | |
| | | <select id="getVoByIds" resultType="com.mindskip.xzs.domain.vo.QuestionVO"> |
| | | SELECT |
| | | tq.id, |