wangliang 4 年之前
父節點
當前提交
7b00f4d2c4

+ 24 - 63
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateCallMobileController.java

@@ -12,11 +12,12 @@ import com.qmth.themis.business.cache.RedisKeyHelper;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.AuthDto;
 import com.qmth.themis.business.dto.MqDto;
-import com.qmth.themis.business.entity.*;
+import com.qmth.themis.business.entity.TBSession;
+import com.qmth.themis.business.entity.TBUser;
+import com.qmth.themis.business.entity.TIeExamInvigilateCall;
+import com.qmth.themis.business.entity.TIeExamInvigilateCallLog;
 import com.qmth.themis.business.enums.*;
 import com.qmth.themis.business.service.MqDtoService;
-import com.qmth.themis.business.service.TBExamInvigilateUserService;
-import com.qmth.themis.business.service.TEExamStudentService;
 import com.qmth.themis.business.service.TIeExamInvigilateCallService;
 import com.qmth.themis.business.util.RedisUtil;
 import com.qmth.themis.business.util.ServletUtil;
@@ -32,8 +33,10 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
-import java.util.*;
-import java.util.stream.Collectors;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
 
 /**
  * @Description: mobile监考监控通话信息 前端控制器
@@ -60,12 +63,6 @@ public class TIeInvigilateCallMobileController {
     @Resource
     TencentYunUtil tencentYunUtil;
 
-    @Resource
-    TBExamInvigilateUserService tbExamInvigilateUserService;
-
-    @Resource
-    TEExamStudentService teExamStudentService;
-
     @ApiOperation(value = "监考监控通话查询接口")
     @RequestMapping(value = "/call/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = TIeExamInvigilateCall.class)})
@@ -73,8 +70,14 @@ public class TIeInvigilateCallMobileController {
         if (Objects.isNull(examId) || Objects.equals(examId, "")) {
             throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
         }
-        Set<Long> examActivityIdSet = this.getExamActivityIds(examId);
-        IPage<TIeExamInvigilateCall> tIeExamInvigilateCallIPage = tIeExamInvigilateCallService.examInvigilateCallQuery(new Page<>(pageNumber, pageSize), examActivityIdSet, MonitorStatusSourceEnum.START.name());
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        AuthDto authDto = (AuthDto) redisUtil.get(SystemConstant.userOauth + "::" + tbUser.getId());
+        //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
+        Long userId = null;
+        if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
+            userId = tbUser.getId();
+        }
+        IPage<TIeExamInvigilateCall> tIeExamInvigilateCallIPage = tIeExamInvigilateCallService.examInvigilateCallQuery(new Page<>(pageNumber, pageSize), examId, userId, tbUser.getOrgId(), MonitorStatusSourceEnum.START.name());
         BasePage basePage = new BasePage(tIeExamInvigilateCallIPage.getRecords(), tIeExamInvigilateCallIPage.getCurrent(), tIeExamInvigilateCallIPage.getSize(), tIeExamInvigilateCallIPage.getTotal());
         return ResultUtil.ok(basePage);
     }
@@ -86,10 +89,14 @@ public class TIeInvigilateCallMobileController {
         if (Objects.isNull(examId) || Objects.equals(examId, "")) {
             throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
         }
-        Set<Long> examActivityIdSet = this.getExamActivityIds(examId);
-        QueryWrapper<TIeExamInvigilateCall> examInvigilateCallQueryWrapper = new QueryWrapper<>();
-        examInvigilateCallQueryWrapper.lambda().in(TIeExamInvigilateCall::getExamActivityId, examActivityIdSet).eq(TIeExamInvigilateCall::getStatus, MonitorStatusSourceEnum.START.name());
-        int count = tIeExamInvigilateCallService.count(examInvigilateCallQueryWrapper);
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        AuthDto authDto = (AuthDto) redisUtil.get(SystemConstant.userOauth + "::" + tbUser.getId());
+        //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
+        Long userId = null;
+        if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
+            userId = tbUser.getId();
+        }
+        int count = tIeExamInvigilateCallService.examInvigilateCallQueryCount(examId, userId, tbUser.getOrgId(), MonitorStatusSourceEnum.START.name());
         return ResultUtil.ok(Collections.singletonMap("count", count));
     }
 
@@ -160,50 +167,4 @@ public class TIeInvigilateCallMobileController {
         map.put("monitorUserSig", monitorUserSig);
         return ResultUtil.ok(map);
     }
-
-    /**
-     * 获取考试批次
-     *
-     * @param examId
-     * @return
-     */
-    public Set<Long> getExamActivityIds(Long examId) {
-        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-        TBSession tbSession = (TBSession) ServletUtil.getRequestSession();
-        if (Objects.isNull(tbSession)) {
-            throw new BusinessException(ExceptionResultEnum.LOGIN_NO);
-        }
-        //首先查询当前用户所要监控的roomCode
-        QueryWrapper<TBExamInvigilateUser> examInvigilateUserQueryWrapper = new QueryWrapper<>();
-        AuthDto authDto = (AuthDto) redisUtil.get(SystemConstant.userOauth + "::" + tbUser.getId());
-        //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
-        examInvigilateUserQueryWrapper.lambda().eq(TBExamInvigilateUser::getOrgId, tbUser.getOrgId())
-                .eq(TBExamInvigilateUser::getExamId, examId);
-        if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
-            examInvigilateUserQueryWrapper.lambda().eq(TBExamInvigilateUser::getUserId, tbUser.getId());
-        }
-        List<TBExamInvigilateUser> tbExamInvigilateUserList = tbExamInvigilateUserService.list(examInvigilateUserQueryWrapper);
-        Set<String> roomCodeSet = null;
-        if (Objects.nonNull(tbExamInvigilateUserList) && tbExamInvigilateUserList.size() > 0) {
-            roomCodeSet = tbExamInvigilateUserList.stream().map(s -> s.getRoomCode()).collect(Collectors.toSet());
-        }
-        if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name()) && (Objects.isNull(roomCodeSet) || roomCodeSet.size() == 0)) {
-            throw new BusinessException("当前监考老师未设置任何监考考场");
-        } else if (Objects.isNull(roomCodeSet) || roomCodeSet.size() == 0) {
-            throw new BusinessException("当前考试批次未设置任何监考考场");
-        }
-        //根据roomCode获取当前老师所要监考的全部应考学生数
-        QueryWrapper<TEExamStudent> teExamStudentQueryWrapper = new QueryWrapper<>();
-        teExamStudentQueryWrapper.lambda().in(TEExamStudent::getRoomCode, roomCodeSet);
-        List<TEExamStudent> teExamStudentList = teExamStudentService.list(teExamStudentQueryWrapper);
-        Set<Long> examActivityIdSet = null;
-        if (Objects.nonNull(teExamStudentList) && teExamStudentList.size() > 0) {
-            examActivityIdSet = new HashSet<>();
-            Set<Long> finalExamActivityIdSet = examActivityIdSet;
-            teExamStudentList.forEach(s -> {
-                finalExamActivityIdSet.add(s.getExamActivityId());
-            });
-        }
-        return examActivityIdSet;
-    }
 }

