diff --git a/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java b/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java index 7ffda6d..cdc2f25 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java +++ b/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.IdUtil; import com.github.pagehelper.PageInfo; import com.sztzjy.resource_center.annotation.AnonymousAccess; import com.sztzjy.resource_center.entity.*; +import com.sztzjy.resource_center.entity.dto.TrainingDto; import com.sztzjy.resource_center.mapper.SysCaseQuestionMapper; import com.sztzjy.resource_center.mapper.SysCaseQuestionStepMapper; import com.sztzjy.resource_center.mapper.SysOneCatalogMapper; @@ -71,8 +72,7 @@ public class CaseApi { sysTopicAndCourse.setId(IdUtil.randomUUID()); sysTopicAndCourse.setTopicType("1"); sysTopicAndCourse.setTopicId(uuid); - SysOneCatalog sysOneCatalogs = getSysOneCatalogs(sysCaseQuestion.getOneName()); - String oneId = sysOneCatalogs.getOneId(); + String oneId = sysOneCatalogs1.getOneId(); sysTopicAndCourse.setOneId(oneId); sysTopicAndCourse.setOneName(sysCaseQuestion.getOneName()); if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) { @@ -98,11 +98,11 @@ public class CaseApi { @AnonymousAccess @ApiOperation("案例题页面查询") @PostMapping("selectCaseList") - public PageInfo selectCaseByConditions(@RequestParam Integer index, - @RequestParam Integer size, - @RequestParam(required = false) String keyword, - @RequestParam(required = false) String systemOwner, - @RequestParam(required = false) String schoolId) { + public PageInfo selectCaseList(@RequestParam Integer index, + @RequestParam Integer size, + @RequestParam(required = false) String keyword, + @RequestParam(required = false) String systemOwner, + @RequestParam(required = false) String schoolId) { SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); String oneId = sysOneCatalogs.getOneId(); List list = caseQuestionMapper.selectCaseByConditions(keyword, oneId, schoolId); @@ -114,9 +114,21 @@ public class CaseApi { @AnonymousAccess @ApiOperation("案例题详细内容展示") @PostMapping("selectCaseDetails") - public SysCaseQuestion selectCaseByConditionsByID(@RequestParam String caseId) { - return caseQuestionMapper.selectByPrimaryKey(caseId); - + public SysCaseQuestion selectCaseByConditionsByID(@RequestParam String caseId, + @RequestParam String oneId) { + SysTopicAndCourseExample example = new SysTopicAndCourseExample(); + example.createCriteria().andOneIdEqualTo(oneId).andTopicIdEqualTo(caseId); + List sysTopicAndCourses = topicAndCourseMapper.selectByExample(example); + if (sysTopicAndCourses != null && !sysTopicAndCourses.isEmpty()) { + SysTopicAndCourse sysTopicAndCourse = sysTopicAndCourses.get(0); + SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId); + sysCaseQuestion.setTwoId(sysTopicAndCourse.getTwoId()); + sysCaseQuestion.setTwoName(sysTopicAndCourse.getTwoName()); + sysCaseQuestion.setThreeId(sysTopicAndCourse.getThreeId()); + sysCaseQuestion.setThreeName(sysTopicAndCourse.getThreeName()); + return sysCaseQuestion; + } + return null; } @@ -256,6 +268,7 @@ public class CaseApi { //案例题步骤内容查看 caseStepId @PostMapping("selectCaseStepDetails") @ApiOperation("案例题步骤内容查看") + @AnonymousAccess public SysCaseQuestionStepWithBLOBs selectCaseStepDetails(@ApiParam("案例题步骤ID") @RequestParam String caseStepId) { return caseQuestionStepMapper.selectByPrimaryKey(caseStepId); } @@ -270,10 +283,17 @@ public class CaseApi { //案例题步骤内容查看 caseStepId @PostMapping("selectCaseByChapterId") @ApiOperation("根据三级ID查询案例题集合") + @AnonymousAccess public List selectCaseByChapterId(@RequestParam String threeId) { - SysCaseQuestionExample example = new SysCaseQuestionExample(); + SysTopicAndCourseExample example = new SysTopicAndCourseExample(); example.createCriteria().andThreeIdEqualTo(threeId); - List list = caseQuestionMapper.selectByExample(example); + List sysTopicAndCourses = topicAndCourseMapper.selectByExample(example); + + List collect = sysTopicAndCourses.stream().map(SysTopicAndCourse::getTopicId).collect(Collectors.toList()); + + SysCaseQuestionExample example1 = new SysCaseQuestionExample(); + example1.createCriteria().andCaseIdIn(collect).andSourceEqualTo("管理员"); + List list = caseQuestionMapper.selectByExampleWithBLOBs(example1); return list; } @@ -286,7 +306,8 @@ public class CaseApi { */ @PostMapping("selectCaseStepListBatchByIdListAndSort") @ApiOperation("查询案例题步骤并排序") - public List selectCaseByChapterId(@RequestParam List caseIdList) { + @AnonymousAccess + public List selectCaseStepListBatchByIdListAndSort(@RequestBody List caseIdList) { SysCaseQuestionStepExample example = new SysCaseQuestionStepExample(); example.createCriteria().andCaseIdIn(caseIdList); example.setOrderByClause("sort"); @@ -303,7 +324,8 @@ public class CaseApi { */ @PostMapping("selectCaseByChapterIdList") @ApiOperation("根据章节IdList查询案例题") - public List selectCaseByChapterIdList(@RequestParam List chapterIdList) { + @AnonymousAccess + public List selectCaseByChapterIdList(@RequestBody List chapterIdList) { SysTopicAndCourseExample example = new SysTopicAndCourseExample(); example.createCriteria().andThreeIdIn(chapterIdList); List sysTopicAndCourses = topicAndCourseMapper.selectByExample(example); @@ -318,11 +340,46 @@ public class CaseApi { //*考试模式--成绩报告案例题question0riginal所属章节,contentOriginal为考核点数量,Sort为序号 @PostMapping("getGradeReportCase") @ApiOperation("考试模式/成绩报告/案例题") - public List getGradeReportCase(@RequestParam List caseIdList, + @AnonymousAccess + public List getGradeReportCase(@RequestBody List caseIdList, @RequestParam String schoolId, @RequestParam String systemOwner) { SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); String oneId = sysOneCatalogs.getOneId(); return caseQuestionStepMapper.getGradeReportCase(caseIdList, schoolId, oneId); } + + + //根据课程ID查询案例题 + @PostMapping("selectCaseByCourseId") + @ApiOperation("根据课程ID查询案例题") + @AnonymousAccess //只查学校新增的 + public List selectCaseByCourseId(@RequestParam String courseId, + @RequestParam String systemOwner, + @RequestParam String schoolId) { + SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); + String oneId = sysOneCatalogs.getOneId(); + + SysTopicAndCourseExample example = new SysTopicAndCourseExample(); + example.createCriteria().andTwoIdEqualTo(courseId).andOneIdEqualTo(oneId); + List sysTopicAndCourses = topicAndCourseMapper.selectByExample(example); + if (!sysTopicAndCourses.isEmpty()) { + List collect = sysTopicAndCourses.stream().map(SysTopicAndCourse::getTopicId).collect(Collectors.toList()); + SysCaseQuestionExample example1 = new SysCaseQuestionExample(); + example1.createCriteria().andCaseIdIn(collect).andSourceEqualTo(schoolId); + List list = caseQuestionMapper.selectByExampleWithBLOBs(example1); + return list; + } + return null; + } + + //* 单独接口 +//* 展示案例题详细信息 + @AnonymousAccess + @ApiOperation("展示案例题详细信息") + @PostMapping("selectTrainingByIds") + public List selectTrainingByIds(@RequestBody List caseStepIdList) { + List trainingDtos = caseQuestionStepMapper.selectTrainingByIds(caseStepIdList); + return trainingDtos; + } } diff --git a/src/main/java/com/sztzjy/resource_center/controller/api/CourseApi.java b/src/main/java/com/sztzjy/resource_center/controller/api/CourseApi.java index eca3040..52e9999 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/api/CourseApi.java +++ b/src/main/java/com/sztzjy/resource_center/controller/api/CourseApi.java @@ -169,7 +169,7 @@ public class CourseApi { @AnonymousAccess @ApiOperation("根据课程IDList查询章节集合并排序") @PostMapping("selectChaptersByCourseIdsAndAsc") - public List selectChaptersByCourseIdsAndAsc(@RequestParam List courseIds) { + public List selectChaptersByCourseIdsAndAsc(@RequestBody List courseIds) { SysThreeCatalogExample example = new SysThreeCatalogExample(); example.createCriteria().andTwoIdIn(courseIds); example.setOrderByClause("sort"); @@ -186,7 +186,7 @@ public class CourseApi { @AnonymousAccess @ApiOperation("查询总章节数量") @PostMapping("getTotalChapterCount") - public Integer getTotalChapterCount(String systemOwner) { + public Integer getTotalChapterCount(@RequestParam String systemOwner) { SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); String oneId = sysOneCatalogs.getOneId(); return threeCatalogMapper.countByOneId(oneId); @@ -202,7 +202,7 @@ public class CourseApi { @AnonymousAccess @ApiOperation("根据章节ID查询章节信息") @PostMapping("selectChapterByChapterId") - public SysThreeCatalog selectChapterByChapterId(String chapterId) { + public SysThreeCatalog selectChapterByChapterId(@RequestParam String chapterId) { return threeCatalogMapper.selectByPrimaryKey(chapterId); } diff --git a/src/main/java/com/sztzjy/resource_center/controller/api/ObjectiveApi.java b/src/main/java/com/sztzjy/resource_center/controller/api/ObjectiveApi.java index 8edde9f..de89976 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/api/ObjectiveApi.java +++ b/src/main/java/com/sztzjy/resource_center/controller/api/ObjectiveApi.java @@ -347,7 +347,7 @@ public class ObjectiveApi { @AnonymousAccess @ApiOperation("根据客观题IDList批量查询客观题") @PostMapping("selectBatchByIdList") - private List selectBatchByIdList(@RequestParam List objectIdList) { + private List selectBatchByIdList(@RequestBody List objectIdList) { SysObjectiveQuestionsExample example = new SysObjectiveQuestionsExample(); example.createCriteria().andObjectiveIdIn(objectIdList); List sysObjectiveQuestions = sysObjectiveQuestionMapper.selectByExample(example); @@ -571,18 +571,22 @@ public class ObjectiveApi { @AnonymousAccess @ApiOperation("获取所选客观题数量及分数") @PostMapping("getChooseObjCountAndSorce") - private Map getChooseObjCountAndSorce(@RequestParam List objectIdList) { - return sysObjectiveQuestionMapper.getChooseObjCountAndSorce(objectIdList); + private Map getChooseObjCountAndSorce(@RequestBody List objectIdList) { + + Map chooseObjCountAndSorce = sysObjectiveQuestionMapper.getChooseObjCountAndSorce(objectIdList); + return chooseObjCountAndSorce; } // *根据客观题类型査询客观题 @AnonymousAccess - @ApiOperation("获取所选客观题数量及分数") + @ApiOperation("根据客观题类型査询客观题") @PostMapping("selectObjByType") - private List selectObjByType(@RequestParam String type, - @RequestParam String schoolId, - @RequestParam String systemOwner) { - return sysObjectiveQuestionMapper.selectObjByType(type, schoolId); + private List selectObjByType(@RequestParam String type, + @RequestParam String schoolId, + @RequestParam String systemOwner) { + List sysObjectiveQuestionsDtos = sysObjectiveQuestionMapper.selectObjByType(type, schoolId); + + return sysObjectiveQuestionsDtos; } } diff --git a/src/main/java/com/sztzjy/resource_center/controller/api/ResourceApi.java b/src/main/java/com/sztzjy/resource_center/controller/api/ResourceApi.java index 0f735ad..ecb7c2a 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/api/ResourceApi.java +++ b/src/main/java/com/sztzjy/resource_center/controller/api/ResourceApi.java @@ -24,10 +24,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.File; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; @RestController @@ -159,14 +156,19 @@ public class ResourceApi { @AnonymousAccess @ApiOperation("获取资源类型数量") @PostMapping("getResourceTypeCount") - public Map getResourceTypeCount(@RequestParam String systemOwner, - @RequestParam String schoolId) { + public Map getResourceTypeCount(@RequestParam String systemOwner, + @RequestParam String schoolId) { SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); SysResourceAndCourseExample example = new SysResourceAndCourseExample(); example.createCriteria().andOneIdEqualTo(sysOneCatalogs.getOneId()); List sysResourceAndCourses = sysResourceAndCourseMapper.selectByExample(example); List ids = sysResourceAndCourses.stream().map(SysResourceAndCourse::getResourceId).collect(Collectors.toList()); - return sysResourceMapper.getCountByType(ids, schoolId); + List> countByType = sysResourceMapper.getCountByType(ids, schoolId); + Map resultMap = new HashMap<>(); + for (Map item : countByType) { + resultMap.put(item.get("resource_type").toString(), (Long) item.get("count")); + } + return resultMap; } @@ -303,5 +305,4 @@ public class ResourceApi { @Param("学校ID") @RequestParam String schoolId) { return sysResourceMapper.getMostPopularName(); } - } diff --git a/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminCaseController.java b/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminCaseController.java index 9711638..56a9590 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminCaseController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminCaseController.java @@ -1,7 +1,6 @@ package com.sztzjy.resource_center.controller.new_module.admin; import cn.hutool.core.util.IdUtil; -import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.google.common.reflect.TypeToken; import com.nimbusds.jose.shaded.gson.Gson; @@ -29,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; import java.util.List; @@ -231,8 +231,13 @@ public class AdminCaseController { @RequestParam Integer size, @RequestParam(required = false) String keyWord, @ApiParam("精品案例不传,院校案例传'院校案例'") @RequestParam(required = false) String source, - @RequestParam(required = false) List labelName) { - List adminCaseReturnDtos = adminCaseMapper.selectByConditions(keyWord, source, labelName); + @RequestParam(required = false) String labelName) { + List list = new ArrayList<>(); + if (StringUtils.isNotBlank(labelName)) { + String[] split = labelName.split(","); + list = Arrays.asList(split); + } + List adminCaseReturnDtos = adminCaseMapper.selectByConditions(keyWord, source, list); PageInfo pageInfo = PageUtil.pageHelper(adminCaseReturnDtos, index, size); return new ResultEntity<>(pageInfo); } diff --git a/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminDataController.java b/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminDataController.java index 798306d..09930b1 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminDataController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminDataController.java @@ -10,6 +10,7 @@ import com.sztzjy.resource_center.entity.admin.*; import com.sztzjy.resource_center.mapper.admin.AdminDataLabelMapper; import com.sztzjy.resource_center.mapper.admin.AdminDataMapper; import com.sztzjy.resource_center.mapper.admin.AdminFileMapper; +import com.sztzjy.resource_center.util.PageUtil; import com.sztzjy.resource_center.util.ResultEntity; import com.sztzjy.resource_center.util.file.IFileUtil; import io.swagger.annotations.Api; @@ -162,9 +163,8 @@ public class AdminDataController { @RequestParam(required = false) String keyWord, @ApiParam("精品案例不传,院校案例1") @RequestParam(required = false) String type, @RequestParam(required = false) String labelName) { - PageHelper.startPage(index, size); List adminDataReturnDtos = adminDataMapper.selectByConditions(keyWord, type, labelName); - PageInfo pageInfo = new PageInfo(adminDataReturnDtos); + PageInfo pageInfo = PageUtil.pageHelper(adminDataReturnDtos, index, size); return new ResultEntity<>(pageInfo); } diff --git a/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuCaseController.java b/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuCaseController.java index c6b8b04..11d43c8 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuCaseController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuCaseController.java @@ -16,6 +16,7 @@ import com.sztzjy.resource_center.util.file.IFileUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; +import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -24,6 +25,8 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; @@ -74,8 +77,13 @@ public class StuCaseController { @RequestParam(required = false) String keyWord, @ApiParam("精品案例传管理员,院校案例传学校ID") @RequestParam(required = false) String source, @ApiParam("收藏案例页面传") @RequestParam(required = false) String userId, - @RequestParam(required = false) List labelName) { - List adminCaseReturnDtos = adminCaseMapper.selectByConditionsByStu(keyWord, source, userId, labelName); + @RequestParam(required = false) String labelName) { + List list = new ArrayList<>(); + if (StringUtils.isNotBlank(labelName)) { + String[] split = labelName.split(","); + list = Arrays.asList(split); + } + List adminCaseReturnDtos = adminCaseMapper.selectByConditionsByStu(keyWord, source, userId, list); PageInfo pageInfo = PageUtil.pageHelper(adminCaseReturnDtos, index, size); return new ResultEntity<>(pageInfo); } diff --git a/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuDataController.java b/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuDataController.java index f8c7c34..621c537 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuDataController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuDataController.java @@ -8,6 +8,7 @@ import com.sztzjy.resource_center.entity.admin.*; import com.sztzjy.resource_center.mapper.admin.AdminCollectDataMapper; import com.sztzjy.resource_center.mapper.admin.AdminDataMapper; import com.sztzjy.resource_center.mapper.admin.AdminFileMapper; +import com.sztzjy.resource_center.util.PageUtil; import com.sztzjy.resource_center.util.ResultEntity; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -80,9 +81,8 @@ public class StuDataController { @ApiParam("为空展示所有数据,院校数据传学校ID") @RequestParam(required = false) String source, @ApiParam("收藏案例页面传") @RequestParam(required = false) String userId, @RequestParam(required = false) String labelName) { - PageHelper.startPage(index, size); - List adminDataReturnDtos = adminDataMapper.selectByConditionsBySchoolId(keyWord, source, userId, labelName); - PageInfo pageInfo = new PageInfo(adminDataReturnDtos); + List adminDataReturnDtos = adminDataMapper.selectByConditionsBySchoolId(keyWord, source, userId, labelName); + PageInfo pageInfo = PageUtil.pageHelper(adminDataReturnDtos, index, size); return new ResultEntity>(pageInfo); } } diff --git a/src/main/java/com/sztzjy/resource_center/entity/dto/TrainingDto.java b/src/main/java/com/sztzjy/resource_center/entity/dto/TrainingDto.java new file mode 100644 index 0000000..ea0ecb0 --- /dev/null +++ b/src/main/java/com/sztzjy/resource_center/entity/dto/TrainingDto.java @@ -0,0 +1,24 @@ +package com.sztzjy.resource_center.entity.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @Author xcj + * @Date 2024/7/22 + */ +@Data +public class TrainingDto { + @ApiModelProperty("案例名称") + private String name; + @ApiModelProperty("案例题ID") + private String caseId; + @ApiModelProperty("所属任务") + private String task; + @ApiModelProperty("步骤数量") + private int count; + @ApiModelProperty("案例分值") + private BigDecimal score; +} diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionStepMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionStepMapper.java index e7204bb..a119cef 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionStepMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionStepMapper.java @@ -5,6 +5,7 @@ import com.sztzjy.resource_center.entity.SysCaseQuestionStepExample; import com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs; import java.util.List; +import com.sztzjy.resource_center.entity.dto.TrainingDto; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @Mapper @@ -40,4 +41,6 @@ public interface SysCaseQuestionStepMapper { List getGradeReportCase(@Param("list") List caseIdList, @Param("schoolId") String schoolId, @Param("oneId") String oneId); + + List selectTrainingByIds(@Param("list") List caseStepIdList); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysObjectiveQuestionsMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysObjectiveQuestionsMapper.java index a60edea..7680abc 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysObjectiveQuestionsMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysObjectiveQuestionsMapper.java @@ -54,7 +54,7 @@ public interface SysObjectiveQuestionsMapper { void batchDelete(@Param("list") List ids); - Map getChooseObjCountAndSorce(@Param("list") List objectIdList); + Map getChooseObjCountAndSorce(@Param("list") List objectIdList); - List selectObjByType(@Param("type") String type,@Param("schoolId") String schoolId); + List selectObjByType(@Param("type") String type,@Param("schoolId") String schoolId); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysResourceMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysResourceMapper.java index 65f3d3f..72b14a3 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysResourceMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysResourceMapper.java @@ -45,7 +45,7 @@ public interface SysResourceMapper { @Param("threeId") String threeId, @Param("resourceName") String resourceName); - Map getCountByType(@Param("list") List ids, @Param("schoolId") String schoolId); + List> getCountByType(@Param("list") List ids, @Param("schoolId") String schoolId); @Select("SELECT resource_name FROM `sys_resource` ORDER BY count desc") String getMostPopularName(); diff --git a/src/main/java/com/sztzjy/resource_center/mapper/admin/AdminCaseMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/admin/AdminCaseMapper.java index 28db229..c6ad48d 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/admin/AdminCaseMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/admin/AdminCaseMapper.java @@ -42,10 +42,10 @@ public interface AdminCaseMapper { List selectByConditionsByStu(@Param("keyWord") String keyWord, @Param("source") String source, @Param("userId") String userId, - @Param("labelName") List labelName); + @Param("labelName") List list); List selectByConditions(@Param("keyWord") String keyWord, @Param("source") String source, - @Param("labelName") List labelName); + @Param("labelName") List list); } \ No newline at end of file diff --git a/src/main/resources/mapper/SysCaseQuestionMapper.xml b/src/main/resources/mapper/SysCaseQuestionMapper.xml index 2d3a50c..9d45f04 100644 --- a/src/main/resources/mapper/SysCaseQuestionMapper.xml +++ b/src/main/resources/mapper/SysCaseQuestionMapper.xml @@ -435,7 +435,9 @@ diff --git a/src/main/resources/mapper/SysCaseQuestionStepMapper.xml b/src/main/resources/mapper/SysCaseQuestionStepMapper.xml index 601126f..fd39172 100644 --- a/src/main/resources/mapper/SysCaseQuestionStepMapper.xml +++ b/src/main/resources/mapper/SysCaseQuestionStepMapper.xml @@ -409,4 +409,28 @@ and s2.unmount_status is FALSE GROUP BY s2.title, s3.three_name + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysObjectiveQuestionsMapper.xml b/src/main/resources/mapper/SysObjectiveQuestionsMapper.xml index 426ff5c..eeaf435 100644 --- a/src/main/resources/mapper/SysObjectiveQuestionsMapper.xml +++ b/src/main/resources/mapper/SysObjectiveQuestionsMapper.xml @@ -477,8 +477,8 @@ - + SELECT count(*),sum(score)FROM sys_objective_questions WHERE objective_id IN #{id} @@ -487,7 +487,7 @@ - SELECT s.objective_id, s.content, sc.two_name, three_name FROM sys_objective_questions s LEFT JOIN sys_topic_and_course sc @@ -496,5 +496,4 @@ and s.is_delete = FALSE and s.type = #{type} - \ No newline at end of file diff --git a/src/main/resources/mapper/SysResourceMapper.xml b/src/main/resources/mapper/SysResourceMapper.xml index fe824d1..18c5bf4 100644 --- a/src/main/resources/mapper/SysResourceMapper.xml +++ b/src/main/resources/mapper/SysResourceMapper.xml @@ -440,7 +440,7 @@ #{item} - AND source = #{schoolId} + AND source in (#{schoolId},'管理员') GROUP BY resource_type