@@ -20,7 +20,7 @@ public interface PaperDao extends BaseMapper<PaperEntity> {
IPage<PaperVo> page(Page<PaperVo> page,@Param(value = "req") PaperQuery query);
- List<PaperVo> list(@Param(value = "examId")Long examId);
+ List<PaperVo> list(@Param(value = "examId")Long examId,@Param(value = "userId")Long userId);
List<PaperStructInfoVo> subjectiveList(@Param(value = "req")PaperQuery query);
@@ -251,7 +251,7 @@ public class PaperServiceImpl extends ServiceImpl<PaperDao, PaperEntity> impleme
if (!user.getRole().equals(Role.SUPER_ADMIN) && !user.getSchoolId().equals(exam.getSchoolId())) {
throw new StatusException("没有权限");
}
- return this.baseMapper.list(examId);
+ return this.baseMapper.list(examId,user.getId());
@Override
@@ -50,7 +50,7 @@
t.course_id=c.id
left join mps_exam e on t.exam_id=e.id
where t.exam_id
- =#{examId}
+ =#{examId} and exists (select 1 from mps_user_course_relation m where m.user_id=#{userId} and m.course_id=t.course_id)
order by t.update_time desc
</select>