xiangpei
2025-05-14 47cd9ecc0eff38ffe6b3b794b2bf197e958f4403
src/main/resources/mapper/ExamPaperMapper.xml
@@ -442,11 +442,12 @@
  </select>
  <select id="getRandomPaperExcelById" resultType="com.mindskip.xzs.domain.vo.PaperExcelVO" parameterType="java.lang.Integer">
    select u.real_name as name,a.create_user as userId,a.user_score as userScore,a.paper_score as paperScore
    select u.real_name as name,a.create_user as userId,MAX(a.user_score) as userScore,a.paper_score as paperScore
    from t_exam_paper_answer a
           inner join t_user u on u.id = a.create_user
           inner join t_exam_templates_user_count uc ON a.exam_paper_id = uc.exam_paper_id AND uc.exam_templates_id = #{id}
           inner join t_exam_templates_user_count uc ON a.exam_paper_id = uc.exam_paper_id AND a.create_user = uc.user_id AND uc.exam_templates_id = #{id}
    where a.invalid = 0
    GROUP BY u.real_name, a.create_user, a.paper_score
  </select>
@@ -483,11 +484,9 @@
      where
          user_name != 'admin' and a.status != 2 and a.deleted = 0 and (a.`condition` = 0 or a.`condition` is null)
          <if test="deptIds != null and deptIds.size > 0">
            and c.department_id in
            <foreach collection="deptIds" open="(" separator="," close=")" item="deptId">
              #{deptId}
            </foreach>
            and c.department_id in <foreach collection="deptIds" open="(" separator="," close=")" item="deptId"> #{deptId} </foreach>
          </if>
          <if test="realName"> and INSTR(a.real_name, #{realName}) </if>
      group by a.id, a.real_name
        <if test="(tagIds != null and tagIds.size > 0) or (excludeTagIds != null and excludeTagIds.size > 0)">
        having