+ 42 - 5
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateWarnInfoController.java

@@ -1,29 +1,34 @@
 package com.qmth.themis.backend.api;
 
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmth.themis.business.annotation.ApiJsonObject;
+import com.qmth.themis.business.annotation.ApiJsonProperty;
 import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.bean.backend.InvigilateListWarningBean;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.AuthDto;
+import com.qmth.themis.business.dto.response.TIeWarningNotifyDto;
 import com.qmth.themis.business.entity.TBUser;
+import com.qmth.themis.business.entity.TIeInvigilateWarnInfo;
 import com.qmth.themis.business.enums.RoleEnum;
+import com.qmth.themis.business.service.TBExamInvigilateUserService;
+import com.qmth.themis.business.service.TEExamStudentService;
 import com.qmth.themis.business.service.TIeInvigilateWarnInfoService;
 import com.qmth.themis.business.service.TOeExamRecordService;
 import com.qmth.themis.business.util.RedisUtil;
 import com.qmth.themis.business.util.ServletUtil;
-import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
 import io.swagger.annotations.*;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.util.Collections;
+import java.util.Map;
 import java.util.Objects;
 
 /**
@@ -94,4 +99,36 @@ public class TIeInvigilateWarnInfoController {
         BasePage basePage = new BasePage(invigilateListWarningBeanIPage.getRecords(), invigilateListWarningBeanIPage.getCurrent(), invigilateListWarningBeanIPage.getSize(), invigilateListWarningBeanIPage.getTotal());
         return ResultUtil.ok(basePage);
     }
+
+    @ApiOperation(value = "预警消息接口")
+    @RequestMapping(value = "/message", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "预警通知信息", response = TIeWarningNotifyDto.class)})
+    public Result warningMessage(@ApiParam(value = "考试批次id", required = false) @RequestParam(required = false) Long examId) {
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
+        AuthDto authDto = (AuthDto) redisUtil.get(SystemConstant.userOauth + "::" + tbUser.getId());
+        //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
+        Long userId = null;
+        if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
+            userId = tbUser.getId();
+        }
+        return ResultUtil.ok(tIeInvigilateWarnInfoService.warningMessage(examId, userId, tbUser.getOrgId()));
+    }
+
+    @ApiOperation(value = "预警修改已阅状态接口")
+    @RequestMapping(value = "/save/status", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
+    @Transactional
+    public Result saveWarnStatus(@ApiJsonObject(name = "saveWarnStatus", value = {
+            @ApiJsonProperty(key = "warningId", type = "long", example = "1", description = "预警id", required = true)
+    }) @ApiParam(value = "监考员信息", required = true) @RequestBody Map<String, Object> mapParameter) {
+        if (Objects.isNull(mapParameter.get("warningId")) || Objects.equals(mapParameter.get("warningId"), "")) {
+            throw new BusinessException("预警id不能为空");
+        }
+        Long warningId = Long.parseLong(String.valueOf(mapParameter.get("warningId")));
+        UpdateWrapper<TIeInvigilateWarnInfo> tIeInvigilateWarnInfoUpdateWrapper = new UpdateWrapper<>();
+        tIeInvigilateWarnInfoUpdateWrapper.lambda().set(TIeInvigilateWarnInfo::getApproveStatus, 1)
+                .eq(TIeInvigilateWarnInfo::getId, warningId);
+        tIeInvigilateWarnInfoService.update(tIeInvigilateWarnInfoUpdateWrapper);
+        return ResultUtil.ok(Collections.singletonMap("success", true));
+    }
 }

+ 15 - 3
themis-business/src/main/java/com/qmth/themis/business/dao/TIeExamInvigilateCallMapper.java

@@ -7,7 +7,6 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.Map;
-import java.util.Set;
 
 /**
  * @Description: 监考 监控通话申请 Mapper 接口
@@ -23,9 +22,22 @@ public interface TIeExamInvigilateCallMapper extends BaseMapper<TIeExamInvigilat
      * 监考监控通话申请查询
      *
      * @param iPage
-     * @param examActivityIdSet
+     * @param examId
+     * @param userId
+     * @param orgId
      * @param status
      * @return
      */
