xiangpei
2024-10-31 cfe67e8d67bd66c4e95c553cb56aad71dde8dfa2
src/main/resources/mapper/QuestionMapper.xml
@@ -56,6 +56,9 @@
            <if test="content != null and content != ''">
                and instr(tq.content, #{content})
            </if>
            <if test="title != null and title != ''">
                and title like CONCAT('%', #{title}, '%')
            </if>
        </where>
    </select>
@@ -118,4 +121,23 @@
        RAND()
        LIMIT #{num}
    </select>
    <resultMap id="exportDataMap"  type="com.ycl.jxkg.domain.vo.admin.exam.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>
    <select id="export" resultType="com.ycl.jxkg.domain.vo.admin.exam.ExamPaperImportVO">
        SELECT
            q.*,
            s.NAME AS SUBJECT
        FROM t_question q
        LEFT JOIN t_subject s ON subject_id = s.id
        ORDER BY q.id
    </select>
</mapper>