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);