From 5fff04d3228dd51ed100237f3d4300c8c415a6cc Mon Sep 17 00:00:00 2001 From: pd <2776455882@qq.com> Date: Tue, 28 Jul 2020 21:03:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E6=A0=B8=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/yipin/liuwanr/entity/Assesment.java | 6 +++--- .../java/com/yipin/liuwanr/mapper/AssesmentMapper.java | 4 ++-- .../java/com/yipin/liuwanr/service/AssesmentService.java | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/yipin/liuwanr/entity/Assesment.java b/src/main/java/com/yipin/liuwanr/entity/Assesment.java index 4a92e18..eb07a56 100644 --- a/src/main/java/com/yipin/liuwanr/entity/Assesment.java +++ b/src/main/java/com/yipin/liuwanr/entity/Assesment.java @@ -18,7 +18,7 @@ public class Assesment { private String timesum;// 耗时 private Integer assessmentNumber;// 考核点数量 private Integer errorRate;// 错误率 - private Integer experimentalClassId;//实验班级id + private String experimentalClassId;//实验班级id private String classId;// 行政班级id private String teacherInClass;// 任课老师 private Integer staffId;// 教师id @@ -49,11 +49,11 @@ public class Assesment { this.staffName = staffName; } - public Integer getExperimentalClassId() { + public String getExperimentalClassId() { return experimentalClassId; } - public void setExperimentalClassId(Integer experimentalClassId) { + public void setExperimentalClassId(String experimentalClassId) { this.experimentalClassId = experimentalClassId; } diff --git a/src/main/java/com/yipin/liuwanr/mapper/AssesmentMapper.java b/src/main/java/com/yipin/liuwanr/mapper/AssesmentMapper.java index 013a58d..cac2060 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/AssesmentMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/AssesmentMapper.java @@ -221,8 +221,8 @@ public interface AssesmentMapper { * @return */ @Select("SELECT ex.experimentalClassId as experimentalClassId,ex.experimentalClassName as experimentalClassName from assessment ass left join" - + " experimental_class_ning ex on ex.experimentalClassId=ass.experimentalClassId where ass.id=#{assesmentId}") - ExperimentalClass queryExperimental(Integer assesmentId); + + " experimental_class_ning ex on FIND_IN_SET(ex.experimentalClassId,ass.experimentalClassId) where ass.id=#{assesmentId}") + List queryExperimental(Integer assesmentId); /** diff --git a/src/main/java/com/yipin/liuwanr/service/AssesmentService.java b/src/main/java/com/yipin/liuwanr/service/AssesmentService.java index c818f62..ac7582f 100644 --- a/src/main/java/com/yipin/liuwanr/service/AssesmentService.java +++ b/src/main/java/com/yipin/liuwanr/service/AssesmentService.java @@ -382,12 +382,12 @@ public class AssesmentService { */ public HashMap getByclass(Integer assesmentId) { HashMap resp = new HashMap(); - List obj = new ArrayList(); + HashMap obj = new HashMap(); try { - ExperimentalClass experimentalClasses = mapper.queryExperimental(assesmentId); + List experimentalClasses = mapper.queryExperimental(assesmentId); List classes = mapper.queryClass(assesmentId); - obj.add(experimentalClasses); - obj.add(classes); + obj.put("xperimentalClass",experimentalClasses); + obj.put("class",classes); resp.put("retvalue", obj); resp.put("retcode", 200);