新增三方接口,修改bug

master
xiaoCJ 8 months ago
parent 6f15499c6f
commit ac777fd62e

@ -18,10 +18,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
/** /**
@ -60,7 +58,7 @@ public class CaseController {
} }
String title = sysCaseQuestion.getTitle(); String title = sysCaseQuestion.getTitle();
SysCaseQuestionExample example = new SysCaseQuestionExample(); SysCaseQuestionExample example = new SysCaseQuestionExample();
example.createCriteria().andTitleEqualTo(title); example.createCriteria().andTitleEqualTo(title).andUnmountStatusEqualTo(false).andOneIdEqualTo(sysCaseQuestion.getOneId());
List<SysCaseQuestion> sysCaseQuestions = caseQuestionMapper.selectByExample(example); List<SysCaseQuestion> sysCaseQuestions = caseQuestionMapper.selectByExample(example);
if (!sysCaseQuestions.isEmpty()) { if (!sysCaseQuestions.isEmpty()) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "案例名称不能重复!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "案例名称不能重复!");
@ -131,13 +129,21 @@ public class CaseController {
@PostMapping("updateCase") @PostMapping("updateCase")
public ResultEntity<HttpStatus> updateCase(@RequestBody SysCaseQuestion sysCaseQuestion, public ResultEntity<HttpStatus> updateCase(@RequestBody SysCaseQuestion sysCaseQuestion,
@ApiParam("谁调的请求,传管理员/学校ID") @RequestParam String source) { @ApiParam("谁调的请求,传管理员/学校ID") @RequestParam String source) {
List<SysTopicAndCourse> sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId()); List<SysTopicAndCourse> sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId(), sysCaseQuestion.getOneId());
if (!sysTopicAndCourses.isEmpty()) { if (!sysTopicAndCourses.isEmpty()) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "该案例题正在被使用!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "该案例题正在被使用!");
} else { } else {
//todo 管理员任意修改,老师只能改自己的 //todo 管理员任意修改,老师只能改自己的
if ("管理员".equals(source) || source.equals(sysCaseQuestion.getSource())) { if ("管理员".equals(source) || source.equals(sysCaseQuestion.getSource())) {
caseQuestionMapper.updateByPrimaryKey(sysCaseQuestion); if (!sysTopicAndCourses.isEmpty()) {
SysTopicAndCourse sysTopicAndCourse = sysTopicAndCourses.get(0);
sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId());
sysTopicAndCourse.setThreeId(sysCaseQuestion.getThreeId());
sysTopicAndCourse.setTwoName(sysCaseQuestion.getTwoName());
sysTopicAndCourse.setThreeName(sysCaseQuestion.getThreeName());
topicAndCourseMapper.updateByPrimaryKeySelective(sysTopicAndCourse);
}
caseQuestionMapper.updateByPrimaryKeySelective(sysCaseQuestion);
return new ResultEntity<>(HttpStatus.OK, "编辑成功!"); return new ResultEntity<>(HttpStatus.OK, "编辑成功!");
} else { } else {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "权限不足!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "权限不足!");
@ -152,25 +158,24 @@ public class CaseController {
@PostMapping("deleteCase") @PostMapping("deleteCase")
public ResultEntity<HttpStatus> deleteCase(@RequestBody SysCaseQuestion sysCaseQuestion, public ResultEntity<HttpStatus> deleteCase(@RequestBody SysCaseQuestion sysCaseQuestion,
@ApiParam("哪个用的掉的请求,传管理员/学校ID") @RequestParam String source) { @ApiParam("哪个用的掉的请求,传管理员/学校ID") @RequestParam String source) {
List<SysTopicAndCourse> sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId()); List<SysTopicAndCourse> sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId(), sysCaseQuestion.getOneId());
if (!sysTopicAndCourses.isEmpty()) { if (!sysTopicAndCourses.isEmpty()) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "无法删除!该案例题正在被使用!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "无法删除!该案例题正在被使用!");
} else { } else {
//todo 管理员任意删除 老师只能删除自己上传的 //todo 管理员任意删除 老师只能删除自己上传的
if ("管理员".equals(source) || source.equals(sysCaseQuestion.getSource())) { if ("管理员".equals(source) || source.equals(sysCaseQuestion.getSource())) {
SysCaseQuestion dataSysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(sysCaseQuestion.getCaseId()); topicAndCourseMapper.deleteByPrimaryKey(sysTopicAndCourses.get(0).getId());
dataSysCaseQuestion.setUnmountStatus(true); caseQuestionMapper.deleteByPrimaryKey(sysCaseQuestion.getCaseId());
caseQuestionMapper.updateByPrimaryKey(dataSysCaseQuestion); return new ResultEntity<>(HttpStatus.OK, "删除成功!");
return new ResultEntity<>(HttpStatus.OK, "编辑成功!");
} else { } else {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "权限不足!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "权限不足!");
} }
} }
} }
private List<SysTopicAndCourse> getSysTopicAndCourses(String caseId) { private List<SysTopicAndCourse> getSysTopicAndCourses(String caseId, String oneId) {
SysTopicAndCourseExample example = new SysTopicAndCourseExample(); SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andTopicIdEqualTo(caseId).andTopicTypeEqualTo("1"); example.createCriteria().andTopicIdEqualTo(caseId).andOneIdEqualTo(oneId).andTopicTypeEqualTo("1");
List<SysTopicAndCourse> sysTopicAndCourses = topicAndCourseMapper.selectByExample(example); List<SysTopicAndCourse> sysTopicAndCourses = topicAndCourseMapper.selectByExample(example);
return sysTopicAndCourses; return sysTopicAndCourses;
} }

@ -1,7 +1,6 @@
package com.sztzjy.resource_center.controller.api; package com.sztzjy.resource_center.controller.api;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sztzjy.resource_center.annotation.AnonymousAccess; import com.sztzjy.resource_center.annotation.AnonymousAccess;
import com.sztzjy.resource_center.entity.*; import com.sztzjy.resource_center.entity.*;
@ -41,6 +40,7 @@ public class CaseApi {
@ApiOperation("案例题新增") @ApiOperation("案例题新增")
@PostMapping("insertCase") @PostMapping("insertCase")
public Boolean insertCase(@ApiParam("目前二级三级ID可以为空来源和题型要传,上架状态传true") @RequestBody SysCaseQuestion sysCaseQuestion) { public Boolean insertCase(@ApiParam("目前二级三级ID可以为空来源和题型要传,上架状态传true") @RequestBody SysCaseQuestion sysCaseQuestion) {
SysOneCatalog sysOneCatalogs1 = getSysOneCatalogs(sysCaseQuestion.getOneName());
if (("3").equals(sysCaseQuestion.getType())) { if (("3").equals(sysCaseQuestion.getType())) {
return false; return false;
} }
@ -55,7 +55,7 @@ public class CaseApi {
} }
String title = sysCaseQuestion.getTitle(); String title = sysCaseQuestion.getTitle();
SysCaseQuestionExample example = new SysCaseQuestionExample(); SysCaseQuestionExample example = new SysCaseQuestionExample();
example.createCriteria().andTitleEqualTo(title); example.createCriteria().andTitleEqualTo(title).andUnmountStatusEqualTo(false).andOneIdEqualTo(sysOneCatalogs1.getOneId());
List<SysCaseQuestion> sysCaseQuestions = caseQuestionMapper.selectByExample(example); List<SysCaseQuestion> sysCaseQuestions = caseQuestionMapper.selectByExample(example);
if (!sysCaseQuestions.isEmpty()) { if (!sysCaseQuestions.isEmpty()) {
return false; return false;
@ -124,11 +124,15 @@ public class CaseApi {
@AnonymousAccess @AnonymousAccess
@ApiOperation("案例题删除") //逻辑删除 @ApiOperation("案例题删除") //逻辑删除
@PostMapping("caseDelete") @PostMapping("caseDelete")
public Boolean deleteCase(@RequestParam String caseId) { public Boolean deleteCase(@RequestParam String caseId, @RequestParam String systemOwner) {
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
List<SysTopicAndCourse> sysTopicAndCourses = getSysTopicAndCourses(caseId, sysOneCatalogs.getOneId());
SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId); SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId);
String source = sysCaseQuestion.getSource(); String source = sysCaseQuestion.getSource();
//todo 管理员任意删除 老师只能删除自己上传的
if (!"管理员".equals(source)) { if (!"管理员".equals(source)) {
if (!sysTopicAndCourses.isEmpty()) {
topicAndCourseMapper.deleteByPrimaryKey(sysTopicAndCourses.get(0).getId());
}
SysCaseQuestion dataSysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(sysCaseQuestion.getCaseId()); SysCaseQuestion dataSysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(sysCaseQuestion.getCaseId());
dataSysCaseQuestion.setUnmountStatus(true); dataSysCaseQuestion.setUnmountStatus(true);
caseQuestionMapper.updateByPrimaryKey(dataSysCaseQuestion); caseQuestionMapper.updateByPrimaryKey(dataSysCaseQuestion);
@ -139,6 +143,14 @@ public class CaseApi {
} }
private List<SysTopicAndCourse> getSysTopicAndCourses(String caseId, String oneId) {
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andTopicIdEqualTo(caseId).andOneIdEqualTo(oneId).andTopicTypeEqualTo("1");
List<SysTopicAndCourse> sysTopicAndCourses = topicAndCourseMapper.selectByExample(example);
return sysTopicAndCourses;
}
private List<SysTopicAndCourse> getSysTopicAndCourses(String caseId) { private List<SysTopicAndCourse> getSysTopicAndCourses(String caseId) {
SysTopicAndCourseExample example = new SysTopicAndCourseExample(); SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andTopicIdEqualTo(caseId).andTopicTypeEqualTo("1"); example.createCriteria().andTopicIdEqualTo(caseId).andTopicTypeEqualTo("1");
@ -152,11 +164,26 @@ public class CaseApi {
@ApiOperation("案例题编辑") @ApiOperation("案例题编辑")
@PostMapping("updateCase") @PostMapping("updateCase")
public Boolean updateCase(@RequestBody SysCaseQuestion sysCaseQuestion) { public Boolean updateCase(@RequestBody SysCaseQuestion sysCaseQuestion) {
List<SysTopicAndCourse> sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId()); SysOneCatalog sysOneCatalogs = getSysOneCatalogs(sysCaseQuestion.getOneName());
if (sysTopicAndCourses.isEmpty()) { SysCaseQuestion sysCaseQuestion1 = caseQuestionMapper.selectByPrimaryKey(sysCaseQuestion.getCaseId());
if (sysCaseQuestion1 == null) {
return false;
}
if (!sysCaseQuestion.getSource().equals(sysCaseQuestion1.getSource())) { //老师不能修改管理员上传的,不同直接返回
return false; return false;
} else { } else {
caseQuestionMapper.updateByPrimaryKey(sysCaseQuestion); SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andOneIdEqualTo(sysOneCatalogs.getOneId())
.andTopicIdEqualTo(sysCaseQuestion.getCaseId())
.andTopicTypeEqualTo("1");
List<SysTopicAndCourse> sysTopicAndCourses = topicAndCourseMapper.selectByExample(example);
if (!sysTopicAndCourses.isEmpty()) {
SysTopicAndCourse sysTopicAndCourse = sysTopicAndCourses.get(0);
sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId());
sysTopicAndCourse.setTwoName(sysCaseQuestion.getTwoName());
topicAndCourseMapper.updateByPrimaryKeySelective(sysTopicAndCourse);
}
caseQuestionMapper.updateByPrimaryKeySelective(sysCaseQuestion);
return true; return true;
} }
} }
@ -204,10 +231,10 @@ public class CaseApi {
@PostMapping("updateCaseStep") @PostMapping("updateCaseStep")
public Boolean updateCaseStep(@RequestBody SysCaseQuestionStepWithBLOBs caseQuestionStepWithBLOBs) { public Boolean updateCaseStep(@RequestBody SysCaseQuestionStepWithBLOBs caseQuestionStepWithBLOBs) {
List<SysTopicAndCourse> sysTopicAndCourses = getSysTopicAndCourses(caseQuestionStepWithBLOBs.getCaseId()); List<SysTopicAndCourse> sysTopicAndCourses = getSysTopicAndCourses(caseQuestionStepWithBLOBs.getCaseId());
if (!sysTopicAndCourses.isEmpty()) { if (sysTopicAndCourses.isEmpty()) {
return false; return false;
} else { } else {
caseQuestionStepMapper.updateByPrimaryKey(caseQuestionStepWithBLOBs); caseQuestionStepMapper.updateByPrimaryKeySelective(caseQuestionStepWithBLOBs);
return true; return true;
} }
} }
@ -217,8 +244,8 @@ public class CaseApi {
@ApiOperation("案例题步骤删除") @ApiOperation("案例题步骤删除")
@PostMapping("deleteCaseStep") @PostMapping("deleteCaseStep")
public Boolean deleteCaseStep(@RequestParam String caseStepId) { public Boolean deleteCaseStep(@RequestParam String caseStepId) {
List<SysTopicAndCourse> sysTopicAndCourses = getSysTopicAndCourses(caseStepId); SysCaseQuestionStepWithBLOBs sysCaseQuestionStepWithBLOBs = caseQuestionStepMapper.selectByPrimaryKey(caseStepId);
if (!sysTopicAndCourses.isEmpty()) { if (sysCaseQuestionStepWithBLOBs == null) {
return false; return false;
} else { } else {
caseQuestionStepMapper.deleteByPrimaryKey(caseStepId); caseQuestionStepMapper.deleteByPrimaryKey(caseStepId);
@ -286,4 +313,16 @@ public class CaseApi {
return caseQuestionMapper.selectByExampleWithBLOBs(sysCaseQuestionExample); return caseQuestionMapper.selectByExampleWithBLOBs(sysCaseQuestionExample);
} }
//单独接口
//*考试模式--成绩报告案例题question0riginal所属章节contentOriginal为考核点数量,Sort为序号
@PostMapping("getGradeReportCase")
@ApiOperation("考试模式/成绩报告/案例题")
public List<SysCaseQuestionStepWithBLOBs> getGradeReportCase(@RequestParam List<String> caseIdList,
@RequestParam String schoolId,
@RequestParam String systemOwner) {
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
String oneId = sysOneCatalogs.getOneId();
return caseQuestionStepMapper.getGradeReportCase(caseIdList, schoolId, oneId);
}
} }

@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
@RestController @RestController
@Api(tags = "课程方面API") @Api(tags = "课程方面API")
@ -206,4 +207,16 @@ public class CourseApi {
} }
/**
*
*/
@AnonymousAccess
@ApiOperation("查询章节名称集合")
@PostMapping("selectNameByCourseID")
public List<String> selectNameByCourseID(@RequestParam String schoolId,
@RequestParam String systemOwner) {
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
String oneId = sysOneCatalogs.getOneId();
return threeCatalogMapper.selectNameByCourseID(schoolId,oneId);
}
} }

