From c27e98c04b9d44c65b1eb49552d929687c258352 Mon Sep 17 00:00:00 2001 From: pd <2776455882@qq.com> Date: Fri, 7 Aug 2020 15:20:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=B8=88=E7=AB=AF=E8=80=83=E6=A0=B8?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=B7=B3=E8=BD=AC=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../liuwanr/controller/AssesmentController.java | 15 +++++++++++++++ .../com/yipin/liuwanr/mapper/AssesmentMapper.java | 13 ++++++------- .../yipin/liuwanr/service/AssesmentService.java | 15 +++++++++++++++ 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/yipin/liuwanr/controller/AssesmentController.java b/src/main/java/com/yipin/liuwanr/controller/AssesmentController.java index d84cbc7..37a9f3c 100644 --- a/src/main/java/com/yipin/liuwanr/controller/AssesmentController.java +++ b/src/main/java/com/yipin/liuwanr/controller/AssesmentController.java @@ -525,5 +525,20 @@ public class AssesmentController { } + @GetMapping("/getByCourseId") + Response getByCourseId(@RequestParam Integer courseId){ + Response resp = new Response(); + HashMap ret = service.getByCourseId(courseId); + int status = (int) ret.get("retcode"); + if (200 == status) { + resp.setStatus(status); + resp.setMessage(ret.get("retvalue")); + } else { + resp.setStatus(status); + resp.setErrmessage(ret.get("retvalue").toString()); + } + return resp; + } + } diff --git a/src/main/java/com/yipin/liuwanr/mapper/AssesmentMapper.java b/src/main/java/com/yipin/liuwanr/mapper/AssesmentMapper.java index aaacd1a..0df67f5 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/AssesmentMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/AssesmentMapper.java @@ -3,6 +3,7 @@ package com.yipin.liuwanr.mapper; import java.util.HashMap; import java.util.List; +import com.yipin.liuwanr.entity.*; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Many; @@ -13,18 +14,11 @@ import org.apache.ibatis.annotations.Results; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; -import com.yipin.liuwanr.entity.Assesment; -import com.yipin.liuwanr.entity.ExperimentalClass; -import com.yipin.liuwanr.entity.PointRecord; -import com.yipin.liuwanr.entity.Project_Management; -import com.yipin.liuwanr.entity.Record; -import com.yipin.liuwanr.entity.Student; /** * 考核 * @author 或然 * */ -import com.yipin.liuwanr.entity.SutdentClass; public interface AssesmentMapper { @@ -334,4 +328,9 @@ public interface AssesmentMapper { //考核名称去重 @Select("select count(*) from assessment where assesmentName=#{assesmentName}") Integer getByAssesmentName(String assesmentName); + + + //自定义跳转 + @Select("select tc.systemId,c.systemName from hr_course_tc tc left join service_config c on tc.systemId=c.systemId where courseId=#{courseId} GROUP BY tc.systemId") + List getByCourseId(Integer courseId); } diff --git a/src/main/java/com/yipin/liuwanr/service/AssesmentService.java b/src/main/java/com/yipin/liuwanr/service/AssesmentService.java index 56c0a2e..b8a23b7 100644 --- a/src/main/java/com/yipin/liuwanr/service/AssesmentService.java +++ b/src/main/java/com/yipin/liuwanr/service/AssesmentService.java @@ -672,4 +672,19 @@ public class AssesmentService { } return resp; } + + + public HashMap getByCourseId(Integer courseId) { + HashMap resp = new HashMap(); + try { + resp.put("retvalue", mapper.getByCourseId(courseId)); + resp.put("retcode", 200); + }catch (RuntimeException e){ + logger.error(e.getMessage()); + resp.put("retcode", 500); + resp.put("retvalue", "DELETE Failed"); + return resp; + } + return resp; + } }