-    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, @Param("examActivityIdSet") Set<Long> examActivityIdSet, @Param("status") String status);
+    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, @Param("examId") Long examId, @Param("userId") Long userId, @Param("orgId") Long orgId, @Param("status") String status);
+
+    /**
+     * 监考监控通话count查询
+     *
+     * @param examId
+     * @param userId
+     * @param orgId
+     * @param status
+     * @return
+     */
+    public Integer examInvigilateCallQueryCount(@Param("examId") Long examId, @Param("userId") Long userId, @Param("orgId") Long orgId, @Param("status") String status);
 }

+ 13 - 0
themis-business/src/main/java/com/qmth/themis/business/dao/TIeInvigilateWarnInfoMapper.java

@@ -1,10 +1,13 @@
 package com.qmth.themis.business.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.qmth.themis.business.dto.response.TIeWarningNotifyDto;
 import com.qmth.themis.business.entity.TIeInvigilateWarnInfo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * @Description: 监考预警信息 Mapper 接口
  * @Param:
@@ -28,4 +31,14 @@ public interface TIeInvigilateWarnInfoMapper extends BaseMapper<TIeInvigilateWar
                                 @Param("examActivityId") Long examActivityId,
                                 @Param("roomCode") String roomCode,
                                 @Param("userId") Long userId);
+
+    /**
+     * 预警通知
+     *
+     * @param examId
+     * @param userId
+     * @param orgId
+     * @return
+     */
+    public List<TIeWarningNotifyDto> warningMessage(@Param("examId") Long examId, @Param("userId") Long userId, @Param("orgId") Long orgId);
 }

+ 93 - 0
themis-business/src/main/java/com/qmth/themis/business/dto/response/TIeWarningNotifyDto.java