@ -9,6 +9,7 @@ import com.sztzjy.resource_center.entity.dto.SysObjectiveQuestionsDto;
import com.sztzjy.resource_center.mapper.SysObjectiveQuestionsMapper; import com.sztzjy.resource_center.mapper.SysObjectiveQuestionsMapper;
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 com.sztzjy.resource_center.util.file.IFileUtil; import com.sztzjy.resource_center.util.file.IFileUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -160,7 +161,7 @@ public class ObjectiveApi {
* return:PageInfo<SysObjectiveQuestions> * return:PageInfo<SysObjectiveQuestions>
*/ */
@AnonymousAccess @AnonymousAccess
@ApiOperation("课程配置/题目条件查询") @ApiOperation("客观题列表查看")
@PostMapping("selectObjectiveList") //todo 关于老师删除的题库如何查询 @PostMapping("selectObjectiveList") //todo 关于老师删除的题库如何查询
private PageInfo<SysObjectiveQuestionsDto> selectObjectiveList(@RequestParam Integer index, private PageInfo<SysObjectiveQuestionsDto> selectObjectiveList(@RequestParam Integer index,
@RequestParam Integer size, @RequestParam Integer size,
@ -168,10 +169,12 @@ public class ObjectiveApi {
@RequestParam(required = false) String chapterId, @RequestParam(required = false) String chapterId,
@RequestParam(required = false) String type, @RequestParam(required = false) String type,
@RequestParam String schoolId, @RequestParam String schoolId,
@ApiParam("题干") @RequestParam(required = false) String content) { @ApiParam("题干") @RequestParam(required = false) String content,
PageHelper.startPage(index, size); @RequestParam String systemOwner) {
List<SysObjectiveQuestionsDto> list = sysObjectiveQuestionMapper.getTopicByConfig(null, courseId, chapterId, type, schoolId, content); SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
PageInfo<SysObjectiveQuestionsDto> pageInfo = new PageInfo(list); String oneId = sysOneCatalogs.getOneId();
List<SysObjectiveQuestionsDto> list = sysObjectiveQuestionMapper.getTopicByConfig(oneId, courseId, chapterId, type, schoolId, content);
PageInfo pageInfo = PageUtil.pageHelper(list, index, size);
return (pageInfo); return (pageInfo);
} }
@ -526,4 +529,24 @@ public class ObjectiveApi {
List<SysObjectiveQuestions> sysObjectiveQuestions = sysObjectiveQuestionMapper.selectByExample(example1); List<SysObjectiveQuestions> sysObjectiveQuestions = sysObjectiveQuestionMapper.selectByExample(example1);
return sysObjectiveQuestions.size(); return sysObjectiveQuestions.size();
} }
//*获取所选客观题数量及分数
@AnonymousAccess
@ApiOperation("获取所选客观题数量及分数")
@PostMapping("getChooseObjCountAndSorce")
private Map<Integer, BigDecimal> getChooseObjCountAndSorce(@RequestParam List<String> objectIdList) {
return sysObjectiveQuestionMapper.getChooseObjCountAndSorce(objectIdList);
}
// *根据客观题类型査询客观题
@AnonymousAccess
@ApiOperation("获取所选客观题数量及分数")
@PostMapping("selectObjByType")
private List<SysObjectiveQuestions> selectObjByType(@RequestParam String type,
@RequestParam String schoolId,
@RequestParam String systemOwner) {
return sysObjectiveQuestionMapper.selectObjByType(type, schoolId);
}
} }

