| | |
| | | ) |
| | | </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 |
| | |
| | | |
| | | |
| | | <select id="selectAllCount" resultType="java.lang.Integer"> |
| | | SELECT count(*) from t_exam_paper_answer |
| | | select count(*) from t_exam_paper_answer a |
| | | inner join |
| | | (select user_id from t_user_department |
| | | <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> |
| | | |
| | | |
| | |
| | | FROM |
| | | t_exam_paper_answer a |
| | | INNER JOIN (SELECT * FROM t_user_department |
| | | <if test="departmentId != null and departmentId != ''"> |
| | | WHERE department_id = #{departmentId} |
| | | <if test="departmentId != null and departmentId.size() > 0"> |
| | | WHERE department_id IN |
| | | <foreach collection="departmentId" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY user_id) b ON a.create_user = b.user_id |
| | | LEFT JOIN t_user c ON a.create_user = c.id |
| | |
| | | </if> |
| | | LEFT JOIN t_exam_paper_answer c ON a.exam_paper_id = c.exam_paper_id AND a.user_id = c.create_user AND (c.invalid IS NULL OR c.invalid = 0) |
| | | INNER JOIN (SELECT * FROM t_user_department |
| | | <if test="departmentId != null and departmentId != ''"> |
| | | WHERE department_id = #{departmentId} |
| | | <if test="departmentId != null and departmentId.size() > 0"> |
| | | WHERE department_id IN |
| | | <foreach collection="departmentId" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY user_id) d ON a.user_id = d.user_id |
| | | </select> |