@@ -0,0 +1,93 @@
+package com.qmth.themis.business.dto.response;
+
+import com.qmth.themis.business.enums.WarningLevelEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 预警通知response dto
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/9/10
+ */
+public class TIeWarningNotifyDto implements Serializable {
+
+    @ApiModelProperty(name = "考试批次id")
+    private Long examId;//考试批次id
+
+    @ApiModelProperty(name = "考生id")
+    private Long examStudentId;//考生id
+
+    @ApiModelProperty(name = "考生姓名")
+    private String name;//考生姓名
+
+    @ApiModelProperty(name = "预警内容")
+    private String info;//预警内容
+
+    @ApiModelProperty(name = "预警等级")
+    private WarningLevelEnum level;//预警等级
+
+    @ApiModelProperty(name = "预警id")
+    private Long warningId;//预警id
+
+    @ApiModelProperty(name = "预警备注")
+    private String remark;//预警备注
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public Long getExamStudentId() {
+        return examStudentId;
+    }
+
+    public void setExamStudentId(Long examStudentId) {
+        this.examStudentId = examStudentId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getInfo() {
+        return info;
+    }
+
+    public void setInfo(String info) {
+        this.info = info;
+    }
+
+    public WarningLevelEnum getLevel() {
+        return level;
+    }
+
+    public void setLevel(WarningLevelEnum level) {
+        this.level = level;
+    }
+
+    public Long getWarningId() {
+        return warningId;
+    }
+
+    public void setWarningId(Long warningId) {
+        this.warningId = warningId;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+}

+ 15 - 3
themis-business/src/main/java/com/qmth/themis/business/service/TIeExamInvigilateCallService.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.themis.business.entity.TIeExamInvigilateCall;
 
 import java.util.Map;
-import java.util.Set;
 
 /**
  * @Description: 监考监控通话申请 服务类
@@ -20,9 +19,22 @@ public interface TIeExamInvigilateCallService extends IService<TIeExamInvigilate
      * 监考监控通话申请查询
      *
      * @param iPage
-     * @param examActivityIdSet
+     * @param examId
+     * @param userId
+     * @param orgId
      * @param status
      * @return
      */
-    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, Set<Long> examActivityIdSet, String status);
+    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, Long examId, Long userId, Long orgId, String status);
+
+    /**
+     * 监考监控通话count查询
+     *
+     * @param examId
+     * @param userId
+     * @param orgId
+     * @param status
+     * @return
+     */
+    public Integer examInvigilateCallQueryCount(Long examId, Long userId, Long orgId, String status);
 }

+ 12 - 2
themis-business/src/main/java/com/qmth/themis/business/service/TIeInvigilateWarnInfoService.java

@@ -1,10 +1,10 @@
 package com.qmth.themis.business.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.qmth.themis.business.dto.response.TIeWarningNotifyDto;
 import com.qmth.themis.business.entity.TIeInvigilateWarnInfo;
-import org.apache.ibatis.annotations.Param;
 
-import java.util.Set;
+import java.util.List;
 
 /**
  * @Description: 监考预警信息 服务类
@@ -28,4 +28,14 @@ public interface TIeInvigilateWarnInfoService extends IService<TIeInvigilateWarn
                                 Long examActivityId,
                                 String roomCode,
                                 Long userId);
+
+    /**
+     * 预警通知
+     *
+     * @param examId
+     * @param userId
+     * @param orgId
+     * @return
+     */
+    public List<TIeWarningNotifyDto> warningMessage(Long examId, Long userId, Long orgId);
 }

+ 19 - 3
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeExamInvigilateCallServiceImpl.java

@@ -28,12 +28,28 @@ public class TIeExamInvigilateCallServiceImpl extends ServiceImpl<TIeExamInvigil
      * 监考监控通话申请查询
      *
      * @param iPage
-     * @param examActivityIdSet
+     * @param examId
+     * @param userId
+     * @param orgId
      * @param status
      * @return
      */
     @Override
-    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, Set<Long> examActivityIdSet, String status) {
-        return tIeExamInvigilateCallMapper.examInvigilateCallQuery(iPage, examActivityIdSet, status);
+    public IPage<TIeExamInvigilateCall> examInvigilateCallQuery(IPage<Map> iPage, Long examId, Long userId, Long orgId, String status) {
+        return tIeExamInvigilateCallMapper.examInvigilateCallQuery(iPage, examId, userId, orgId, status);
+    }
+
+    /**
+     * 监考监控通话count查询
+     *
+     * @param examId
+     * @param userId
+     * @param orgId
+     * @param status
+     * @return
+     */
+    @Override
+    public Integer examInvigilateCallQueryCount(Long examId, Long userId, Long orgId, String status) {
+        return tIeExamInvigilateCallMapper.examInvigilateCallQueryCount(examId, userId, orgId, status);
     }
 }

+ 15 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeInvigilateWarnInfoServiceImpl.java

