修改按章节查询步骤ID接口名称,取消排序

master
xiaoCJ
parent 06a72178d0
commit f11181f771

@ -318,15 +318,40 @@ public class CaseApi {
@ApiOperation("查询案例题步骤并排序")
@AnonymousAccess
public List<SysCaseQuestionStepWithBLOBs> selectCaseStepListBatchByIdListAndSort(@RequestParam String threeId) {
return caseQuestionStepMapper.selectCaseStepListBatchByIdListAndSort(threeId);
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andThreeIdEqualTo(threeId);
List<SysTopicAndCourse> topicAndCourseList = topicAndCourseMapper.selectByExample(example);
List<String> caseIdList = topicAndCourseList.stream().map(SysTopicAndCourse::getTopicId).collect(Collectors.toList());
SysCaseQuestionStepExample caseQuestionStepExample = new SysCaseQuestionStepExample();
caseQuestionStepExample.createCriteria().andCaseIdIn(caseIdList);
List<SysCaseQuestionStepWithBLOBs> sysCaseQuestionStepWithBLOBs = caseQuestionStepMapper.selectByExampleWithBLOBs(caseQuestionStepExample);
return sysCaseQuestionStepWithBLOBs;
}
@PostMapping("selectCaseStepListBatchByIdListAndSortss")
@ApiOperation("查询案例题步骤并排序")
@PostMapping("selectCaseStepListBatchByIdList")
@ApiOperation("查询案例题步骤")
@AnonymousAccess
public List<SysCaseQuestionStepWithBLOBs> selectCaseStepListBatchByIdListAndSortss(@RequestBody List<String> list) {
return caseQuestionStepMapper.selectCaseStepListBatchByIdListAndSortss(list);
public List<SysCaseQuestionStepWithBLOBs> selectCaseStepListBatchByIdList(@RequestBody List<String> list) {
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andThreeIdIn(list);
List<SysTopicAndCourse> topicAndCourseList = topicAndCourseMapper.selectByExample(example);
List<String> caseIdList = topicAndCourseList.stream().map(SysTopicAndCourse::getTopicId).collect(Collectors.toList());
SysCaseQuestionStepExample caseQuestionStepExample = new SysCaseQuestionStepExample();
caseQuestionStepExample.createCriteria().andCaseIdIn(caseIdList);
List<SysCaseQuestionStepWithBLOBs> sysCaseQuestionStepWithBLOBs = caseQuestionStepMapper.selectByExampleWithBLOBs(caseQuestionStepExample);
for (SysTopicAndCourse sysTopicAndCourse : topicAndCourseList) {
for (SysCaseQuestionStepWithBLOBs sysCaseQuestionStepWithBLOB : sysCaseQuestionStepWithBLOBs) {
if (sysTopicAndCourse.getTopicId().equals(sysCaseQuestionStepWithBLOB.getCaseId())){
sysCaseQuestionStepWithBLOB.setThreeId(sysTopicAndCourse.getThreeId());
}
}
}
return sysCaseQuestionStepWithBLOBs;
}
/**
* IdList
* selectCaseByChapterIdList

@ -50,5 +50,5 @@ public interface SysCaseQuestionStepMapper {
List<SysCaseQuestionStepWithBLOBs> getCaseStepByIds(@Param("ids") List<String> ids);
List<SysCaseQuestionStepWithBLOBs> selectCaseStepListBatchByIdListAndSort(@Param("threeId") String threeId);
List<SysCaseQuestionStepWithBLOBs> selectCaseStepListBatchByIdListAndSortss(@Param("list") List<String> list);
List<SysCaseQuestionStepWithBLOBs> selectCaseStepListBatchByIdList(@Param("list") List<String> list);
}

@ -445,7 +445,7 @@
</foreach>
</select>
<select id="selectCaseStepListBatchByIdListAndSortss" resultMap="ResultMapWithBLOBs">
<select id="selectCaseStepListBatchByIdList" resultMap="ResultMapWithBLOBs">
SELECT st.three_id,sc.*
from sys_case_question_steps sc
left join sys_case_questions s
@ -456,7 +456,6 @@
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
order by s.create_time ,sc.sort
</select>

Loading…
Cancel
Save