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; + } }