@@ -2,11 +2,13 @@ package com.qmth.themis.business.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.themis.business.dao.TIeInvigilateWarnInfoMapper;
+import com.qmth.themis.business.dto.response.TIeWarningNotifyDto;
 import com.qmth.themis.business.entity.TIeInvigilateWarnInfo;
 import com.qmth.themis.business.service.TIeInvigilateWarnInfoService;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.List;
 
 /**
  * @Description: 监考预警信息 服务实现类
@@ -34,4 +36,17 @@ public class TIeInvigilateWarnInfoServiceImpl extends ServiceImpl<TIeInvigilateW
     public Integer warningCount(Long examId, Long examActivityId, String roomCode, Long userId) {
         return tIeInvigilateWarnInfoMapper.warningCount(examId, examActivityId, roomCode, userId);
     }
+
+    /**
+     * 预警通知
+     *
+     * @param examId
+     * @param userId
+     * @param orgId
+     * @return
+     */
+    @Override
+    public List<TIeWarningNotifyDto> warningMessage(Long examId, Long userId, Long orgId) {
+        return tIeInvigilateWarnInfoMapper.warningMessage(examId, userId, orgId);
+    }
 }

+ 40 - 4
themis-business/src/main/resources/mapper/TIeExamInvigilateCallMapper.xml

@@ -7,11 +7,47 @@
             tieic.*
         from
             t_ie_exam_invigilate_call tieic
+        left join t_e_exam_student tees on
+            tees.id = tieic.exam_student_id
+        left join t_b_exam_invigilate_user tbeiu on
+            tbeiu.exam_id = tieic.exam_id
+        and tbeiu.room_code = tees.room_code
         <where>
-            tieic.exam_activity_id in
-            <foreach collection="examActivityIdSet" item="examActivityId" index="index" open="(" close=")" separator=",">
-                #{examActivityId}
-            </foreach>
+            <if test="examId != null and examId != ''">
+                and tieic.exam_id = #{examId}
+            </if>
+            <if test="userId != null and userId != ''">
+                and tbeiu.user_id = #{userId}
+            </if>
+            <if test="orgId != null and orgId != ''">
+                and tbeiu.org_id = #{orgId}
+            </if>
+            <if test="status != null and status != ''">
+                and tieic.status = #{status}
+            </if>
+        </where>
+    </select>
+
+    <select id="examInvigilateCallQueryCount" resultType="java.lang.Integer">
+        select
+        count(1)
+        from
+        t_ie_exam_invigilate_call tieic
+        left join t_e_exam_student tees on
+        tees.id = tieic.exam_student_id
+        left join t_b_exam_invigilate_user tbeiu on
+        tbeiu.exam_id = tieic.exam_id
+        and tbeiu.room_code = tees.room_code
+        <where>
+            <if test="examId != null and examId != ''">
+                and tieic.exam_id = #{examId}
+            </if>
+            <if test="userId != null and userId != ''">
+                and tbeiu.user_id = #{userId}
+            </if>
+            <if test="orgId != null and orgId != ''">
+                and tbeiu.org_id = #{orgId}
+            </if>
             <if test="status != null and status != ''">
                 and tieic.status = #{status}
             </if>

+ 30 - 0
themis-business/src/main/resources/mapper/TIeInvigilateWarnInfoMapper.xml

@@ -25,4 +25,34 @@
             and tiiwi.approve_status = 0
         </where>
     </select>
+
+    <select id="warningMessage" resultType="com.qmth.themis.business.dto.response.TIeWarningNotifyDto">
+        select
+            tees.id as examStudentId,
+            tees.name,
+            tiiwi.info,
+            tiiwi.`level`,
+            tiiwi.id as warningId,
+            tiiwi.remark,
+            tiiwi.exam_id as examId
+        from
+            t_ie_invigilate_warn_info tiiwi
+        left join t_e_exam_student tees on
+            tees.id = tiiwi.exam_student_id
+        left join t_b_exam_invigilate_user tbeiu on
+            tbeiu.exam_id = tiiwi.exam_id
+            and tbeiu.room_code = tees.room_code
+        <where>
+            <if test="examId != null and examId != ''">
+                and tiiwi.exam_id = #{examId}
+            </if>
+            <if test="userId != null and userId != ''">
+                and tbeiu.user_id = #{userId}
+            </if>
+            <if test="orgId != null and orgId != ''">
+                and tbeiu.org_id = #{orgId}
+            </if>
+            and tiiwi.approve_status = 0
+        </where>
+    </select>
 </mapper>