@ -16,7 +16,6 @@ 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;
import org.apache.commons.lang3.StringUtils; 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.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;

@ -87,7 +87,7 @@ public class StuCaseController {
* *
* @param ids * @param ids
*/ */
@GetMapping("/downloadZIP") @PostMapping("/downloadZIP")
@ApiOperation("数据文件打包下载") @ApiOperation("数据文件打包下载")
@AnonymousAccess @AnonymousAccess
public void download(@RequestBody List<String> ids, HttpServletResponse response) { public void download(@RequestBody List<String> ids, HttpServletResponse response) {

@ -36,4 +36,8 @@ public interface SysCaseQuestionStepMapper {
int updateByPrimaryKeyWithBLOBs(SysCaseQuestionStepWithBLOBs record); int updateByPrimaryKeyWithBLOBs(SysCaseQuestionStepWithBLOBs record);
int updateByPrimaryKey(SysCaseQuestionStep record); int updateByPrimaryKey(SysCaseQuestionStep record);
List<SysCaseQuestionStepWithBLOBs> getGradeReportCase(@Param("list") List<String> caseIdList,
@Param("schoolId") String schoolId,
@Param("oneId") String oneId);
} }

@ -5,8 +5,11 @@ import com.sztzjy.resource_center.entity.SysObjectiveQuestionsExample;
import com.sztzjy.resource_center.entity.dto.SysObjectiveQuestionsDto; import com.sztzjy.resource_center.entity.dto.SysObjectiveQuestionsDto;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Map;
@Mapper @Mapper
public interface SysObjectiveQuestionsMapper { public interface SysObjectiveQuestionsMapper {
@ -49,4 +52,9 @@ public interface SysObjectiveQuestionsMapper {
); );
void batchDelete(@Param("list") List<String> ids); void batchDelete(@Param("list") List<String> ids);
Map<Integer, BigDecimal> getChooseObjCountAndSorce(@Param("list") List<String> objectIdList);
List<SysObjectiveQuestions> selectObjByType(@Param("type") String type,@Param("schoolId") String schoolId);
} }

@ -2,12 +2,13 @@ package com.sztzjy.resource_center.mapper;
import com.sztzjy.resource_center.entity.SysThreeCatalog; import com.sztzjy.resource_center.entity.SysThreeCatalog;
import com.sztzjy.resource_center.entity.SysThreeCatalogExample; import com.sztzjy.resource_center.entity.SysThreeCatalogExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
@Mapper @Mapper
public interface SysThreeCatalogMapper { public interface SysThreeCatalogMapper {
long countByExample(SysThreeCatalogExample example); long countByExample(SysThreeCatalogExample example);
@ -33,10 +34,18 @@ public interface SysThreeCatalogMapper {
int updateByPrimaryKey(SysThreeCatalog record); int updateByPrimaryKey(SysThreeCatalog record);
@Select("select three_id,three_name from sys_three_catalog where ont_id = #{oneId} and two_id =#{twoId} order by sort ASC") @Select("select three_id,three_name from sys_three_catalog where ont_id = #{oneId} and two_id =#{twoId} order by sort ASC")
List<Map<String, String>> getAllThreeCatalogList(@Param("oneId")String oneId, @Param("twoId")String twoId); List<Map<String, String>> getAllThreeCatalogList(@Param("oneId") String oneId, @Param("twoId") String twoId);
void updateByBatch(@Param("sysThreeCatalogs") List<SysThreeCatalog> sysThreeCatalogs); void updateByBatch(@Param("sysThreeCatalogs") List<SysThreeCatalog> sysThreeCatalogs);
@Select("select count(*) from sys_three_catalog where ont_id = #{oneId}") @Select("select count(*) from sys_three_catalog where ont_id = #{oneId}")
Integer countByOneId(@Param("oneId") String oneId); Integer countByOneId(@Param("oneId") String oneId);
@Select("SELECT three_name FROM sys_three_catalog s \n" +
" join sys_two_catalog st\n" +
"ON st.two_id = s.two_id \n" +
"AND s.ont_id = #{oneId}\n" +
"where s.creator in ('管理员',#{source})")
List<String> selectNameByCourseID(@Param("oneId") String oneId,
@Param("source") String source);
} }

@ -36,7 +36,7 @@ public class CompressUtil {
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile)); ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile));
for (int i = 0; i < filePaths.size(); i++) { for (int i = 0; i < filePaths.size(); i++) {
String relativeName = filePaths.get(i).get("name"); String relativeName = filePaths.get(i).get("name");
String relativePath = filePath+filePaths.get(i).get("file_url")+"/"+relativeName; String relativePath = filePath+filePaths.get(i).get("file_url");
if (StringUtils.isEmpty(relativePath)) { if (StringUtils.isEmpty(relativePath)) {
continue; continue;
} }

@ -1,380 +1,412 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sztzjy.resource_center.mapper.SysCaseQuestionStepMapper"> <mapper namespace="com.sztzjy.resource_center.mapper.SysCaseQuestionStepMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.SysCaseQuestionStep"> <resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.SysCaseQuestionStep">
<id column="case_step_id" jdbcType="VARCHAR" property="caseStepId" /> <id column="case_step_id" jdbcType="VARCHAR" property="caseStepId"/>
<result column="case_id" jdbcType="VARCHAR" property="caseId" /> <result column="case_id" jdbcType="VARCHAR" property="caseId"/>
<result column="sort" jdbcType="INTEGER" property="sort" /> <result column="sort" jdbcType="INTEGER" property="sort"/>
<result column="score" jdbcType="DECIMAL" property="score" /> <result column="score" jdbcType="DECIMAL" property="score"/>
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
<result column="title" jdbcType="LONGVARCHAR" property="title" /> type="com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs">
<result column="content" jdbcType="LONGVARCHAR" property="content" /> <result column="title" jdbcType="LONGVARCHAR" property="title"/>
<result column="question" jdbcType="LONGVARCHAR" property="question" /> <result column="content" jdbcType="LONGVARCHAR" property="content"/>
<result column="answer" jdbcType="LONGVARCHAR" property="answer" /> <result column="question" jdbcType="LONGVARCHAR" property="question"/>
<result column="practice_answer" jdbcType="LONGVARCHAR" property="practiceAnswer" /> <result column="answer" jdbcType="LONGVARCHAR" property="answer"/>
<result column="content_original" jdbcType="LONGVARCHAR" property="contentOriginal" /> <result column="practice_answer" jdbcType="LONGVARCHAR" property="practiceAnswer"/>
<result column="question_original" jdbcType="LONGVARCHAR" property="questionOriginal" /> <result column="content_original" jdbcType="LONGVARCHAR" property="contentOriginal"/>
<result column="answer_original" jdbcType="LONGVARCHAR" property="answerOriginal" /> <result column="question_original" jdbcType="LONGVARCHAR" property="questionOriginal"/>
<result column="practice_answer_original" jdbcType="LONGVARCHAR" property="practiceAnswerOriginal" /> <result column="answer_original" jdbcType="LONGVARCHAR" property="answerOriginal"/>
</resultMap> <result column="practice_answer_original" jdbcType="LONGVARCHAR" property="practiceAnswerOriginal"/>
<sql id="Example_Where_Clause"> </resultMap>
<where> <sql id="Example_Where_Clause">
<foreach collection="oredCriteria" item="criteria" separator="or"> <where>
<if test="criteria.valid"> <foreach collection="oredCriteria" item="criteria" separator="or">
<trim prefix="(" prefixOverrides="and" suffix=")"> <if test="criteria.valid">
<foreach collection="criteria.criteria" item="criterion"> <trim prefix="(" prefixOverrides="and" suffix=")">
<choose> <foreach collection="criteria.criteria" item="criterion">
<when test="criterion.noValue"> <choose>
and ${criterion.condition} <when test="criterion.noValue">
</when> and ${criterion.condition}
<when test="criterion.singleValue"> </when>
and ${criterion.condition} #{criterion.value} <when test="criterion.singleValue">
</when> and ${criterion.condition} #{criterion.value}
<when test="criterion.betweenValue"> </when>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} <when test="criterion.betweenValue">
</when> and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
<when test="criterion.listValue"> </when>
and ${criterion.condition} <when test="criterion.listValue">
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> and ${criterion.condition}
#{listItem} <foreach close=")" collection="criterion.value" item="listItem" open="("
</foreach> separator=",">
</when> #{listItem}
</choose> </foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach> </foreach>
</trim> </where>
</if> </sql>
</foreach> <sql id="Update_By_Example_Where_Clause">
</where> <where>
</sql> <foreach collection="example.oredCriteria" item="criteria" separator="or">
<sql id="Update_By_Example_Where_Clause"> <if test="criteria.valid">
<where> <trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="example.oredCriteria" item="criteria" separator="or"> <foreach collection="criteria.criteria" item="criterion">
<if test="criteria.valid"> <choose>
<trim prefix="(" prefixOverrides="and" suffix=")"> <when test="criterion.noValue">
<foreach collection="criteria.criteria" item="criterion"> and ${criterion.condition}
<choose> </when>
<when test="criterion.noValue"> <when test="criterion.singleValue">
and ${criterion.condition} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.singleValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.listValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition}
</when> <foreach close=")" collection="criterion.value" item="listItem" open="("
<when test="criterion.listValue"> separator=",">
and ${criterion.condition} #{listItem}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> </foreach>
#{listItem} </when>
</foreach> </choose>
</when> </foreach>
</choose> </trim>
</if>
</foreach> </foreach>
</trim> </where>
</if> </sql>
</foreach> <sql id="Base_Column_List">
</where> case_step_id
</sql> , case_id, sort, score
<sql id="Base_Column_List"> </sql>
case_step_id, case_id, sort, score <sql id="Blob_Column_List">
</sql> title
<sql id="Blob_Column_List"> , content, question, answer, practice_answer, content_original, question_original,
title, content, question, answer, practice_answer, content_original, question_original,
answer_original, practice_answer_original answer_original, practice_answer_original
</sql> </sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepExample" resultMap="ResultMapWithBLOBs"> <select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepExample"
select resultMap="ResultMapWithBLOBs">
<if test="distinct"> select
distinct <if test="distinct">
</if> distinct
<include refid="Base_Column_List" /> </if>
, <include refid="Base_Column_List"/>
<include refid="Blob_Column_List" /> ,
from sys_case_question_steps <include refid="Blob_Column_List"/>
<if test="_parameter != null"> from sys_case_question_steps
<include refid="Example_Where_Clause" /> <if test="_parameter != null">
</if> <include refid="Example_Where_Clause"/>
<if test="orderByClause != null"> </if>
order by ${orderByClause} <if test="orderByClause != null">
</if> order by ${orderByClause}
</select> </if>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepExample" resultMap="BaseResultMap"> </select>
select <select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepExample"
<if test="distinct"> resultMap="BaseResultMap">
distinct select
</if> <if test="distinct">
<include refid="Base_Column_List" /> distinct
from sys_case_question_steps </if>
<if test="_parameter != null"> <include refid="Base_Column_List"/>
<include refid="Example_Where_Clause" /> from sys_case_question_steps
</if> <if test="_parameter != null">
<if test="orderByClause != null"> <include refid="Example_Where_Clause"/>
order by ${orderByClause} </if>
</if> <if test="orderByClause != null">
</select> order by ${orderByClause}
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs"> </if>
select </select>
<include refid="Base_Column_List" /> <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
, select
<include refid="Blob_Column_List" /> <include refid="Base_Column_List"/>
from sys_case_question_steps ,
where case_step_id = #{caseStepId,jdbcType=VARCHAR} <include refid="Blob_Column_List"/>
</select> from sys_case_question_steps
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> where case_step_id = #{caseStepId,jdbcType=VARCHAR}
delete from sys_case_question_steps </select>
where case_step_id = #{caseStepId,jdbcType=VARCHAR} <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
</delete> delete
<delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepExample"> from sys_case_question_steps
delete from sys_case_question_steps where case_step_id = #{caseStepId,jdbcType=VARCHAR}
<if test="_parameter != null"> </delete>
<include refid="Example_Where_Clause" /> <delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepExample">
</if> delete from sys_case_question_steps
</delete> <if test="_parameter != null">
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs"> <include refid="Example_Where_Clause"/>
insert into sys_case_question_steps (case_step_id, case_id, sort, </if>
score, title, content, </delete>
question, answer, practice_answer, <insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs">
content_original, question_original, insert into sys_case_question_steps (case_step_id, case_id, sort,
answer_original, practice_answer_original score, title, content,
) question, answer, practice_answer,
values (#{caseStepId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, content_original, question_original,
#{score,jdbcType=DECIMAL}, #{title,jdbcType=LONGVARCHAR}, #{content,jdbcType=LONGVARCHAR}, answer_original, practice_answer_original)
#{question,jdbcType=LONGVARCHAR}, #{answer,jdbcType=LONGVARCHAR}, #{practiceAnswer,jdbcType=LONGVARCHAR}, values (#{caseStepId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER},
#{contentOriginal,jdbcType=LONGVARCHAR}, #{questionOriginal,jdbcType=LONGVARCHAR}, #{score,jdbcType=DECIMAL}, #{title,jdbcType=LONGVARCHAR}, #{content,jdbcType=LONGVARCHAR},
#{answerOriginal,jdbcType=LONGVARCHAR}, #{practiceAnswerOriginal,jdbcType=LONGVARCHAR} #{question,jdbcType=LONGVARCHAR}, #{answer,jdbcType=LONGVARCHAR},
) #{practiceAnswer,jdbcType=LONGVARCHAR},
</insert> #{contentOriginal,jdbcType=LONGVARCHAR}, #{questionOriginal,jdbcType=LONGVARCHAR},
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs"> #{answerOriginal,jdbcType=LONGVARCHAR}, #{practiceAnswerOriginal,jdbcType=LONGVARCHAR})
insert into sys_case_question_steps </insert>
<trim prefix="(" suffix=")" suffixOverrides=","> <insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs">
<if test="caseStepId != null"> insert into sys_case_question_steps
case_step_id, <trim prefix="(" suffix=")" suffixOverrides=",">
</if> <if test="caseStepId != null">
<if test="caseId != null"> case_step_id,
case_id, </if>
</if> <if test="caseId != null">
<if test="sort != null"> case_id,
sort, </if>
</if> <if test="sort != null">
<if test="score != null"> sort,
score, </if>
</if> <if test="score != null">
<if test="title != null"> score,
title, </if>
</if> <if test="title != null">
<if test="content != null"> title,
content, </if>
</if> <if test="content != null">
<if test="question != null"> content,
question, </if>
</if> <if test="question != null">
<if test="answer != null"> question,
answer, </if>
</if> <if test="answer != null">
<if test="practiceAnswer != null"> answer,
practice_answer, </if>
</if> <if test="practiceAnswer != null">
<if test="contentOriginal != null"> practice_answer,
content_original, </if>
</if> <if test="contentOriginal != null">
<if test="questionOriginal != null"> content_original,
question_original, </if>
</if> <if test="questionOriginal != null">
<if test="answerOriginal != null"> question_original,
answer_original, </if>
</if> <if test="answerOriginal != null">
<if test="practiceAnswerOriginal != null"> answer_original,
practice_answer_original, </if>
</if> <if test="practiceAnswerOriginal != null">
</trim> practice_answer_original,
<trim prefix="values (" suffix=")" suffixOverrides=","> </if>
<if test="caseStepId != null"> </trim>
#{caseStepId,jdbcType=VARCHAR}, <trim prefix="values (" suffix=")" suffixOverrides=",">
</if> <if test="caseStepId != null">
<if test="caseId != null"> #{caseStepId,jdbcType=VARCHAR},
#{caseId,jdbcType=VARCHAR}, </if>
</if> <if test="caseId != null">
<if test="sort != null"> #{caseId,jdbcType=VARCHAR},
#{sort,jdbcType=INTEGER}, </if>
</if> <if test="sort != null">
<if test="score != null"> #{sort,jdbcType=INTEGER},
#{score,jdbcType=DECIMAL}, </if>
</if> <if test="score != null">
<if test="title != null"> #{score,jdbcType=DECIMAL},
#{title,jdbcType=LONGVARCHAR}, </if>
</if> <if test="title != null">
<if test="content != null"> #{title,jdbcType=LONGVARCHAR},
#{content,jdbcType=LONGVARCHAR}, </if>
</if> <if test="content != null">
<if test="question != null"> #{content,jdbcType=LONGVARCHAR},
#{question,jdbcType=LONGVARCHAR}, </if>
</if> <if test="question != null">
<if test="answer != null"> #{question,jdbcType=LONGVARCHAR},
#{answer,jdbcType=LONGVARCHAR}, </if>
</if> <if test="answer != null">
<if test="practiceAnswer != null"> #{answer,jdbcType=LONGVARCHAR},
#{practiceAnswer,jdbcType=LONGVARCHAR}, </if>
</if> <if test="practiceAnswer != null">
<if test="contentOriginal != null"> #{practiceAnswer,jdbcType=LONGVARCHAR},
#{contentOriginal,jdbcType=LONGVARCHAR}, </if>
</if> <if test="contentOriginal != null">
<if test="questionOriginal != null"> #{contentOriginal,jdbcType=LONGVARCHAR},
#{questionOriginal,jdbcType=LONGVARCHAR}, </if>
</if> <if test="questionOriginal != null">
<if test="answerOriginal != null"> #{questionOriginal,jdbcType=LONGVARCHAR},
#{answerOriginal,jdbcType=LONGVARCHAR}, </if>
</if> <if test="answerOriginal != null">
<if test="practiceAnswerOriginal != null"> #{answerOriginal,jdbcType=LONGVARCHAR},
#{practiceAnswerOriginal,jdbcType=LONGVARCHAR}, </if>
</if> <if test="practiceAnswerOriginal != null">
</trim> #{practiceAnswerOriginal,jdbcType=LONGVARCHAR},
</insert> </if>
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepExample" resultType="java.lang.Long"> </trim>
select count(*) from sys_case_question_steps </insert>
<if test="_parameter != null"> <select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepExample"
<include refid="Example_Where_Clause" /> resultType="java.lang.Long">
</if> select count(*) from sys_case_question_steps
</select> <if test="_parameter != null">
<update id="updateByExampleSelective" parameterType="map"> <include refid="Example_Where_Clause"/>
update sys_case_question_steps </if>
<set> </select>
<if test="record.caseStepId != null"> <update id="updateByExampleSelective" parameterType="map">
case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, update sys_case_question_steps
</if> <set>
<if test="record.caseId != null"> <if test="record.caseStepId != null">
case_step_id = #{record.caseStepId,jdbcType=VARCHAR},
</if>
<if test="record.caseId != null">
case_id = #{record.caseId,jdbcType=VARCHAR},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
<if test="record.score != null">
score = #{record.score,jdbcType=DECIMAL},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=LONGVARCHAR},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=LONGVARCHAR},
</if>
<if test="record.question != null">
question = #{record.question,jdbcType=LONGVARCHAR},
</if>
<if test="record.answer != null">
answer = #{record.answer,jdbcType=LONGVARCHAR},
</if>
<if test="record.practiceAnswer != null">
practice_answer = #{record.practiceAnswer,jdbcType=LONGVARCHAR},
</if>
<if test="record.contentOriginal != null">
content_original = #{record.contentOriginal,jdbcType=LONGVARCHAR},
</if>
<if test="record.questionOriginal != null">
question_original = #{record.questionOriginal,jdbcType=LONGVARCHAR},
</if>
<if test="record.answerOriginal != null">
answer_original = #{record.answerOriginal,jdbcType=LONGVARCHAR},
</if>
<if test="record.practiceAnswerOriginal != null">
practice_answer_original = #{record.practiceAnswerOriginal,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update sys_case_question_steps
set case_step_id = #{record.caseStepId,jdbcType=VARCHAR},
case_id = #{record.caseId,jdbcType=VARCHAR}, case_id = #{record.caseId,jdbcType=VARCHAR},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER}, sort = #{record.sort,jdbcType=INTEGER},
</if>
<if test="record.score != null">
score = #{record.score,jdbcType=DECIMAL}, score = #{record.score,jdbcType=DECIMAL},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=LONGVARCHAR}, title = #{record.title,jdbcType=LONGVARCHAR},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=LONGVARCHAR}, content = #{record.content,jdbcType=LONGVARCHAR},
</if>
<if test="record.question != null">
question = #{record.question,jdbcType=LONGVARCHAR}, question = #{record.question,jdbcType=LONGVARCHAR},
</if>
<if test="record.answer != null">
answer = #{record.answer,jdbcType=LONGVARCHAR}, answer = #{record.answer,jdbcType=LONGVARCHAR},
</if>
<if test="record.practiceAnswer != null">
practice_answer = #{record.practiceAnswer,jdbcType=LONGVARCHAR}, practice_answer = #{record.practiceAnswer,jdbcType=LONGVARCHAR},
</if>
<if test="record.contentOriginal != null">
content_original = #{record.contentOriginal,jdbcType=LONGVARCHAR}, content_original = #{record.contentOriginal,jdbcType=LONGVARCHAR},
</if>
<if test="record.questionOriginal != null">
question_original = #{record.questionOriginal,jdbcType=LONGVARCHAR}, question_original = #{record.questionOriginal,jdbcType=LONGVARCHAR},
</if>
<if test="record.answerOriginal != null">
answer_original = #{record.answerOriginal,jdbcType=LONGVARCHAR}, answer_original = #{record.answerOriginal,jdbcType=LONGVARCHAR},
</if> practice_answer_original = #{record.practiceAnswerOriginal,jdbcType=LONGVARCHAR}
<if test="record.practiceAnswerOriginal != null"> <if test="_parameter != null">
practice_answer_original = #{record.practiceAnswerOriginal,jdbcType=LONGVARCHAR}, <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
</set> </update>
<if test="_parameter != null"> <update id="updateByExample" parameterType="map">
<include refid="Update_By_Example_Where_Clause" /> update sys_case_question_steps
</if> set case_step_id = #{record.caseStepId,jdbcType=VARCHAR},
</update> case_id = #{record.caseId,jdbcType=VARCHAR},
<update id="updateByExampleWithBLOBs" parameterType="map"> sort = #{record.sort,jdbcType=INTEGER},
update sys_case_question_steps score = #{record.score,jdbcType=DECIMAL}
set case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, <if test="_parameter != null">
case_id = #{record.caseId,jdbcType=VARCHAR}, <include refid="Update_By_Example_Where_Clause"/>
sort = #{record.sort,jdbcType=INTEGER}, </if>
score = #{record.score,jdbcType=DECIMAL}, </update>
title = #{record.title,jdbcType=LONGVARCHAR}, <update id="updateByPrimaryKeySelective"
content = #{record.content,jdbcType=LONGVARCHAR}, parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs">
question = #{record.question,jdbcType=LONGVARCHAR}, update sys_case_question_steps
answer = #{record.answer,jdbcType=LONGVARCHAR}, <set>
practice_answer = #{record.practiceAnswer,jdbcType=LONGVARCHAR}, <if test="caseId != null">
content_original = #{record.contentOriginal,jdbcType=LONGVARCHAR}, case_id = #{caseId,jdbcType=VARCHAR},
question_original = #{record.questionOriginal,jdbcType=LONGVARCHAR}, </if>
answer_original = #{record.answerOriginal,jdbcType=LONGVARCHAR}, <if test="sort != null">
practice_answer_original = #{record.practiceAnswerOriginal,jdbcType=LONGVARCHAR} sort = #{sort,jdbcType=INTEGER},
<if test="_parameter != null"> </if>
<include refid="Update_By_Example_Where_Clause" /> <if test="score != null">
</if> score = #{score,jdbcType=DECIMAL},
</update> </if>
<update id="updateByExample" parameterType="map"> <if test="title != null">
update sys_case_question_steps title = #{title,jdbcType=LONGVARCHAR},
set case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, </if>
case_id = #{record.caseId,jdbcType=VARCHAR}, <if test="content != null">
sort = #{record.sort,jdbcType=INTEGER}, content = #{content,jdbcType=LONGVARCHAR},
score = #{record.score,jdbcType=DECIMAL} </if>
<if test="_parameter != null"> <if test="question != null">
<include refid="Update_By_Example_Where_Clause" /> question = #{question,jdbcType=LONGVARCHAR},
</if> </if>
</update> <if test="answer != null">
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs"> answer = #{answer,jdbcType=LONGVARCHAR},
update sys_case_question_steps </if>
<set> <if test="practiceAnswer != null">
<if test="caseId != null"> practice_answer = #{practiceAnswer,jdbcType=LONGVARCHAR},
case_id = #{caseId,jdbcType=VARCHAR}, </if>
</if> <if test="contentOriginal != null">
<if test="sort != null"> content_original = #{contentOriginal,jdbcType=LONGVARCHAR},
sort = #{sort,jdbcType=INTEGER}, </if>
</if> <if test="questionOriginal != null">
<if test="score != null"> question_original = #{questionOriginal,jdbcType=LONGVARCHAR},
score = #{score,jdbcType=DECIMAL}, </if>
</if> <if test="answerOriginal != null">
<if test="title != null"> answer_original = #{answerOriginal,jdbcType=LONGVARCHAR},
title = #{title,jdbcType=LONGVARCHAR}, </if>
</if> <if test="practiceAnswerOriginal != null">
<if test="content != null"> practice_answer_original = #{practiceAnswerOriginal,jdbcType=LONGVARCHAR},
content = #{content,jdbcType=LONGVARCHAR}, </if>
</if> </set>
<if test="question != null"> where case_step_id = #{caseStepId,jdbcType=VARCHAR}
question = #{question,jdbcType=LONGVARCHAR}, </update>
</if> <update id="updateByPrimaryKeyWithBLOBs"
<if test="answer != null"> parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs">
answer = #{answer,jdbcType=LONGVARCHAR}, update sys_case_question_steps
</if> set case_id = #{caseId,jdbcType=VARCHAR},
<if test="practiceAnswer != null"> sort = #{sort,jdbcType=INTEGER},
practice_answer = #{practiceAnswer,jdbcType=LONGVARCHAR}, score = #{score,jdbcType=DECIMAL},
</if> title = #{title,jdbcType=LONGVARCHAR},
<if test="contentOriginal != null"> content = #{content,jdbcType=LONGVARCHAR},
content_original = #{contentOriginal,jdbcType=LONGVARCHAR}, question = #{question,jdbcType=LONGVARCHAR},
</if> answer = #{answer,jdbcType=LONGVARCHAR},
<if test="questionOriginal != null"> practice_answer = #{practiceAnswer,jdbcType=LONGVARCHAR},
question_original = #{questionOriginal,jdbcType=LONGVARCHAR}, content_original = #{contentOriginal,jdbcType=LONGVARCHAR},
</if> question_original = #{questionOriginal,jdbcType=LONGVARCHAR},
<if test="answerOriginal != null"> answer_original = #{answerOriginal,jdbcType=LONGVARCHAR},
answer_original = #{answerOriginal,jdbcType=LONGVARCHAR}, practice_answer_original = #{practiceAnswerOriginal,jdbcType=LONGVARCHAR}
</if> where case_step_id = #{caseStepId,jdbcType=VARCHAR}
<if test="practiceAnswerOriginal != null"> </update>
practice_answer_original = #{practiceAnswerOriginal,jdbcType=LONGVARCHAR}, <update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStep">
</if> update sys_case_question_steps
</set> set case_id = #{caseId,jdbcType=VARCHAR},
where case_step_id = #{caseStepId,jdbcType=VARCHAR} sort = #{sort,jdbcType=INTEGER},
</update> score = #{score,jdbcType=DECIMAL}
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs"> where case_step_id = #{caseStepId,jdbcType=VARCHAR}
update sys_case_question_steps </update>
set case_id = #{caseId,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
score = #{score,jdbcType=DECIMAL}, <resultMap id="dtoMap" type="com.sztzjy.resource_center.entity.SysCaseQuestionStep">
title = #{title,jdbcType=LONGVARCHAR}, <result column="step_count" jdbcType="LONGVARCHAR" property="contentOriginal"/>
content = #{content,jdbcType=LONGVARCHAR}, <result column="three_name" jdbcType="LONGVARCHAR" property="questionOriginal"/>
question = #{question,jdbcType=LONGVARCHAR}, <result column="title" jdbcType="LONGVARCHAR" property="title"/>
answer = #{answer,jdbcType=LONGVARCHAR}, </resultMap>
practice_answer = #{practiceAnswer,jdbcType=LONGVARCHAR},
content_original = #{contentOriginal,jdbcType=LONGVARCHAR}, <select id="getGradeReportCase" parameterType="java.lang.String" resultMap="dtoMap">
question_original = #{questionOriginal,jdbcType=LONGVARCHAR}, SELECT s2.title, s3.three_name, COUNT(*) AS step_count
answer_original = #{answerOriginal,jdbcType=LONGVARCHAR}, FROM sys_case_question_steps s1
practice_answer_original = #{practiceAnswerOriginal,jdbcType=LONGVARCHAR} JOIN sys_case_questions s2 ON s1.case_id = s2.case_id
where case_step_id = #{caseStepId,jdbcType=VARCHAR} JOIN sys_topic_and_course s3 ON s2.case_id = s3.topic_id
</update> WHERE s2.case_id IN
<update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionStep"> <foreach collection="sysTwoCatalogs" item="id" open="(" close=")" separator=",">
update sys_case_question_steps #{id}
set case_id = #{caseId,jdbcType=VARCHAR}, </foreach>
sort = #{sort,jdbcType=INTEGER}, and s2.source in ('管理员', #{schoolId})
score = #{score,jdbcType=DECIMAL} and s3.one_id=#{oneId}
where case_step_id = #{caseStepId,jdbcType=VARCHAR} and s2.unmount_status is FALSE
</update> GROUP BY s2.title, s3.three_name
</select>
</mapper> </mapper>

@ -449,6 +449,7 @@
<if test="schoolId != null and schoolId != ''"> <if test="schoolId != null and schoolId != ''">
and sb.source in (#{schoolId},'管理员') and sb.source in (#{schoolId},'管理员')
</if> </if>
and sb.is_delete = FALSE
</where> </where>
order by sb.create_time order by sb.create_time
</select> </select>
@ -475,4 +476,25 @@
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="selectByList" parameterType="java.util.List" resultType="java.util.Map">
SELECT count(*),sum(score)FROM sys_objective_question
WHERE objective_id IN
<foreach collection="list" separator="," item="id" open="(" close=")">
#{id}
</foreach>
and is_delete = false
</select>
<select id="selectObjByType" parameterType="java.util.List" resultType="java.util.Map">
SELECT s.objective_id, s.content, sc.two_name, three_name
FROM sys_objective_questions s
LEFT JOIN sys_topic_and_course sc
on s.objective_id = sc.topic_id
WHERE s.source in ('管理员', #{schoolId})
and s.is_delete = FALSE
and s.type = #{type}
</select>
</mapper> </mapper>
Loading…
Cancel
Save