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

master
xiaoCJ 3 months ago
parent 06a72178d0
commit f11181f771

@ -318,15 +318,40 @@ public class CaseApi {
@ApiOperation("查询案例题步骤并排序") @ApiOperation("查询案例题步骤并排序")
@AnonymousAccess @AnonymousAccess
public List<SysCaseQuestionStepWithBLOBs> selectCaseStepListBatchByIdListAndSort(@RequestParam String threeId) { 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") @PostMapping("selectCaseStepListBatchByIdList")
@ApiOperation("查询案例题步骤并排序") @ApiOperation("查询案例题步骤")
@AnonymousAccess @AnonymousAccess
public List<SysCaseQuestionStepWithBLOBs> selectCaseStepListBatchByIdListAndSortss(@RequestBody List<String> list) { public List<SysCaseQuestionStepWithBLOBs> selectCaseStepListBatchByIdList(@RequestBody List<String> list) {
return caseQuestionStepMapper.selectCaseStepListBatchByIdListAndSortss(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 * IdList
* selectCaseByChapterIdList * selectCaseByChapterIdList

@ -50,5 +50,5 @@ public interface SysCaseQuestionStepMapper {
List<SysCaseQuestionStepWithBLOBs> getCaseStepByIds(@Param("ids") List<String> ids); List<SysCaseQuestionStepWithBLOBs> getCaseStepByIds(@Param("ids") List<String> ids);
List<SysCaseQuestionStepWithBLOBs> selectCaseStepListBatchByIdListAndSort(@Param("threeId") String threeId); 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> </foreach>
</select> </select>
<select id="selectCaseStepListBatchByIdListAndSortss" resultMap="ResultMapWithBLOBs"> <select id="selectCaseStepListBatchByIdList" resultMap="ResultMapWithBLOBs">
SELECT st.three_id,sc.* SELECT st.three_id,sc.*
from sys_case_question_steps sc from sys_case_question_steps sc
left join sys_case_questions s left join sys_case_questions s
@ -456,7 +456,6 @@
<foreach item="item" collection="list" open="(" separator="," close=")"> <foreach item="item" collection="list" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
order by s.create_time ,sc.sort
</select> </select>

Loading…
Cancel
Save