xiangpei
2024-06-05 7457e3aa4f2e0f640a08b35f47de1eabd555d7bf
src/main/resources/mapper/QuestionMapper.xml
@@ -32,20 +32,20 @@
        LEFT JOIN t_subject ts ON tq.subject_id = ts.id
        LEFT JOIN t_user tu ON tq.create_user = tu.id
        <where>
            and tq.deleted=0
            <if test="id != null ">
                and tq.id= #{id}
            and tq.deleted = 0
            <if test="id != null">
                and tq.id = #{id}
            </if>
            <if test="level != null ">
                and tq.grade_level= #{level}
            <if test="status != null">
                and tq.status = #{status}
            </if>
            <if test="subjectId != null ">
                and tq.subject_id= #{subjectId}
            <if test="subjectId != null and subjectId.size() > 0">
                and tq.subject_id in <foreach collection="subjectId" item="item" separator="," open="(" close=")"> #{item} </foreach>
            </if>
            <if test="questionType != null ">
                and tq.question_type= #{questionType}
            <if test="questionType != null and questionType.size() > 0">
                and tq.question_type in <foreach collection="questionType" item="item" separator="," open="(" close=")"> #{item} </foreach>
            </if>
            <if test="content != null">
            <if test="content != null and content != ''">
                and instr(tq.content, #{content})
            </if>
        </where>