龚焕茏
2024-05-17 6bf6111fdd4245cf6f4c5cfad9314fe8d570bd98
src/main/resources/mapper/ExamPaperAnswerMapper.xml
@@ -242,6 +242,21 @@
    )
  </update>
  <update id="setMissExamByTemplate">
    update t_exam_paper_answer
    set invalid = 1
    where exam_paper_id
      in
    <foreach collection="paperIds" item="item" separator="," open="(" close=")">
      #{item}
    </foreach>
    and create_user in (
    <foreach collection="userIds" item="item" index="index" separator=",">
      #{item}
    </foreach>
    )
  </update>
    <select id="studentPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageVM">
    SELECT
@@ -260,12 +275,12 @@
       select count(*) from t_exam_paper_answer a
        inner join
        (select user_id from t_user_department
        <where>
            and department_id in
            <foreach collection="deptIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </where>
        <if test="deptIds != null and deptIds.size() > 0">
          where department_id in
          <foreach collection="deptIds" item="item" open="(" separator="," close=")">
              #{item}
          </foreach>
        </if>
        group by user_id)
        b on a.create_user = b.user_id
  </select>