xiaoCJ 8 months ago
parent 772003bf33
commit 6f15499c6f

@ -9,6 +9,7 @@ import com.sztzjy.resource_center.mapper.SysCaseQuestionMapper;
import com.sztzjy.resource_center.mapper.SysCaseQuestionStepMapper; import com.sztzjy.resource_center.mapper.SysCaseQuestionStepMapper;
import com.sztzjy.resource_center.mapper.SysOneCatalogMapper; import com.sztzjy.resource_center.mapper.SysOneCatalogMapper;
import com.sztzjy.resource_center.mapper.SysTopicAndCourseMapper; import com.sztzjy.resource_center.mapper.SysTopicAndCourseMapper;
import com.sztzjy.resource_center.util.PageUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
@ -76,9 +77,11 @@ public class CaseApi {
sysTopicAndCourse.setOneName(sysCaseQuestion.getOneName()); sysTopicAndCourse.setOneName(sysCaseQuestion.getOneName());
if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) { if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) {
sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId()); sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId());
sysTopicAndCourse.setTwoName(sysCaseQuestion.getTwoName());
} }
if (StringUtils.isNotBlank(sysCaseQuestion.getThreeId())) { if (StringUtils.isNotBlank(sysCaseQuestion.getThreeId())) {
sysTopicAndCourse.setThreeId(sysCaseQuestion.getThreeId()); sysTopicAndCourse.setThreeId(sysCaseQuestion.getThreeId());
sysTopicAndCourse.setThreeName(sysCaseQuestion.getThreeName());
} }
topicAndCourseMapper.insert(sysTopicAndCourse); topicAndCourseMapper.insert(sysTopicAndCourse);
return true; return true;
@ -100,12 +103,11 @@ public class CaseApi {
@RequestParam(required = false) String keyword, @RequestParam(required = false) String keyword,
@RequestParam(required = false) String systemOwner, @RequestParam(required = false) String systemOwner,
@RequestParam(required = false) String schoolId) { @RequestParam(required = false) String schoolId) {
PageHelper.startPage(index, size);
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
String oneId = sysOneCatalogs.getOneId(); String oneId = sysOneCatalogs.getOneId();
List<SysCaseQuestion> list = caseQuestionMapper.selectCaseByConditions(keyword, oneId, schoolId); List<SysCaseQuestion> list = caseQuestionMapper.selectCaseByConditions(keyword, oneId, schoolId);
PageInfo<SysCaseQuestion> pageInfo = new PageInfo<SysCaseQuestion>(list); PageInfo pageInfo1 = PageUtil.pageHelper(list, index, size);
return pageInfo; return pageInfo1;
} }
//案例题详情查询 caseId //案例题详情查询 caseId
@ -151,7 +153,7 @@ public class CaseApi {
@PostMapping("updateCase") @PostMapping("updateCase")
public Boolean updateCase(@RequestBody SysCaseQuestion sysCaseQuestion) { public Boolean updateCase(@RequestBody SysCaseQuestion sysCaseQuestion) {
List<SysTopicAndCourse> sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId()); List<SysTopicAndCourse> sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId());
if (!sysTopicAndCourses.isEmpty()) { if (sysTopicAndCourses.isEmpty()) {
return false; return false;
} else { } else {
caseQuestionMapper.updateByPrimaryKey(sysCaseQuestion); caseQuestionMapper.updateByPrimaryKey(sysCaseQuestion);

@ -436,9 +436,11 @@
<!--条件查询 无重复数据--> <!--条件查询 无重复数据-->
<select id="selectCaseByConditions" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectCaseByConditions" parameterType="java.lang.String" resultMap="BaseResultMap">
select * from sys_case_questions s select * from sys_case_questions s
left join sys_topic_and_course st
on s.case_id = st.topic_id
<where> <where>
<if test="oneId != null and oneId != ''"> <if test="oneId != null and oneId != ''">
s.one_id = #{oneId} st.one_id = #{oneId}
</if> </if>
<if test="title != null and title != ''"> <if test="title != null and title != ''">
and s.title LIKE CONCAT('%', #{title}, '%') and s.title LIKE CONCAT('%', #{title}, '%')

Loading…
Cancel
Save