xiangpei
2024-05-22 73ff2a87258203049fc8d885709273eedfacd526
src/main/resources/mapper/QuestionMapper.xml
@@ -249,16 +249,18 @@
    <select id="export" resultMap="exportMap">
        SELECT
        DISTINCT
        q.*, 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.questionType != null">
                q.question_type = #{query.questionType}
            </if>
            <if test="query.start != null and query.end != null">
                q.create_time between #{query.start} and #{query.end}
            <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>
@@ -297,7 +299,8 @@
        </foreach>
    </select>
    <select id="selectQuestion" resultType="com.mindskip.xzs.viewmodel.student.question.answer.QuestionPageStudentResponseVM">
    <select id="selectQuestion"
            resultType="com.mindskip.xzs.viewmodel.student.question.answer.QuestionPageStudentResponseVM">
        select a.id,
               a.question_type,
               JSON_VALUE(d.content, '$.titleContent') as shortTitle,
@@ -314,23 +317,19 @@
    </select>
    <select id="selectContentById" resultType="com.mindskip.xzs.domain.vo.QuestionVO">
        SELECT
            tq.id,
        SELECT tq.id,
            tq.question_type as questionType,
            tq.difficult,
            ttc.content as contentJson,
            tq.correct
        FROM
            t_question tq
        FROM t_question tq
            INNER JOIN t_text_content ttc ON tq.info_text_content_id = ttc.id AND tq.id = #{id}
    </select>
    <select id="getAnswer" resultType="com.mindskip.xzs.domain.vo.QuestionVO">
        SELECT
            tq.correct,
        SELECT tq.correct,
            ttc.content as contentJson
        FROM
            t_question tq
        FROM t_question tq
                INNER JOIN t_text_content ttc ON tq.info_text_content_id = ttc.id AND tq.id = #{id} AND tq.deleted = 0
    </select>