wangliang 4 年之前
父節點
當前提交
b71ce6c47e

+ 21 - 24
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamController.java

@@ -112,7 +112,7 @@ public class TEExamController {
                 QueryWrapper<TEExamActivity> teExamActivityQueryWrapper = new QueryWrapper<>();
                 teExamActivityQueryWrapper.lambda().eq(TEExamActivity::getExamId, oldId);
                 List<TEExamActivity> teExamActivityList = teExamActivityService.list(teExamActivityQueryWrapper);
-                if(Objects.nonNull(teExamActivityList) && teExamActivityList.size() > 0) {
+                if (Objects.nonNull(teExamActivityList) && teExamActivityList.size() > 0) {
                     //删除quartz任务,发送mq消息start
                     Map<String, Object> prop = new HashMap<>();
                     prop.put("oper", "delete");
@@ -127,25 +127,10 @@ public class TEExamController {
             }
             //如果是随到随考,则默认插入一条场次信息
             if (Objects.equals(teExam.getMode().name(), ExamModeEnum.ANYTIME.name())) {//随到随考模式
-                if (Objects.isNull(oldId)) {//如果是新增
-                    TEExamActivity teExamActivity = new TEExamActivity(teExam.getId(), teExam.getPrepareSeconds(), teExam.getMaxDurationSeconds(), teExam.getOpeningSeconds(), teExam.getStartTime(), teExam.getEndTime(), tbUser.getId());
-                    teExamActivity.setCode(String.valueOf(redisUtil.getRedisActivityCodeSequence()));
-                    teExamActivity.setEnable(1);
-                    teExamActivityService.saveOrUpdate(teExamActivity);
-
-                    //新增quartz任务,发送mq消息start
-                    Map<String, Object> prop = new HashMap<>();
-                    prop.put("oper", "insert");
-                    prop.put("exam", teExam);
-                    if (Objects.nonNull(teExamActivity) && teExamActivity.getEnable() == 1) {
-                        MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.EXAM_ACTIVITY.name(), JacksonUtil.parseJson(Arrays.asList(teExamActivity)), MqTagEnum.EXAM_ACTIVITY, String.valueOf(teExam.getId()), prop, tbUser.getName());
-                        mqDtoService.assembleSendOneWayMsg(mqDto);
-                    }
-                    //新增quartz任务,发送mq消息end
-                } else {//修改需删除之前生成的全部quartz任务
-                    QueryWrapper<TEExamActivity> teExamActivityQueryWrapper = new QueryWrapper<>();
-                    teExamActivityQueryWrapper.lambda().eq(TEExamActivity::getExamId, oldId);
-                    List<TEExamActivity> teExamActivityList = teExamActivityService.list(teExamActivityQueryWrapper);
+                QueryWrapper<TEExamActivity> teExamActivityQueryWrapper = new QueryWrapper<>();
+                teExamActivityQueryWrapper.lambda().eq(TEExamActivity::getExamId, oldId);
+                List<TEExamActivity> teExamActivityList = teExamActivityService.list(teExamActivityQueryWrapper);
+                if (Objects.nonNull(teExamActivityList) && teExamActivityList.size() > 0) {
                     //修改数据
                     TEExam finalTeExam = teExam;
                     teExamActivityList.forEach(s -> {
@@ -161,14 +146,26 @@ public class TEExamController {
                     Map<String, Object> prop = new HashMap<>();
                     prop.put("oper", "insert");
                     prop.put("exam", teExam);
-                    if (Objects.nonNull(teExamActivityList.get(0)) && teExamActivityList.get(0).getEnable() == 1) {
-                        MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.EXAM_ACTIVITY.name(), JacksonUtil.parseJson(teExamActivityList), MqTagEnum.EXAM_ACTIVITY, String.valueOf(teExam.getId()), prop, tbUser.getName());
-                        mqDtoService.assembleSendOneWayMsg(mqDto);
-                    }
+                    MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.EXAM_ACTIVITY.name(), JacksonUtil.parseJson(teExamActivityList), MqTagEnum.EXAM_ACTIVITY, String.valueOf(teExam.getId()), prop, tbUser.getName());
+                    mqDtoService.assembleSendOneWayMsg(mqDto);
                     //新增quartz任务,发送mq消息end
                     teExamActivityList.forEach(s -> {
                         teExamActivityService.updateExamActivityCacheBean(s.getId());
                     });
+                }else{
+                    TEExamActivity teExamActivity = new TEExamActivity(teExam.getId(), teExam.getPrepareSeconds(), teExam.getMaxDurationSeconds(), teExam.getOpeningSeconds(), teExam.getStartTime(), teExam.getEndTime(), tbUser.getId());
+                    teExamActivity.setCode(String.valueOf(redisUtil.getRedisActivityCodeSequence()));
+                    teExamActivity.setEnable(1);
+                    teExamActivityService.saveOrUpdate(teExamActivity);
+
+                    //新增quartz任务,发送mq消息start
+                    Map<String, Object> prop = new HashMap<>();
+                    prop.put("oper", "insert");
+                    prop.put("exam", teExam);
+                    if (Objects.nonNull(teExamActivity) && teExamActivity.getEnable() == 1) {
+                        MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.EXAM_ACTIVITY.name(), JacksonUtil.parseJson(Arrays.asList(teExamActivity)), MqTagEnum.EXAM_ACTIVITY, String.valueOf(teExam.getId()), prop, tbUser.getName());
+                        mqDtoService.assembleSendOneWayMsg(mqDto);
+                    }
                 }
             }
         } catch (Exception e) {

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/service/impl/TBAttachmentServiceImpl.java

@@ -135,7 +135,7 @@ public class TBAttachmentServiceImpl extends ServiceImpl<TBAttachmentMapper, TBA
             } else {
                 jsonObject.put(SystemConstant.TYPE, SystemConstant.LOCAL);
             }
-            jsonObject.put(SystemConstant.PATH, stringJoiner.toString().replaceAll(SystemConstant.FILES_DIR + File.separator, ""));
+            jsonObject.put(SystemConstant.PATH, stringJoiner.toString());
             jsonObject.put(SystemConstant.UPLOAD_TYPE, UploadFileEnum.valueOf(uploadType).ordinal());
             tbAttachment.setRemark(jsonObject.toJSONString());
             tbAttachment.setCreateId(userId);

+ 2 - 2
themis-business/src/main/java/com/qmth/themis/business/templete/TaskExportCommon.java

@@ -135,12 +135,12 @@ public class TaskExportCommon {
             fileWriter = new FileWriter(file);
             fileWriter.write(txtStr);
             JSONObject json = new JSONObject();
-            json.put("path", file.getPath().replaceAll(SystemConstant.FILES_DIR + File.separator, ""));
+            json.put("path", file.getPath());
             json.put("type", this.type);
             this.tbTaskHistory.setReportFilePath(json.toJSONString());
             if (Objects.nonNull(excelFile)) {
                 JSONObject excelJson = new JSONObject();
-                excelJson.put("path", excelFile.getPath().replaceAll(SystemConstant.FILES_DIR + File.separator, ""));
+                excelJson.put("path", excelFile.getPath());
                 excelJson.put("type", this.type);
                 this.tbTaskHistory.setResultFilePath(excelJson.toJSONString());
             }

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/templete/TaskImportCommon.java

@@ -121,7 +121,7 @@ public class TaskImportCommon {
             fileWriter = new FileWriter(file);
             fileWriter.write(txtStr);
             JSONObject json = new JSONObject();
-            json.put("path", file.getPath().replaceAll(SystemConstant.FILES_DIR + File.separator, ""));
+            json.put("path", file.getPath());
             json.put("type", this.type);
             this.tbTaskHistory.setReportFilePath(json.toJSONString());
             if (Objects.equals(this.type, SystemConstant.OSS)) {

+ 5 - 1
themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskRoomCodeExportTemplete.java

@@ -64,8 +64,12 @@ public class TaskRoomCodeExportTemplete implements TaskExportTemplete {
             taskExportCommon.getTxtList().add(DateUtil.format(new Date(), timeFormat) + "->开始准备处理导出的考场数据");
             List<RoomCodeExportDto> roomCodeExportDtoList = tbExamInvigilateUserService.examInvigilateUserExport();
 
+            boolean oss = (boolean) taskExportCommon.getOssEnv().get(SystemConstant.OSS);
+            StringJoiner stringJoiner = new StringJoiner("");
+            if (!oss) {
+                stringJoiner.add(SystemConstant.FILES_DIR).add(File.separator);
+            }
             LocalDateTime nowTime = LocalDateTime.now();
-            StringJoiner stringJoiner = new StringJoiner("").add(SystemConstant.FILES_DIR).add(File.separator);
             String uploadType = String.valueOf(taskExportCommon.getOssEnv().get(SystemConstant.UPLOAD_TYPE));
             stringJoiner.add(uploadType).add(File.separator).add(String.valueOf(nowTime.getYear()))
                     .add(File.separator).add(String.valueOf(nowTime.getMonthValue()))

+ 3 - 1
themis-business/src/main/java/com/qmth/themis/business/templete/service/impl/TempleteLogicServiceImpl.java

@@ -113,7 +113,9 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
                         }
                         teExamStudent = gson.fromJson(gson.toJson(examStudentImportDto), TEExamStudent.class);
                         teExamStudent.setExamId(examId);
-                        teExamStudent.setExamActivityId(teExamActivity.getId());
+                        if (Objects.nonNull(teExamActivity)) {
+                            teExamStudent.setExamActivityId(teExamActivity.getId());
+                        }
                         teExamStudent.setStudentId(teStudent.getId());
                         teExamStudent.setCreateId(createId);
                     } else {

+ 28 - 30
themis-business/src/main/resources/db/init.sql

@@ -358,12 +358,12 @@ COMMIT;
 -- ----------------------------
 DROP TABLE IF EXISTS `t_b_privilege`;
 CREATE TABLE `t_b_privilege` (
-  `id` bigint NOT NULL COMMENT '主键',
+  `id` bigint(20) NOT NULL COMMENT '主键',
   `name` varchar(50) NOT NULL COMMENT '名称',
   `url` varchar(100) NOT NULL COMMENT '地址',
   `type` varchar(50) NOT NULL COMMENT '类型',
-  `parent_id` bigint DEFAULT NULL COMMENT '父id',
-  `sequence` int DEFAULT NULL COMMENT '序号',
+  `parent_id` bigint(20) DEFAULT NULL COMMENT '父id',
+  `sequence` int(11) DEFAULT NULL COMMENT '序号',
   `remark` varchar(100) DEFAULT NULL COMMENT '备注',
   `create_time` datetime DEFAULT NULL COMMENT '创建时间',
   PRIMARY KEY (`id`)
@@ -373,31 +373,27 @@ CREATE TABLE `t_b_privilege` (
 -- Records of t_b_privilege
 -- ----------------------------
 BEGIN;
-INSERT INTO `t_b_privilege` VALUES (1, '系统设置', 'system', 'MENU', NULL, 1, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (2, '用户管理', 'userManager', 'MENU', 1, 1, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (3, '机构管理', 'orgManager', 'MENU', 1, 2, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (4, '考务设置', 'examination', 'MENU', NULL, 1, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (5, '批次管理', 'examActivityManager', 'MENU', 4, 1, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (6, '考生管理', 'examStudentManager', 'MENU', 4, 2, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (7, '调卷规则', 'rotationRulesManager', 'MENU', 4, 3, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (8, '学生档案', 'studentManager', 'MENU', 4, 4, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (9, '考场监考设置', 'examInvigilateManager', 'MENU', 4, 5, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (10, '监考设置', 'invigilate', 'MENU', NULL, 1, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (11, '考情监控', 'invigilateManager', 'MENU', 10, 1, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (12, '考情监控', 'invigilateSecondManager', 'MENU', 11, 1, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (13, '在线巡考', 'onlineInvigilateManager', 'MENU', 11, 2, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (14, '监考管理', 'monitorManager', 'MENU', 10, 2, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (15, '实时监控台', 'monitoringStations', 'MENU', 14, 1, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (16, '监考明细', 'monitorDetail', 'MENU', 14, 2, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (17, '预警提醒', 'warn', 'MENU', 14, 3, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (18, '重考申请', 'reexam', 'MENU', 14, 4, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (19, '进度查询', 'progress', 'MENU', 14, 5, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (20, '重考审批', 'reexamManager', 'MENU', 10, 3, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (21, '重考待审', 'reexamTrial', 'MENU', 20, 1, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (22, '重考已审', 'reexamApproved', 'MENU', 20, 2, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (23, '查询统计', 'queryStatisticsManager', 'MENU', 10, 4, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (24, '考情综合报表分析', 'comprehensiveReportAnalysis', 'MENU', 23, 1, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (25, '考生端日志管理', 'clientLog', 'MENU', 23, 2, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (1, '系统设置', 'System', 'MENU', NULL, 1, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (2, '用户管理', 'UserManagement', 'MENU', 1, 1, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (3, '机构管理', 'OrgManagement', 'MENU', 1, 2, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (4, '考务管理', 'Exam', 'MENU', NULL, 1, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (5, '批次管理', 'ExamManagement', 'MENU', 4, 1, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (6, '考生管理', 'ExamStudentManagement', 'MENU', 4, 2, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (7, '调卷规则', 'CourseManagement', 'MENU', 4, 3, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (8, '学生档案', 'StudentManagement', 'MENU', 4, 4, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (9, '考场监考设置', 'InvigilateManagement', 'MENU', 4, 5, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (10, '监考管理', 'Invigilation', 'MENU', NULL, 1, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (11, '考情监控', 'ExamInvigilation', 'MENU', 10, 1, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (13, '在线巡考', 'OnlinePatrol', 'MENU', 10, 2, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (15, '实时监控台', 'RealtimeMonitoring', 'MENU', 10, 3, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (16, '监考明细管理', 'InvigilationDetail', 'MENU', 10, 4, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (17, '预警提醒', 'WainingManage', 'MENU', 10, 5, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (18, '重考申请', 'ReexamApply', 'MENU', 10, 6, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (19, '进度查询', 'ProgressDetail', 'MENU', 10, 7, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (21, '重考待审', 'ReexamPending', 'MENU', 10, 8, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (22, '重考已审', 'ReexamChecked', 'MENU', 10, 9, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (24, '考情综合报表分析', 'ExamReport', 'MENU', 10, 10, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (25, '考生端日志管理', 'StudentLogManage', 'MENU', 10, 11, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (26, '查询用户', '/api/admin/user/query', 'LINK', 2, 1, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (27, '新增用户', '/api/admin/user/save', 'LINK', 2, 2, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (28, '修改用户', '/api/admin/user/save', 'LINK', 2, 3, NULL, '2020-08-01 12:08:31');
@@ -414,7 +410,7 @@ INSERT INTO `t_b_privilege` VALUES (38, '启用/禁用批次', '/api/admin/exam/
 INSERT INTO `t_b_privilege` VALUES (39, '修改批次', '/api/admin/exam/save', 'LINK', 5, 5, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (40, '场次设置', '/api/admin/activity/query', 'LINK', 5, 6, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (41, '重新算分', '/api/admin/exam/score/calculate', 'LINK', 5, 7, NULL, '2020-08-01 12:08:31');
-INSERT INTO `t_b_privilege` VALUES (42, '考生导入', 'examStudentImportManager', 'MENU', 6, 1, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (42, '考生导入', 'ExamStudentImport', 'MENU', 4, 6, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (43, '查询考生', '/api/admin/examStudent/query', 'LINK', 6, 1, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (44, '新增考生', '/api/admin/examStudent/save', 'LINK', 6, 2, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (45, '修改考生', '/api/admin/examStudent/save', 'LINK', 6, 3, NULL, '2020-08-01 12:08:31');
@@ -507,6 +503,7 @@ INSERT INTO `t_b_privilege` VALUES (137, '拍照/录音答题就绪', '/api/mobi
 INSERT INTO `t_b_privilege` VALUES (138, '拍照/录音提交', '/api/mobile/answer/submit', 'LINK', 60, 33, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (139, '监考端撤销通话申请', '/api/admin/monitor/call/cancel', 'LINK', 10, 5, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (140, '结束监考', '/api/admin/invigilate/exam/finish', 'LINK', 14, 12, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (141, '导入导出任务', 'ImportExportTask', 'MENU', 4, 7, NULL, '2020-08-01 12:08:31');
 COMMIT;
 
 -- ----------------------------
@@ -685,6 +682,7 @@ INSERT INTO `t_b_role_privilege` VALUES (140, 'STUDENT', 138);
 INSERT INTO `t_b_role_privilege` VALUES (141, 'INVIGILATE', 108);
 INSERT INTO `t_b_role_privilege` VALUES (142, 'INVIGILATE', 139);
 INSERT INTO `t_b_role_privilege` VALUES (143, 'INVIGILATE', 140);
+INSERT INTO `t_b_role_privilege` VALUES (144, 'ADMIN', 141);
 COMMIT;
 
 -- ----------------------------
@@ -1064,7 +1062,7 @@ DROP TABLE IF EXISTS `t_e_exam_student`;
 CREATE TABLE `t_e_exam_student` (
   `id` bigint NOT NULL COMMENT '主键',
   `exam_id` bigint NOT NULL COMMENT '批次id',
-  `exam_activity_id` bigint NOT NULL COMMENT '场次id',
+  `exam_activity_id` bigint(20) DEFAULT NULL COMMENT '场次id',
   `student_id` bigint NOT NULL COMMENT '学生id',
   `course_code` varchar(50) NOT NULL COMMENT '科目代码',
   `room_code` varchar(50) NOT NULL COMMENT '虚拟考场代码,考试唯一',

+ 2 - 2
themis-business/src/main/resources/mapper/TBExamInvigilateUserMapper.xml

@@ -19,7 +19,7 @@
                 and tbeiu.user_id = #{userId}
             </if>
             <if test="roomCode != null and roomCode != ''">
-                and tbeiu.room_code like concat(#{roomCode}, '%')
+                and tbeiu.room_code like concat('%', #{roomCode}, '%')
             </if>
         </where>
         ) t
@@ -59,7 +59,7 @@
             t_b_exam_invigilate_user tbeiu
         <where>
             <if test="roomName != null and roomName != ''">
-                and tbeiu.room_name like concat(#{roomName}, '%')
+                and tbeiu.room_name like concat('%', #{roomName}, '%')
             </if>
         </where>
     </select>

+ 2 - 16
themis-business/src/main/resources/mapper/TBOrgMapper.xml

@@ -42,24 +42,10 @@
                 t_b_org tbo
             <where>
                 <if test="code != null and code != ''">
-                    <choose>
-                        <when test="name != null and name != ''">
-                            (tbo.code like concat(#{code}, '%')
-                        </when>
-                        <otherwise>
-                            and tbo.code like concat(#{code}, '%')
-                        </otherwise>
-                    </choose>
+                    and tbo.code like concat('%', #{code}, '%')
                 </if>
                 <if test="name != null and name != ''">
-                    <choose>
-                        <when test="code != null and code != ''">
-                            or tbo.name like concat(#{name}, '%'))
-                        </when>
-                        <otherwise>
-                            and tbo.name like concat(#{name}, '%')
-                        </otherwise>
-                    </choose>
+                    and tbo.name like concat('%', #{name}, '%')
                 </if>
                 <if test="enable != null and enable != '' or enable == 0">
                     and tbo.enable = #{enable}

+ 3 - 17
themis-business/src/main/resources/mapper/TBUserMapper.xml

@@ -48,24 +48,10 @@
                     and tbu.id = #{id}
                 </if>
                 <if test="loginName != null and loginName != ''">
-                    <choose>
-                        <when test="name != null and name != ''">
-                            (tbu.login_name like concat(#{loginName}, '%')
-                        </when>
-                        <otherwise>
-                            and tbu.login_name like concat(#{loginName}, '%')
-                        </otherwise>
-                    </choose>
+                    and tbu.login_name like concat('%', #{loginName}, '%')
                 </if>
                 <if test="name != null and name != ''">
-                    <choose>
-                        <when test="loginName != null and loginName != ''">
-                            or tbu.name like concat(#{name}, '%'))
-                        </when>
-                        <otherwise>
-                            and tbu.name like concat(#{name}, '%')
-                        </otherwise>
-                    </choose>
+                    and tbu.name like concat('%', #{name}, '%')
                 </if>
                 <if test="enable != null and enable != '' or enable == 0">
                     and tbu.enable = #{enable}
@@ -74,7 +60,7 @@
             <where>
                 t.roleCodeStr <![CDATA[ <> ]]> 'SUPER_ADMIN'
                 <if test="role != null and role != ''">
-                    and t.roleCodeStr like concat(#{role}, '%')
+                    and t.roleCodeStr like concat('%', #{role}, '%')
                 </if>
             </where>
              order by t.name

+ 1 - 1
themis-business/src/main/resources/mapper/TEExamActivityMapper.xml

@@ -100,7 +100,7 @@
                 and teea.exam_id = #{examId}
             </if>
             <if test="code != null and code != ''">
-                and teea.code like concat(#{code}, '%')
+                and teea.code like concat('%', #{code}, '%')
             </if>
             <if test="startDate != null and startDate != ''">
                 and teea.start_time = #{startDate}

+ 2 - 2
themis-business/src/main/resources/mapper/TEExamCourseMapper.xml

@@ -48,10 +48,10 @@
 				and teec.exam_id = #{examId}
 			</if>
 			<if test="courseCode != null and courseCode != ''">
-				and teec.course_code like concat(#{courseCode}, '%')
+				and teec.course_code like concat('%', #{courseCode}, '%')
 			</if>
 			<if test="courseName != null and courseName != ''">
-				and teec.course_name like concat(#{courseName}, '%')
+				and teec.course_name like concat('%', #{courseName}, '%')
 			</if>
 			<if test="hasPaper != null and hasPaper != '' or hasPaper == 0">
 				<choose>

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

@@ -69,10 +69,10 @@
                 and t.id = #{id}
             </if>
             <if test="code != null and code != ''">
-                and t.code like concat(#{code}, '%')
+                and t.code like concat('%', #{code}, '%')
             </if>
             <if test="name != null and name != ''">
-                and t.name like concat(#{name}, '%')
+                and t.name like concat('%', #{name}, '%')
             </if>
             <if test="mode != null and mode != '' or mode == 0">
                 and t.mode = #{mode}

+ 11 - 11
themis-business/src/main/resources/mapper/TEExamReexamMapper.xml

@@ -34,13 +34,13 @@
                     and tees.room_code = #{roomCode}
                 </if>
                 <if test="courseCode != null and courseCode != ''">
-                    and tees.course_code like CONCAT(#{courseCode},'%')
+                    and tees.course_code like CONCAT('%', #{courseCode},'%')
                 </if>
                 <if test="name != null and name !=''">
-                    and tees.name like CONCAT(#{name},'%')
+                    and tees.name like CONCAT('%', #{name},'%')
                 </if>
                 <if test="identity != null and identity !=''">
-                    and tees.identity like CONCAT(#{identity},'%')
+                    and tees.identity like CONCAT('%', #{identity},'%')
                 </if>
                 and tees.enable = 1
             </where>
@@ -89,13 +89,13 @@
                  and tees.room_code = #{roomCode}
              </if>
              <if test="courseCode != null and courseCode != ''">
-                 and tees.course_code like CONCAT(#{courseCode},'%')
+                 and tees.course_code like CONCAT('%', #{courseCode},'%')
              </if>
              <if test="name != null and name !=''">
-                 and tees.name like CONCAT(#{name},'%')
+                 and tees.name like CONCAT('%', #{name},'%')
              </if>
              <if test="identity != null and identity !=''">
-                 and tees.identity like CONCAT(#{identity},'%')
+                 and tees.identity like CONCAT('%', #{identity},'%')
              </if>
              <if test="reason != null and reason !=''">
                  and teer.reason = #{reason}
@@ -107,7 +107,7 @@
                  and teer.create_time &lt;= #{reasonEndTime}
              </if>
              <if test="applyName != null and applyName !=''">
-                 and tbu.name like CONCAT(#{applyName},'%')
+                 and tbu.name like CONCAT('%', #{applyName},'%')
              </if>
              and tee.enable = 1
              and teea.enable = 1
@@ -163,13 +163,13 @@
                 and tees.room_code = #{roomCode}
             </if>
             <if test="courseCode != null and courseCode != ''">
-                and tees.course_code like CONCAT(#{courseCode},'%')
+                and tees.course_code like CONCAT('%', #{courseCode},'%')
             </if>
             <if test="name != null and name !=''">
-                and tees.name like CONCAT(#{name},'%')
+                and tees.name like CONCAT('%', #{name},'%')
             </if>
             <if test="identity != null and identity !=''">
-                and tees.identity like CONCAT(#{identity},'%')
+                and tees.identity like CONCAT('%', #{identity},'%')
             </if>
             <if test="auditingStatus != null and auditingStatus !='' or auditingStatus == 0">
                 and teer.auditing_status = #{auditingStatus}
@@ -181,7 +181,7 @@
                 and teer.create_time &lt;= #{reasonEndTime}
             </if>
             <if test="applyName != null and applyName !=''">
-                and tbu.name like CONCAT(#{applyName},'%')
+                and tbu.name like CONCAT('%', #{applyName},'%')
             </if>
             and tee.enable = 1
             and teea.enable = 1

+ 3 - 3
themis-business/src/main/resources/mapper/TEExamStudentMapper.xml

@@ -35,13 +35,13 @@
                 and tees.exam_activity_id = #{activityId}
             </if>
             <if test="identity != null and identity != ''">
-                and tees.identity like concat(#{identity}, '%')
+                and tees.identity like concat('%', #{identity}, '%')
             </if>
             <if test="name != null and name != ''">
-                and tees.name like concat(#{name}, '%')
+                and tees.name like concat('%', #{name}, '%')
             </if>
             <if test="roomCode != null and roomCode != ''">
-                and tees.room_code like concat(#{roomCode}, '%')
+                and tees.room_code like concat('%', #{roomCode}, '%')
             </if>
             <if test="courseCode != null and courseCode != ''">
                 and tees.course_code = #{courseCode}

+ 2 - 2
themis-business/src/main/resources/mapper/TEStudentMapper.xml

@@ -20,10 +20,10 @@
             tbo.id = tes.org_id
         <where>
             <if test="identity != null and identity != ''">
-                and tes.identity like concat(#{identity}, '%')
+                and tes.identity like concat('%', #{identity}, '%')
             </if>
             <if test="name != null and name != ''">
-                and tes.name like concat(#{name}, '%')
+                and tes.name like concat('%', #{name}, '%')
             </if>
             <if test="enable != null and enable != '' or enable == 0">
                 and tes.enable = #{enable}

+ 8 - 8
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -128,10 +128,10 @@
                 and t.status = #{status}
             </if>
             <if test="name != null and name !=''">
-                and s.name like CONCAT(#{name},'%')
+                and s.name like CONCAT('%', #{name},'%')
             </if>
             <if test="identity != null and identity !=''">
-                and s.identity like CONCAT(#{identity},'%')
+                and s.identity like CONCAT('%', #{identity},'%')
             </if>
             <if test="maxWarningCount != null and maxWarningCount != ''">
                 and t.warning_count &lt;= #{maxWarningCount}
@@ -243,10 +243,10 @@
                     and tiiwi.approve_status = #{approveStatus}
                 </if>
                 <if test="name != null and name !=''">
-                    and tees.name like CONCAT(#{name},'%')
+                    and tees.name like CONCAT('%', #{name},'%')
                 </if>
                 <if test="identity != null and identity !=''">
-                    and tees.identity like CONCAT(#{identity},'%')
+                    and tees.identity like CONCAT('%', #{identity},'%')
                 </if>
                 <if test="maxWarningCount != null and maxWarningCount != ''">
                     and toer.warning_count &lt;= #{maxWarningCount}
@@ -318,13 +318,13 @@
                 and tees.room_code = #{roomCode}
             </if>
             <if test="courseCode != null and courseCode != ''">
-                and tees.course_code like CONCAT(#{courseCode},'%')
+                and tees.course_code like CONCAT('%', #{courseCode},'%')
             </if>
             <if test="name != null and name !=''">
-                and tees.name like CONCAT(#{name},'%')
+                and tees.name like CONCAT('%', #{name},'%')
             </if>
             <if test="identity != null and identity !=''">
-                and tees.identity like CONCAT(#{identity},'%')
+                and tees.identity like CONCAT('%', #{identity},'%')
             </if>
             and tee.enable = 1
             and teea.enable = 1
@@ -344,7 +344,7 @@
             and t.finish_type = #{finishType}
         </if>
         <if test="courseCode != null and courseCode != ''">
-            and tees.course_code like CONCAT(#{courseCode},'%')
+            and tees.course_code like CONCAT('%', #{courseCode},'%')
         </if>
         order by s.room_code
     </select>