浏览代码

新增考试批次编码查询考场信息

wangliang 2 年之前
父节点
当前提交
812fe1c916

+ 7 - 0
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamController.java

@@ -295,6 +295,13 @@ public class TEExamController {
                         type));
     }
 
+    @ApiOperation(value = "根据考试批次编码查询考场接口")
+    @RequestMapping(value = "/examroom/query", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "考试批次信息", response = TEExam.class)})
+    public Result examroomQuery(@ApiParam(value = "考试批次编码", required = true) @RequestParam String code) {
+        return ResultUtil.ok(teExamService.examroomQuery(code));
+    }
+
     @ApiOperation(value = "考试批次停用/启用接口")
     @RequestMapping(value = "/toggle", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})

+ 8 - 0
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamMapper.java

@@ -40,6 +40,14 @@ public interface TEExamMapper extends BaseMapper<TEExam> {
      */
     public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, @Param("userId") Long userId, @Param("id") Long id, @Param("code") String code, @Param("name") String name, @Param("mode") String mode, @Param("enable") Integer enable, @Param("orgId") Long orgId, @Param("type") String type);
 
+    /**
+     * 根据考试批次编码查询考场接口
+     *
+     * @param code
+     * @return
+     */
+    public List<Map> examroomQuery(@Param("code") String code);
+
     /**
      * 获取考试待考列表
      *

+ 8 - 0
themis-business/src/main/java/com/qmth/themis/business/service/TEExamService.java

@@ -43,6 +43,14 @@ public interface TEExamService extends IService<TEExam> {
      */
     public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, Long userId, Long id, String code, String name, String mode, Integer enable, Long orgId, String type);
 
+    /**
+     * 根据考试批次编码查询考场接口
+     *
+     * @param code
+     * @return
+     */
+    public List<Map> examroomQuery(String code);
+
     /**
      * 获取考试待考列表
      *

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java

@@ -139,6 +139,17 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
         return teExamMapper.examQuery(iPage, userId, id, code, name, mode, enable, orgId, type);
     }
 
+    /**
+     * 根据考试批次编码查询考场接口
+     *
+     * @param code
+     * @return
+     */
+    @Override
+    public List<Map> examroomQuery(String code) {
+        return teExamMapper.examroomQuery(code);
+    }
+
     /**
      * 获取考试待考列表
      *

+ 18 - 0
themis-business/src/main/resources/mapper/TEExamMapper.xml

@@ -140,6 +140,24 @@
         order by t.createTime desc
     </select>
 
+    <select id="examroomQuery" resultType="java.util.HashMap">
+     select
+        distinct tees.room_code as roomCode,
+        tees.room_name as roomName
+        from
+        t_e_exam t
+        left join t_e_exam_student tees on
+        tees.exam_id = t.id
+        WHERE 1 = 1
+        <if test="code != null and code != ''">
+            and t.code = #{code}
+        </if>
+        and t.monitor_status <![CDATA[ <> ]]> 'FINISHED'
+        and t.start_time <![CDATA[ <= ]]> unix_timestamp(current_timestamp()) * 1000
+        and t.enable = 1
+        order by tees.room_code
+    </select>
+
     <select id="getWaitingExam" resultType="com.qmth.themis.business.dto.response.TEExamWaitDto">
         select
         t.*