新分支上传

newBigdata
yz 9 months ago
parent ec4bd7c526
commit df1df6a604

@ -33,4 +33,10 @@ public class Constant {
public static final String THEORY = "理论考试模块";
public static final String RESOURCE = "资源中心模块";
public static final String SYSTEMOWNER_JRDSJ = "金融大数据";
public static final String SYSTEMOWNER_ZQDSJ = "证券大数据";
public static final String SYSTEMOWNER_YHDSJ = "银行大数据";
}

@ -6,6 +6,7 @@ import com.sztzjy.financial_bigdata.entity.stu_dto.StuCommitCaseDto;
import com.sztzjy.financial_bigdata.entity.stu_dto.StuCommitCaseExamDto;
import com.sztzjy.financial_bigdata.entity.stu_dto.StuTheoryTestDto;
import com.sztzjy.financial_bigdata.mapper.StuStudentExamMapper;
import com.sztzjy.financial_bigdata.mapper.SysCaseQuestionMapper;
import com.sztzjy.financial_bigdata.mapper.SysObjectiveQuestionMapper;
import com.sztzjy.financial_bigdata.mapper.TeaExamManageMapper;
import com.sztzjy.financial_bigdata.service.stu.IExamService;
@ -13,14 +14,12 @@ import com.sztzjy.financial_bigdata.util.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.*;
@RestController
@Api(tags = "实战考核")
@ -34,6 +33,8 @@ public class ExamController {
StuStudentExamMapper studentExamMapper;
@Autowired
TeaExamManageMapper examManageMapper;
@Autowired
SysCaseQuestionMapper caseQuestionMapper;
//实战考核基础知识题目展示(开始考试)
@ -77,8 +78,8 @@ public class ExamController {
@GetMapping("startCase")
@ApiOperation("案例考核开始考试")
@AnonymousAccess
public ResultEntity<List<SysCaseQuestionStep>> startCase(@RequestParam String examManageId,@RequestParam String userId,@RequestParam String classId,@ApiParam("默认差第一条 传递first")@RequestParam String caseId){
List<SysCaseQuestionStep> list=examService.startCase(examManageId,userId,classId,caseId);
public ResultEntity<List<SysCaseQuestionStepWithBLOBs>> startCase(@RequestParam String examManageId,@RequestParam String userId,@RequestParam String classId,@ApiParam("默认差第一条 传递first")@RequestParam String caseId){
List<SysCaseQuestionStepWithBLOBs> list=examService.startCase(examManageId,userId,classId,caseId);
if(list==null){
return new ResultEntity<>(HttpStatus.OK, "考试已结束");
}else {
@ -86,6 +87,7 @@ public class ExamController {
}
}
//获取案例题数量
@GetMapping("getCaseIdList")
@ApiOperation("获取考试案例题caseId集合")
@ -93,13 +95,21 @@ public class ExamController {
public ResultEntity startCase(@RequestParam String examManageId){
TeaExamManageWithBLOBs examManage = manageMapper.selectByPrimaryKey(examManageId);
String caseIdlist = examManage.getCaseIdlist();
Map<String,String> map=new LinkedHashMap<>();
if(StringUtils.isBlank(caseIdlist)){
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "未设置案例考试");
}
if(caseIdlist.contains(",")){
List<String> caseIdList = Arrays.asList(caseIdlist.split(","));
return new ResultEntity<>(HttpStatus.OK, "获取考试案例题id集合成功",caseIdList);
for (int i = 0; i < caseIdList.size(); i++) {
SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseIdList.get(i));
map.put(sysCaseQuestion.getTitle(),caseIdList.get(i));
}
return new ResultEntity<>(HttpStatus.OK, "获取考试案例题id集合成功",map);
}else {
ArrayList<String> list = new ArrayList<>();
list.add(caseIdlist);
return new ResultEntity<>(HttpStatus.OK, "获取考试案例题id集合成功",list);
SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseIdlist);
map.put(sysCaseQuestion.getTitle(),caseIdlist);
return new ResultEntity<>(HttpStatus.OK, "获取考试案例题id集合成功",map);
}
}

@ -61,7 +61,7 @@ public class ExerciseExperimentalTraining {
@GetMapping("getCaseStepInfo")
@ApiOperation("获取案例题步骤基础信息")
@AnonymousAccess
public ResultEntity<List<SysCaseQuestionStep>> getCaseStepInfo(@RequestParam String chapterId) {
public ResultEntity<List<SysCaseQuestionStepWithBLOBs>> getCaseStepInfo(@RequestParam String chapterId) {
//根据chapterId查询所有的caseid
SysCaseQuestionExample questionExample = new SysCaseQuestionExample();
questionExample.createCriteria().andChapterIdEqualTo(chapterId);
@ -74,20 +74,19 @@ public class ExerciseExperimentalTraining {
SysCaseQuestionStepExample example = new SysCaseQuestionStepExample();
example.createCriteria().andCaseIdIn(caseIds);
example.setOrderByClause("sort ASC");
List<SysCaseQuestionStep> stepList = caseQuestionStepMapper.selectByExample(example);
for (int i = 0; i < stepList.size(); i++) {
stepList.get(0).setAnswer("");
stepList.get(0).setAnswerOriginal("");
}
List<SysCaseQuestionStepWithBLOBs> stepList = caseQuestionStepMapper.selectByExampleWithBLOBs(example);
// for (int i = 0; i < stepList.size(); i++) {
// stepList.get(0).setAnswer("");
// stepList.get(0).setAnswerOriginal("");
// }
return new ResultEntity<>(HttpStatus.OK, "获取案例题基础信息查询成功", stepList);
}
//提交案例题
@PostMapping("commitCase")
@ApiOperation("提交案例题")
@ApiOperation("提交基础型案例题")
@AnonymousAccess
public ResultEntity commitCase(@RequestBody StuCommitCaseDto commitCaseDto) {
//执行记录操作
Boolean flag = stepService.commitCase(commitCaseDto);
if (flag) {
@ -97,6 +96,20 @@ public class ExerciseExperimentalTraining {
}
}
//提交应用型案例
@PostMapping("commitApplyCase")
@ApiOperation("提交应用型案例题")
@AnonymousAccess
public ResultEntity commitApplyCase(@RequestBody List<StuCommitCaseDto> commitCaseDtoList) {
//执行记录操作
Boolean flag = stepService.commitApplyCase(commitCaseDtoList);
if (flag) {
return new ResultEntity<>(HttpStatus.OK, "提交应用型案例题提交成功");
} else {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "重复提交");
}
}
@AnonymousAccess
@ApiOperation("实训演练页面查询")
@PostMapping("getCourseChapter")

@ -1,32 +1,46 @@
package com.sztzjy.financial_bigdata.controller.stu;// 后端代码
import com.alibaba.fastjson.JSONObject;
import com.mysql.cj.xdevapi.JsonString;
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
import com.sztzjy.financial_bigdata.util.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.util.Json;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.*;
@RestController
@Api(tags = "python接口")
@RequestMapping("/api/python")
public class PythonController {
@Value("${file.path}")
private String filePath;
@PostMapping("/validate")
@ApiOperation("代码检验")
@AnonymousAccess
public ResultEntity validatePythonCode(@RequestBody JSONObject upCodeJson) {
System.out.println(upCodeJson);
String pythonCode = upCodeJson.getString("code");
String pythonCodeUp = upCodeJson.getString("code");
String pythonCode = "";
if(pythonCodeUp.contains("/dataResource")){
pythonCode = pythonCodeUp.replace("/dataResource", filePath + "/dataResource");
}else {
pythonCode=pythonCodeUp;
}
if(pythonCode.contains("show")){
return validatePythonCodeImg(upCodeJson);
}
try {
// 创建一个新的进程来执行Python代码
// Process process = Runtime.getRuntime().exec("python");
@ -74,23 +88,105 @@ public class PythonController {
}
@PostMapping("/validatePythonCodeImg")
@ApiOperation("代码检验图片")
@AnonymousAccess
public ResultEntity validatePythonCodeImg(@RequestBody JSONObject upCodeJson) {
System.out.println(upCodeJson);
String pythonCode = upCodeJson.getString("code");
String imagePath = filePath+"/pydir/plot.png";
try {
// 清除旧的plot.png后重新创建空的plot.png
File plotFile = new File(imagePath);
if (plotFile.exists()) {
plotFile.delete();
}
plotFile.createNewFile();
// 写入临时Python文件
String tempPythonFile = filePath+"/pydir/temp_script.py";
try (PrintWriter out = new PrintWriter(tempPythonFile)){
out.println(pythonCode);
out.println("plt.savefig('" + imagePath + "')");
out.println("plt.close()");
}
public static void main(String[] args) {
String pythonCode = "def is_even(number):\n" +
" if number ___ 2 == 0:\n" +
" return True\n" +
" else:\n" +
" return ___\n" +
"num = 10\n" +
"if is_even(num):\n" +
" print(f\"{num} 是偶数\")\n" +
"else:\n" +
" ___(f\"{num} 是奇数\")";
// 执行Python文件
Process process = Runtime.getRuntime().exec(new String[]{"/usr/bin/python3", tempPythonFile});
process.waitFor();
// 读取图片文件并转换为Base64字符串
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (FileInputStream fis = new FileInputStream(imagePath)) {
byte[] buffer = new byte[1024];
int len;
while ((len = fis.read(buffer)) != -1) {
baos.write(buffer, 0, len);
}
}
String base64Image = Base64.encodeBase64String(baos.toByteArray());
if(StringUtils.isBlank(base64Image)){
try {
// 创建一个新的进程来执行Python代码
// Process process = Runtime.getRuntime().exec("python");
process = Runtime.getRuntime().exec("/usr/bin/python3");
// 获取进程的输入流
BufferedReader inputStream = new BufferedReader(new InputStreamReader(process.getInputStream()));
// 获取进程的输出流
BufferedReader errorStream = new BufferedReader(new InputStreamReader(process.getErrorStream()));
// 向进程的输入流写入Python代码
process.getOutputStream().write(pythonCode.getBytes());
process.getOutputStream().flush();
process.getOutputStream().close();
// 读取Python代码的输出
String line;
StringBuilder output = new StringBuilder();
while ((line = inputStream.readLine()) != null) {
output.append(line).append("\n");
}
// 读取Python代码的错误信息
StringBuilder errors = new StringBuilder();
while ((line = errorStream.readLine()) != null) {
errors.append(line).append("\n");
}
// 等待进程执行完成
int exitCode = process.waitFor();
if (exitCode == 0) {
// 执行成功输出Python代码的结果
System.out.println("Python code output:\n" + output.toString());
return new ResultEntity(HttpStatus.OK,output.toString());
} else {
// 执行失败,输出错误信息
System.err.println("Error executing Python code:\n" + errors.toString());
return new ResultEntity(HttpStatus.OK,errors.toString());
}
} catch (IOException | InterruptedException e) {
e.printStackTrace();
return new ResultEntity(HttpStatus.BAD_REQUEST,e);
}
}
return new ResultEntity(HttpStatus.OK, base64Image,"img");
} catch (IOException | InterruptedException e) {
e.printStackTrace();
return new ResultEntity(HttpStatus.BAD_REQUEST, e);
}
}
public static void main(String[] args) {
String pythonCode="";
try {
// 创建一个新的进程来执行Python代码
Process process = Runtime.getRuntime().exec("python");
// Process process = Runtime.getRuntime().exec("python");
Process process = Runtime.getRuntime().exec("/usr/bin/python3");
// 获取进程的输入流
BufferedReader inputStream = new BufferedReader(new InputStreamReader(process.getInputStream()));
@ -121,6 +217,7 @@ public class PythonController {
if (exitCode == 0) {
// 执行成功输出Python代码的结果
System.out.println("Python code output:\n" + output.toString());
} else {
// 执行失败,输出错误信息
System.err.println("Error executing Python code:\n" + errors.toString());

@ -1,6 +1,7 @@
package com.sztzjy.financial_bigdata.controller.tea;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepWithBLOBs;
import com.sztzjy.financial_bigdata.service.tea.ITeaCaseStepService;
import com.sztzjy.financial_bigdata.util.ResultEntity;
import io.swagger.annotations.Api;
@ -23,15 +24,15 @@ public class TeaCaseStepController {
//案例步骤新增
@PostMapping("insertCaseStep")
@ApiOperation("案例步骤新增")
public ResultEntity insertCaseStep(@RequestBody SysCaseQuestionStep caseQuestionStep,
public ResultEntity insertCaseStep(@RequestBody SysCaseQuestionStepWithBLOBs caseQuestionStepWithBLOBs,
@RequestParam String schoolId) {
if(caseQuestionStep.getCaseId().isEmpty()){
if(caseQuestionStepWithBLOBs.getCaseId().isEmpty()){
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "案例步骤新增失败,未选择添加案例");
}
if(caseQuestionStep.getTitle().isEmpty() || caseQuestionStep.getQuestion().isEmpty() || caseQuestionStep.getAnswer().isEmpty() || caseQuestionStep.getContent().isEmpty()){
if(caseQuestionStepWithBLOBs.getTitle().isEmpty() || caseQuestionStepWithBLOBs.getQuestion().isEmpty() || caseQuestionStepWithBLOBs.getAnswer().isEmpty() || caseQuestionStepWithBLOBs.getContent().isEmpty()){
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "案例步骤新增失败,必填内容为空");
}
Boolean flag = caseStepService.insertCase(caseQuestionStep,schoolId);
Boolean flag = caseStepService.insertCase(caseQuestionStepWithBLOBs,schoolId);
if (flag) {
return new ResultEntity<>(HttpStatus.OK, "案例步骤新增成功");
} else {
@ -42,24 +43,24 @@ public class TeaCaseStepController {
//案例步骤展示
@GetMapping("selectCaseStep")
@ApiOperation("案例步骤展示")
public ResultEntity<List<SysCaseQuestionStep>> selectCaseStep(@ApiParam("案例题ID") @RequestParam String caseId) {
public ResultEntity<List<SysCaseQuestionStepWithBLOBs>> selectCaseStep(@ApiParam("案例题ID") @RequestParam String caseId) {
List<SysCaseQuestionStep> stepList = caseStepService.selectCaseStep(caseId);
List<SysCaseQuestionStepWithBLOBs> stepList = caseStepService.selectCaseStep(caseId);
return new ResultEntity<>(HttpStatus.OK, "案例步骤展示成功",stepList);
}
//案例步骤编辑
@PostMapping("updateCaseStep")
@ApiOperation("案例步骤编辑")
public ResultEntity updateCaseStep(@RequestBody SysCaseQuestionStep caseQuestionStep,
public ResultEntity updateCaseStep(@RequestBody SysCaseQuestionStepWithBLOBs caseQuestionStepWithBLOBs,
@RequestParam String schoolId) {
if(caseQuestionStep.getCaseId().isEmpty()){
if(caseQuestionStepWithBLOBs.getCaseId().isEmpty()){
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "案例步骤编辑失败,未选择添加案例");
}
if(caseQuestionStep.getTitle().isEmpty() || caseQuestionStep.getQuestion().isEmpty() || caseQuestionStep.getAnswer().isEmpty() || caseQuestionStep.getContent().isEmpty()){
if(caseQuestionStepWithBLOBs.getTitle().isEmpty() || caseQuestionStepWithBLOBs.getQuestion().isEmpty() || caseQuestionStepWithBLOBs.getAnswer().isEmpty() || caseQuestionStepWithBLOBs.getContent().isEmpty()){
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "案例步骤编辑失败,必填内容为空");
}
Boolean flag = caseStepService.updateCaseStep(caseQuestionStep,schoolId);
Boolean flag = caseStepService.updateCaseStep(caseQuestionStepWithBLOBs,schoolId);
if (flag) {
return new ResultEntity<>(HttpStatus.OK, "案例步骤编辑成功");
} else {
@ -84,10 +85,9 @@ public class TeaCaseStepController {
//案例题步骤内容查看
@GetMapping("selectCaseStepDetails")
@ApiOperation("案例题步骤内容查看")
public ResultEntity<SysCaseQuestionStep> selectCaseStepDetails(@ApiParam("案例题步骤ID") @RequestParam String caseStepId) {
SysCaseQuestionStep caseStep= caseStepService.selectCaseStepDetails(caseStepId);
public ResultEntity<SysCaseQuestionStepWithBLOBs> selectCaseStepDetails(@ApiParam("案例题步骤ID") @RequestParam String caseStepId) {
SysCaseQuestionStepWithBLOBs caseStep= caseStepService.selectCaseStepDetails(caseStepId);
return new ResultEntity<>(HttpStatus.OK, "案例题步骤内容查看成功",caseStep);
}
}

@ -1,6 +1,7 @@
package com.sztzjy.financial_bigdata.controller.tea;
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
import com.sztzjy.financial_bigdata.config.Constant;
import com.sztzjy.financial_bigdata.entity.*;
import com.sztzjy.financial_bigdata.entity.sys_dto.SysCourseDto;
import com.sztzjy.financial_bigdata.mapper.SysCourseChapterMapper;
@ -94,6 +95,25 @@ public class TeaResourceCenterController {
resourceCenterService.downloadResource(resourceId, response);
}
//删除资源
@GetMapping("deleteResource")
@ApiOperation("删除资源")
@AnonymousAccess
public ResponseEntity deleteResource(@ApiParam("资源ID") @RequestParam String resourceId,String schoolId){
TeaResourceCenter resourceCenter = resourceCenterMapper.selectByPrimaryKey(resourceId);
if(Constant.BUILT_IN_SCHOOL_ID.equals(schoolId)){
resourceCenterMapper.deleteByPrimaryKey(resourceId);
return new ResultEntity(HttpStatus.OK, "删除资源文件成功");
}
String schoolIdRC = resourceCenter.getSchoolId();
if(schoolIdRC.equals(schoolId)){
resourceCenterMapper.deleteByPrimaryKey(resourceId);
return new ResultEntity(HttpStatus.OK, "删除资源文件成功");
}else {
return new ResultEntity(HttpStatus.BAD_REQUEST, "权限不足");
}
}
//查看资源文件
@GetMapping("/getResource")
@ApiOperation("查看资源文件")

@ -15,27 +15,6 @@ public class SysCaseQuestionStep {
@ApiModelProperty("案例题id")
private String caseId;
@ApiModelProperty("步骤标题")
private String title;
@ApiModelProperty("步骤内容")
private String content;
@ApiModelProperty("步骤问题")
private String question;
@ApiModelProperty("步骤答案")
private String answer;
@ApiModelProperty("内容原始数据")
private String contentOriginal;
@ApiModelProperty("问题原始数据")
private String questionOriginal;
@ApiModelProperty("答案原始数据")
private String answerOriginal;
@ApiModelProperty("步骤顺序")
private Integer sort;
@ -58,62 +37,6 @@ public class SysCaseQuestionStep {
this.caseId = caseId == null ? null : caseId.trim();
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title == null ? null : title.trim();
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question == null ? null : question.trim();
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer == null ? null : answer.trim();
}
public String getContentOriginal() {
return contentOriginal;
}
public void setContentOriginal(String contentOriginal) {
this.contentOriginal = contentOriginal == null ? null : contentOriginal.trim();
}
public String getQuestionOriginal() {
return questionOriginal;
}
public void setQuestionOriginal(String questionOriginal) {
this.questionOriginal = questionOriginal == null ? null : questionOriginal.trim();
}
public String getAnswerOriginal() {
return answerOriginal;
}
public void setAnswerOriginal(String answerOriginal) {
this.answerOriginal = answerOriginal == null ? null : answerOriginal.trim();
}
public Integer getSort() {
return sort;
}

@ -245,496 +245,6 @@ public class SysCaseQuestionStepExample {
return (Criteria) this;
}
public Criteria andTitleIsNull() {
addCriterion("title is null");
return (Criteria) this;
}
public Criteria andTitleIsNotNull() {
addCriterion("title is not null");
return (Criteria) this;
}
public Criteria andTitleEqualTo(String value) {
addCriterion("title =", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotEqualTo(String value) {
addCriterion("title <>", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThan(String value) {
addCriterion("title >", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThanOrEqualTo(String value) {
addCriterion("title >=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThan(String value) {
addCriterion("title <", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThanOrEqualTo(String value) {
addCriterion("title <=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLike(String value) {
addCriterion("title like", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotLike(String value) {
addCriterion("title not like", value, "title");
return (Criteria) this;
}
public Criteria andTitleIn(List<String> values) {
addCriterion("title in", values, "title");
return (Criteria) this;
}
public Criteria andTitleNotIn(List<String> values) {
addCriterion("title not in", values, "title");
return (Criteria) this;
}
public Criteria andTitleBetween(String value1, String value2) {
addCriterion("title between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andTitleNotBetween(String value1, String value2) {
addCriterion("title not between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andContentIsNull() {
addCriterion("content is null");
return (Criteria) this;
}
public Criteria andContentIsNotNull() {
addCriterion("content is not null");
return (Criteria) this;
}
public Criteria andContentEqualTo(String value) {
addCriterion("content =", value, "content");
return (Criteria) this;
}
public Criteria andContentNotEqualTo(String value) {
addCriterion("content <>", value, "content");
return (Criteria) this;
}
public Criteria andContentGreaterThan(String value) {
addCriterion("content >", value, "content");
return (Criteria) this;
}
public Criteria andContentGreaterThanOrEqualTo(String value) {
addCriterion("content >=", value, "content");
return (Criteria) this;
}
public Criteria andContentLessThan(String value) {
addCriterion("content <", value, "content");
return (Criteria) this;
}
public Criteria andContentLessThanOrEqualTo(String value) {
addCriterion("content <=", value, "content");
return (Criteria) this;
}
public Criteria andContentLike(String value) {
addCriterion("content like", value, "content");
return (Criteria) this;
}
public Criteria andContentNotLike(String value) {
addCriterion("content not like", value, "content");
return (Criteria) this;
}
public Criteria andContentIn(List<String> values) {
addCriterion("content in", values, "content");
return (Criteria) this;
}
public Criteria andContentNotIn(List<String> values) {
addCriterion("content not in", values, "content");
return (Criteria) this;
}
public Criteria andContentBetween(String value1, String value2) {
addCriterion("content between", value1, value2, "content");
return (Criteria) this;
}
public Criteria andContentNotBetween(String value1, String value2) {
addCriterion("content not between", value1, value2, "content");
return (Criteria) this;
}
public Criteria andQuestionIsNull() {
addCriterion("question is null");
return (Criteria) this;
}
public Criteria andQuestionIsNotNull() {
addCriterion("question is not null");
return (Criteria) this;
}
public Criteria andQuestionEqualTo(String value) {
addCriterion("question =", value, "question");
return (Criteria) this;
}
public Criteria andQuestionNotEqualTo(String value) {
addCriterion("question <>", value, "question");
return (Criteria) this;
}
public Criteria andQuestionGreaterThan(String value) {
addCriterion("question >", value, "question");
return (Criteria) this;
}
public Criteria andQuestionGreaterThanOrEqualTo(String value) {
addCriterion("question >=", value, "question");
return (Criteria) this;
}
public Criteria andQuestionLessThan(String value) {
addCriterion("question <", value, "question");
return (Criteria) this;
}
public Criteria andQuestionLessThanOrEqualTo(String value) {
addCriterion("question <=", value, "question");
return (Criteria) this;
}
public Criteria andQuestionLike(String value) {
addCriterion("question like", value, "question");
return (Criteria) this;
}
public Criteria andQuestionNotLike(String value) {
addCriterion("question not like", value, "question");
return (Criteria) this;
}
public Criteria andQuestionIn(List<String> values) {
addCriterion("question in", values, "question");
return (Criteria) this;
}
public Criteria andQuestionNotIn(List<String> values) {
addCriterion("question not in", values, "question");
return (Criteria) this;
}
public Criteria andQuestionBetween(String value1, String value2) {
addCriterion("question between", value1, value2, "question");
return (Criteria) this;
}
public Criteria andQuestionNotBetween(String value1, String value2) {
addCriterion("question not between", value1, value2, "question");
return (Criteria) this;
}
public Criteria andAnswerIsNull() {
addCriterion("answer is null");
return (Criteria) this;
}
public Criteria andAnswerIsNotNull() {
addCriterion("answer is not null");
return (Criteria) this;
}
public Criteria andAnswerEqualTo(String value) {
addCriterion("answer =", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerNotEqualTo(String value) {
addCriterion("answer <>", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerGreaterThan(String value) {
addCriterion("answer >", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerGreaterThanOrEqualTo(String value) {
addCriterion("answer >=", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerLessThan(String value) {
addCriterion("answer <", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerLessThanOrEqualTo(String value) {
addCriterion("answer <=", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerLike(String value) {
addCriterion("answer like", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerNotLike(String value) {
addCriterion("answer not like", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerIn(List<String> values) {
addCriterion("answer in", values, "answer");
return (Criteria) this;
}
public Criteria andAnswerNotIn(List<String> values) {
addCriterion("answer not in", values, "answer");
return (Criteria) this;
}
public Criteria andAnswerBetween(String value1, String value2) {
addCriterion("answer between", value1, value2, "answer");
return (Criteria) this;
}
public Criteria andAnswerNotBetween(String value1, String value2) {
addCriterion("answer not between", value1, value2, "answer");
return (Criteria) this;
}
public Criteria andContentOriginalIsNull() {
addCriterion("content_original is null");
return (Criteria) this;
}
public Criteria andContentOriginalIsNotNull() {
addCriterion("content_original is not null");
return (Criteria) this;
}
public Criteria andContentOriginalEqualTo(String value) {
addCriterion("content_original =", value, "contentOriginal");
return (Criteria) this;
}
public Criteria andContentOriginalNotEqualTo(String value) {
addCriterion("content_original <>", value, "contentOriginal");
return (Criteria) this;
}
public Criteria andContentOriginalGreaterThan(String value) {
addCriterion("content_original >", value, "contentOriginal");
return (Criteria) this;
}
public Criteria andContentOriginalGreaterThanOrEqualTo(String value) {
addCriterion("content_original >=", value, "contentOriginal");
return (Criteria) this;
}
public Criteria andContentOriginalLessThan(String value) {
addCriterion("content_original <", value, "contentOriginal");
return (Criteria) this;
}
public Criteria andContentOriginalLessThanOrEqualTo(String value) {
addCriterion("content_original <=", value, "contentOriginal");
return (Criteria) this;
}
public Criteria andContentOriginalLike(String value) {
addCriterion("content_original like", value, "contentOriginal");
return (Criteria) this;
}
public Criteria andContentOriginalNotLike(String value) {
addCriterion("content_original not like", value, "contentOriginal");
return (Criteria) this;
}
public Criteria andContentOriginalIn(List<String> values) {
addCriterion("content_original in", values, "contentOriginal");
return (Criteria) this;
}
public Criteria andContentOriginalNotIn(List<String> values) {
addCriterion("content_original not in", values, "contentOriginal");
return (Criteria) this;
}
public Criteria andContentOriginalBetween(String value1, String value2) {
addCriterion("content_original between", value1, value2, "contentOriginal");
return (Criteria) this;
}
public Criteria andContentOriginalNotBetween(String value1, String value2) {
addCriterion("content_original not between", value1, value2, "contentOriginal");
return (Criteria) this;
}
public Criteria andQuestionOriginalIsNull() {
addCriterion("question_original is null");
return (Criteria) this;
}
public Criteria andQuestionOriginalIsNotNull() {
addCriterion("question_original is not null");
return (Criteria) this;
}
public Criteria andQuestionOriginalEqualTo(String value) {
addCriterion("question_original =", value, "questionOriginal");
return (Criteria) this;
}
public Criteria andQuestionOriginalNotEqualTo(String value) {
addCriterion("question_original <>", value, "questionOriginal");
return (Criteria) this;
}
public Criteria andQuestionOriginalGreaterThan(String value) {
addCriterion("question_original >", value, "questionOriginal");
return (Criteria) this;
}
public Criteria andQuestionOriginalGreaterThanOrEqualTo(String value) {
addCriterion("question_original >=", value, "questionOriginal");
return (Criteria) this;
}
public Criteria andQuestionOriginalLessThan(String value) {
addCriterion("question_original <", value, "questionOriginal");
return (Criteria) this;
}
public Criteria andQuestionOriginalLessThanOrEqualTo(String value) {
addCriterion("question_original <=", value, "questionOriginal");
return (Criteria) this;
}
public Criteria andQuestionOriginalLike(String value) {
addCriterion("question_original like", value, "questionOriginal");
return (Criteria) this;
}
public Criteria andQuestionOriginalNotLike(String value) {
addCriterion("question_original not like", value, "questionOriginal");
return (Criteria) this;
}
public Criteria andQuestionOriginalIn(List<String> values) {
addCriterion("question_original in", values, "questionOriginal");
return (Criteria) this;
}
public Criteria andQuestionOriginalNotIn(List<String> values) {
addCriterion("question_original not in", values, "questionOriginal");
return (Criteria) this;
}
public Criteria andQuestionOriginalBetween(String value1, String value2) {
addCriterion("question_original between", value1, value2, "questionOriginal");
return (Criteria) this;
}
public Criteria andQuestionOriginalNotBetween(String value1, String value2) {
addCriterion("question_original not between", value1, value2, "questionOriginal");
return (Criteria) this;
}
public Criteria andAnswerOriginalIsNull() {
addCriterion("answer_original is null");
return (Criteria) this;
}
public Criteria andAnswerOriginalIsNotNull() {
addCriterion("answer_original is not null");
return (Criteria) this;
}
public Criteria andAnswerOriginalEqualTo(String value) {
addCriterion("answer_original =", value, "answerOriginal");
return (Criteria) this;
}
public Criteria andAnswerOriginalNotEqualTo(String value) {
addCriterion("answer_original <>", value, "answerOriginal");
return (Criteria) this;
}
public Criteria andAnswerOriginalGreaterThan(String value) {
addCriterion("answer_original >", value, "answerOriginal");
return (Criteria) this;
}
public Criteria andAnswerOriginalGreaterThanOrEqualTo(String value) {
addCriterion("answer_original >=", value, "answerOriginal");
return (Criteria) this;
}
public Criteria andAnswerOriginalLessThan(String value) {
addCriterion("answer_original <", value, "answerOriginal");
return (Criteria) this;
}
public Criteria andAnswerOriginalLessThanOrEqualTo(String value) {
addCriterion("answer_original <=", value, "answerOriginal");
return (Criteria) this;
}
public Criteria andAnswerOriginalLike(String value) {
addCriterion("answer_original like", value, "answerOriginal");
return (Criteria) this;
}
public Criteria andAnswerOriginalNotLike(String value) {
addCriterion("answer_original not like", value, "answerOriginal");
return (Criteria) this;
}
public Criteria andAnswerOriginalIn(List<String> values) {
addCriterion("answer_original in", values, "answerOriginal");
return (Criteria) this;
}
public Criteria andAnswerOriginalNotIn(List<String> values) {
addCriterion("answer_original not in", values, "answerOriginal");
return (Criteria) this;
}
public Criteria andAnswerOriginalBetween(String value1, String value2) {
addCriterion("answer_original between", value1, value2, "answerOriginal");
return (Criteria) this;
}
public Criteria andAnswerOriginalNotBetween(String value1, String value2) {
addCriterion("answer_original not between", value1, value2, "answerOriginal");
return (Criteria) this;
}
public Criteria andSortIsNull() {
addCriterion("sort is null");
return (Criteria) this;

@ -0,0 +1,97 @@
package com.sztzjy.financial_bigdata.entity;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @author xcj
* sys_case_question_step
*/
public class SysCaseQuestionStepWithBLOBs extends SysCaseQuestionStep {
@ApiModelProperty("步骤标题")
private String title;
@ApiModelProperty("步骤内容")
private String content;
@ApiModelProperty("步骤问题")
private String question;
@ApiModelProperty("步骤答案")
private String answer;
@ApiModelProperty("内容原始数据")
private String contentOriginal;
@ApiModelProperty("问题原始数据")
private String questionOriginal;
@ApiModelProperty("答案原始数据")
private String answerOriginal;
@ApiModelProperty("练习答案")
private String practiceAnswer;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title == null ? null : title.trim();
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question == null ? null : question.trim();
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer == null ? null : answer.trim();
}
public String getContentOriginal() {
return contentOriginal;
}
public void setContentOriginal(String contentOriginal) {
this.contentOriginal = contentOriginal == null ? null : contentOriginal.trim();
}
public String getQuestionOriginal() {
return questionOriginal;
}
public void setQuestionOriginal(String questionOriginal) {
this.questionOriginal = questionOriginal == null ? null : questionOriginal.trim();
}
public String getAnswerOriginal() {
return answerOriginal;
}
public void setAnswerOriginal(String answerOriginal) {
this.answerOriginal = answerOriginal == null ? null : answerOriginal.trim();
}
public String getPracticeAnswer() {
return practiceAnswer;
}
public void setPracticeAnswer(String practiceAnswer) {
this.practiceAnswer = practiceAnswer == null ? null : practiceAnswer.trim();
}
}

@ -1,14 +1,12 @@
package com.sztzjy.financial_bigdata.mapper;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestion;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface SysCaseQuestionStepMapper {
long countByExample(SysCaseQuestionStepExample example);
@ -17,19 +15,25 @@ public interface SysCaseQuestionStepMapper {
int deleteByPrimaryKey(String caseStepId);
int insert(SysCaseQuestionStep record);
int insert(SysCaseQuestionStepWithBLOBs record);
int insertSelective(SysCaseQuestionStepWithBLOBs record);
int insertSelective(SysCaseQuestionStep record);
List<SysCaseQuestionStepWithBLOBs> selectByExampleWithBLOBs(SysCaseQuestionStepExample example);
List<SysCaseQuestionStep> selectByExample(SysCaseQuestionStepExample example);
SysCaseQuestionStep selectByPrimaryKey(String caseStepId);
SysCaseQuestionStepWithBLOBs selectByPrimaryKey(String caseStepId);
int updateByExampleSelective(@Param("record") SysCaseQuestionStep record, @Param("example") SysCaseQuestionStepExample example);
int updateByExampleSelective(@Param("record") SysCaseQuestionStepWithBLOBs record, @Param("example") SysCaseQuestionStepExample example);
int updateByExampleWithBLOBs(@Param("record") SysCaseQuestionStepWithBLOBs record, @Param("example") SysCaseQuestionStepExample example);
int updateByExample(@Param("record") SysCaseQuestionStep record, @Param("example") SysCaseQuestionStepExample example);
int updateByPrimaryKeySelective(SysCaseQuestionStep record);
int updateByPrimaryKeySelective(SysCaseQuestionStepWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(SysCaseQuestionStepWithBLOBs record);
int updateByPrimaryKey(SysCaseQuestionStep record);

@ -1,6 +1,7 @@
package com.sztzjy.financial_bigdata.service.stu;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepWithBLOBs;
import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion;
import com.sztzjy.financial_bigdata.entity.stu_dto.StuCommitCaseExamDto;
import com.sztzjy.financial_bigdata.entity.stu_dto.StuTheoryTestDto;
@ -12,7 +13,7 @@ public interface IExamService {
int commitExam(StuTheoryTestDto theoryTestDto,String examManageId);
List<SysCaseQuestionStep> startCase(String examManageId, String userId, String classId,String caseId);
List<SysCaseQuestionStepWithBLOBs> startCase(String examManageId, String userId, String classId, String caseId);
Boolean commitCaseExam(StuCommitCaseExamDto commitCaseExamDto);
}

@ -135,7 +135,7 @@ public class ExamServiceImpl implements IExamService {
//根据casestepid、userid、exammanageid 查询该案例的数据 如果有 代表之前提交过 则替换返回的答案 没有 则返回上一步查询的数据 并设置答案为null
@Override
public List<SysCaseQuestionStep> startCase(String examManageId, String userId, String classId,String caseId){
public List<SysCaseQuestionStepWithBLOBs> startCase(String examManageId, String userId, String classId,String caseId){
StuStudentExamExample stuExamexample = new StuStudentExamExample();
stuExamexample.createCriteria().andUseridEqualTo(userId).andExamManageIdEqualTo(examManageId);
@ -174,7 +174,7 @@ public class ExamServiceImpl implements IExamService {
String caseIdFirst = caseIdList.get(0);
//根据caseid 到casestep表中查询所有step
example.createCriteria().andCaseIdEqualTo(caseIdFirst);
List<SysCaseQuestionStep> stepList = stepMapper.selectByExample(example);
List<SysCaseQuestionStepWithBLOBs> stepList = stepMapper.selectByExampleWithBLOBs(example);
for (int i = 0; i < stepList.size(); i++) {
StuExamCaseExample stuExamCaseExample = new StuExamCaseExample();
stuExamCaseExample.createCriteria().andCaseStepIdEqualTo(stepList.get(i).getCaseStepId()).andUserIdEqualTo(userId).andExamManageIdEqualTo(examManageId);
@ -190,7 +190,7 @@ public class ExamServiceImpl implements IExamService {
return stepList;
}else {
example.createCriteria().andCaseIdEqualTo(caseId);
List<SysCaseQuestionStep> stepList = stepMapper.selectByExample(example);
List<SysCaseQuestionStepWithBLOBs> stepList = stepMapper.selectByExampleWithBLOBs(example);
for (int i = 0; i < stepList.size(); i++) {
StuExamCaseExample stuExamCaseExample = new StuExamCaseExample();
stuExamCaseExample.createCriteria().andCaseStepIdEqualTo(stepList.get(i).getCaseStepId()).andUserIdEqualTo(userId).andExamManageIdEqualTo(examManageId);
@ -218,7 +218,7 @@ public class ExamServiceImpl implements IExamService {
example.createCriteria().andCaseStepIdEqualTo(commitCaseExamDto.getCaseStepId()).andUserIdEqualTo(commitCaseExamDto.getUserId()).andExamManageIdEqualTo(commitCaseExamDto.getExamManageId());
List<StuExamCase> stuExamCases = stuExamCaseMapper.selectByExample(example);
String caseStepId = commitCaseExamDto.getCaseStepId();
SysCaseQuestionStep sysCaseQuestionStep = stepMapper.selectByPrimaryKey(caseStepId);
SysCaseQuestionStepWithBLOBs sysCaseQuestionStep = stepMapper.selectByPrimaryKey(caseStepId);
if(stuExamCases==null || stuExamCases.size()==0){
StuExamCase stuExamCase = new StuExamCase();
stuExamCase.setExamCaseId(String.valueOf(UUID.randomUUID()));

@ -1,20 +1,23 @@
package com.sztzjy.financial_bigdata.service.tea;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepWithBLOBs;
import com.sztzjy.financial_bigdata.entity.stu_dto.StuCommitCaseDto;
import java.util.List;
public interface ITeaCaseStepService {
Boolean insertCase(SysCaseQuestionStep caseQuestionStep,String schoolId);
Boolean insertCase(SysCaseQuestionStepWithBLOBs caseQuestionStepWithBLOBs, String schoolId);
List<SysCaseQuestionStep> selectCaseStep(String caseId);
List<SysCaseQuestionStepWithBLOBs> selectCaseStep(String caseId);
Boolean updateCaseStep(SysCaseQuestionStep caseQuestionStep, String schoolId);
Boolean updateCaseStep(SysCaseQuestionStepWithBLOBs caseQuestionStepWithBLOBs, String schoolId);
Boolean deleteCaseStep(String caseStepId, String schoolId);
SysCaseQuestionStep selectCaseStepDetails(String caseStepId);
SysCaseQuestionStepWithBLOBs selectCaseStepDetails(String caseStepId);
Boolean commitCase(StuCommitCaseDto commitCaseDto);
Boolean commitApplyCase(List<StuCommitCaseDto> commitCaseDtoList);
}

@ -28,39 +28,39 @@ public class TeaCaseStepServiceImpl implements ITeaCaseStepService {
StuTrainingMapper trainingMapper;
@Override
public Boolean insertCase(SysCaseQuestionStep caseQuestionStep,String schoolId) {
public Boolean insertCase(SysCaseQuestionStepWithBLOBs caseQuestionStepWithBLOBs,String schoolId) {
//先验证添加步骤是否未内置案例 如果是内置案例 则除了内置账号外不能增加
if(!Constant.BUILT_IN_SCHOOL_ID.equals(schoolId)){
SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseQuestionStep.getCaseId());
SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseQuestionStepWithBLOBs.getCaseId());
if(!schoolId.equals(sysCaseQuestion.getSchoolId())){
return false;
}
}
caseQuestionStep.setCaseStepId(String.valueOf(UUID.randomUUID()));
int insert = caseQuestionStepMapper.insert(caseQuestionStep);
caseQuestionStepWithBLOBs.setCaseStepId(String.valueOf(UUID.randomUUID()));
int insert = caseQuestionStepMapper.insert(caseQuestionStepWithBLOBs);
return insert==1;
}
@Override
public List<SysCaseQuestionStep> selectCaseStep(String caseId) {
public List<SysCaseQuestionStepWithBLOBs> selectCaseStep(String caseId) {
SysCaseQuestionStepExample example = new SysCaseQuestionStepExample();
example.createCriteria().andCaseIdEqualTo(caseId);
example.setOrderByClause("sort ASC");
List<SysCaseQuestionStep> stepList = caseQuestionStepMapper.selectByExample(example);
List<SysCaseQuestionStepWithBLOBs> stepList = caseQuestionStepMapper.selectByExampleWithBLOBs(example);
return stepList;
}
@Override
public Boolean updateCaseStep(SysCaseQuestionStep caseQuestionStep, String schoolId) {
public Boolean updateCaseStep(SysCaseQuestionStepWithBLOBs caseQuestionStepWithBLOBs, String schoolId) {
//先验证添加步骤是否未内置案例 如果是内置案例 则除了内置账号外不能编辑
if(!Constant.BUILT_IN_SCHOOL_ID.equals(schoolId)){
SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseQuestionStep.getCaseId());
SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseQuestionStepWithBLOBs.getCaseId());
if(!schoolId.equals(sysCaseQuestion.getSchoolId())){
return false;
}
}
int i = caseQuestionStepMapper.updateByPrimaryKeySelective(caseQuestionStep);
int i = caseQuestionStepMapper.updateByPrimaryKeyWithBLOBs(caseQuestionStepWithBLOBs);
return i==1;
}
@ -79,9 +79,9 @@ public class TeaCaseStepServiceImpl implements ITeaCaseStepService {
}
@Override
public SysCaseQuestionStep selectCaseStepDetails(String caseStepId) {
SysCaseQuestionStep sysCaseQuestionStep = caseQuestionStepMapper.selectByPrimaryKey(caseStepId);
return sysCaseQuestionStep;
public SysCaseQuestionStepWithBLOBs selectCaseStepDetails(String caseStepId) {
SysCaseQuestionStepWithBLOBs sysCaseQuestionStepWithBLOBs = caseQuestionStepMapper.selectByPrimaryKey(caseStepId);
return sysCaseQuestionStepWithBLOBs;
}
@Override
@ -90,8 +90,8 @@ public class TeaCaseStepServiceImpl implements ITeaCaseStepService {
StuTrainingStepRecordExample example = new StuTrainingStepRecordExample();
example.createCriteria().andUserIdEqualTo(commitCaseDto.getUserId()).andCaseStepIdEqualTo(commitCaseDto.getCaseStepId());
List<StuTrainingStepRecord> stuTrainingStepRecords = trainingStepRecordMapper.selectByExample(example);
if(stuTrainingStepRecords==null){ //未答过该步骤题目 新增数据到stepRecord表中
SysCaseQuestionStep dbCaseQuestionStep = selectCaseStepDetails(commitCaseDto.getCaseStepId());
if(stuTrainingStepRecords.isEmpty()){ //未答过该步骤题目 新增数据到stepRecord表中
SysCaseQuestionStepWithBLOBs dbCaseQuestionStep = selectCaseStepDetails(commitCaseDto.getCaseStepId());
StuTrainingStepRecord stepRecord = new StuTrainingStepRecord();
stepRecord.setRecordId(String.valueOf(UUID.randomUUID()));
stepRecord.setUserId(commitCaseDto.getUserId());
@ -99,7 +99,7 @@ public class TeaCaseStepServiceImpl implements ITeaCaseStepService {
stepRecord.setCaseStepId(commitCaseDto.getCaseStepId());
stepRecord.setStuAnswer(commitCaseDto.getStuAnswer());
SysCaseQuestionStep sysCaseQuestionStep = caseQuestionStepMapper.selectByPrimaryKey(commitCaseDto.getCaseStepId());
if(dbCaseQuestionStep.getAnswer().equals(commitCaseDto.getStuAnswer())){
if(dbCaseQuestionStep.getAnswerOriginal().equals(commitCaseDto.getStuAnswer())){
//答案正确 记录到案例步骤记录表中
stepRecord.setScore(String.valueOf(sysCaseQuestionStep.getScore()));
@ -150,4 +150,80 @@ public class TeaCaseStepServiceImpl implements ITeaCaseStepService {
return false;
}
}
@Override
public Boolean commitApplyCase(List<StuCommitCaseDto> commitCaseDtoList) {
StuCommitCaseDto commitCaseDto = commitCaseDtoList.get(0);
//先判断该步骤是否上传过
StuTrainingStepRecordExample example = new StuTrainingStepRecordExample();
example.createCriteria().andUserIdEqualTo(commitCaseDto.getUserId()).andCaseStepIdEqualTo(commitCaseDto.getCaseStepId());
List<StuTrainingStepRecord> stuTrainingStepRecords = trainingStepRecordMapper.selectByExample(example);
if(stuTrainingStepRecords==null){ //未答过该步骤题目 新增数据到stepRecord表中
for (int i = 0; i < commitCaseDtoList.size(); i++) {
SysCaseQuestionStepWithBLOBs dbCaseQuestionStep = selectCaseStepDetails(commitCaseDto.getCaseStepId());
StuTrainingStepRecord stepRecord = new StuTrainingStepRecord();
stepRecord.setRecordId(String.valueOf(UUID.randomUUID()));
stepRecord.setUserId(commitCaseDto.getUserId());
stepRecord.setCaseId(commitCaseDto.getCaseId());
stepRecord.setCaseStepId(commitCaseDto.getCaseStepId());
stepRecord.setStuAnswer(commitCaseDto.getStuAnswer());
SysCaseQuestionStep sysCaseQuestionStep = caseQuestionStepMapper.selectByPrimaryKey(commitCaseDto.getCaseStepId());
if(dbCaseQuestionStep.getAnswerOriginal().equals(commitCaseDto.getStuAnswer())){
//答案正确 记录到案例步骤记录表中
stepRecord.setScore(String.valueOf(sysCaseQuestionStep.getScore()));
//再修改学生实训表中的部分参数 先获取学生实训表中的数据
StuTrainingWithBLOBs training = trainingMapper.selectByPrimaryKey(commitCaseDto.getStuTrainingId());
//如果案例题学生的实验实训完成情况=0 则实训进度+1否则 实训进度不加 并累加案例题学生得分 修改实验实训完成状态
if(training.getExpTrainingCompleteStatus()==null){
if(training.getProgress()==null){
training.setProgress(BigDecimal.ONE);
}else {
training.setProgress(training.getProgress().add(BigDecimal.valueOf(1)));
}
training.setExpTrainingCompleteStatus(1);
}
if(training.getCaseStuScore()==null){
training.setCaseStuScore(sysCaseQuestionStep.getScore());
}else {
training.setCaseStuScore(training.getCaseStuScore().add(sysCaseQuestionStep.getScore()));
}
trainingMapper.updateByPrimaryKeyWithBLOBs(training);
}else { //回答错误 记录到案例步骤记录表中
stepRecord.setScore("0");
//再修改学生实训表中的部分参数 先获取学生实训表中的数据
StuTrainingWithBLOBs training = trainingMapper.selectByPrimaryKey(commitCaseDto.getStuTrainingId());
//如果案例题学生的实验实训完成情况=0 则实训进度+1否则 实训进度不加 并累加案例题学生得分 修改实验实训完成状态
if(training.getExpTrainingCompleteStatus()==null){
if(training.getProgress()==null){
training.setProgress(BigDecimal.ONE);
}else {
training.setProgress(training.getProgress().add(BigDecimal.valueOf(1)));
}
training.setExpTrainingCompleteStatus(1);
}
if(training.getCaseStuScore()==null){
training.setCaseStuScore(sysCaseQuestionStep.getScore());
}else {
training.setCaseStuScore(training.getCaseStuScore().add(sysCaseQuestionStep.getScore()));
}
trainingMapper.updateByPrimaryKeyWithBLOBs(training);
}
trainingStepRecordMapper.insert(stepRecord);
}
return true;
}else { //回答过该题
for (int i = 0; i < commitCaseDtoList.size(); i++) {
String caseStepId = commitCaseDtoList.get(i).getCaseStepId();
StuTrainingStepRecordExample exampleRecord = new StuTrainingStepRecordExample();
exampleRecord.createCriteria().andUserIdEqualTo(commitCaseDto.getUserId()).andCaseStepIdEqualTo(caseStepId);
List<StuTrainingStepRecord> stuTrainingStepRecords1 = trainingStepRecordMapper.selectByExample(exampleRecord);
StuTrainingStepRecord stepRecord = stuTrainingStepRecords1.get(0);
stepRecord.setStuAnswer(commitCaseDto.getStuAnswer());
trainingStepRecordMapper.updateByPrimaryKeyWithBLOBs(stepRecord);
}
return false;
}
}
}

@ -34,7 +34,7 @@ public class TeaResourceDataServiceImpl implements ITeaResourceDataService {
return false;
}
}
String uploadUrl = fileUtil.upload(file);
String uploadUrl = fileUtil.upload2(file.getOriginalFilename(),file,"/dataResource");
SysResourceData resourceData = new SysResourceData();
resourceData.setResourceDataId(String.valueOf(UUID.randomUUID()));
resourceData.setResourceName(file.getOriginalFilename());

@ -13,7 +13,13 @@ import java.io.InputStream;
*/
public interface IFileUtil {
/**
* http
*
* @param file formhttp
* @return
*/
String upload2(String fileName,MultipartFile file,String path);
/**
* http

@ -147,7 +147,7 @@ public class LocalFileUtil implements IFileUtil{
}
private String upload(String fileName, MultipartFile file, String relativePath) {
public String upload(String fileName, MultipartFile file, String relativePath) {
Assert.isTrue(!file.isEmpty(), "文件不存在");
String originalFilename = file.getOriginalFilename();
if (fileName == null) fileName = IdUtil.simpleUUID();
@ -173,4 +173,31 @@ public class LocalFileUtil implements IFileUtil{
throw new IllegalArgumentException("上传文件失败,IO错误");
}
}
public String upload2(String fileName, MultipartFile file, String relativePath) {
Assert.isTrue(!file.isEmpty(), "文件不存在");
String originalFilename = file.getOriginalFilename();
if (fileName == null) fileName = IdUtil.simpleUUID();
String sp = getSuffix(originalFilename);
Assert.notNull(sp, "文件类型错误");
Assert.isTrue(!excludeSp.contains(sp.toLowerCase()), "文件类型错误");
try {
String filePath;
if (relativePath == null) {
filePath = getDiskRelativePath(fileName, sp);
} else {
relativePath = relativePath.endsWith("/") ? relativePath : relativePath + "/";
filePath = relativePath + fileName;
}
File destFile = new File(getFullPath(filePath));
destFile.getParentFile().mkdirs();
file.transferTo(destFile);
return filePath;
} catch (FileNotFoundException e) {
throw new IllegalArgumentException("上传文件失败,FileNotFound错误");
} catch (IOException e) {
throw new IllegalArgumentException("上传文件失败,IO错误");
}
}
}

@ -18,7 +18,7 @@
<!-- 配置数据库连接信息 -->
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://118.31.7.2:3306/financial_bigdata" userId="root"
connectionURL="jdbc:mysql://120.78.220.29:3307/financial_bigdata" userId="root"
password="sztzjy2017">
<property name="useInformationSchema" value="true"/> <!--useInformationSchema 实体类上添加数据表的注释 -->
</jdbcConnection>
@ -57,7 +57,8 @@
<!-- <table tableName="tea_learning_statistics" domainObjectName="TeaLearningStatistics" />-->
<!-- <table tableName="tea_resource_center" domainObjectName="TeaResourceCenter" />-->
<!-- <table tableName="training_report" domainObjectName="TrainingReport" />-->
<table tableName="sys_case_question" domainObjectName="SysCaseQuestion" />
<!-- <table tableName="sys_case_question" domainObjectName="SysCaseQuestion" />-->
<table tableName="sys_case_question_step" domainObjectName="SysCaseQuestionStep" />
</context>

@ -1,322 +1,373 @@
<?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">
<mapper namespace="com.sztzjy.financial_bigdata.mapper.SysCaseQuestionStepMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep">
<id column="case_step_id" jdbcType="VARCHAR" property="caseStepId"/>
<result column="case_id" jdbcType="VARCHAR" property="caseId"/>
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="content" jdbcType="VARCHAR" property="content"/>
<result column="question" jdbcType="VARCHAR" property="question"/>
<result column="answer" jdbcType="VARCHAR" property="answer"/>
<result column="content_original" jdbcType="VARCHAR" property="contentOriginal"/>
<result column="question_original" jdbcType="VARCHAR" property="questionOriginal"/>
<result column="answer_original" jdbcType="VARCHAR" property="answerOriginal"/>
<result column="sort" jdbcType="INTEGER" property="sort"/>
<result column="score" jdbcType="DECIMAL" property="score"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep">
<id column="case_step_id" jdbcType="VARCHAR" property="caseStepId" />
<result column="case_id" jdbcType="VARCHAR" property="caseId" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="score" jdbcType="DECIMAL" property="score" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepWithBLOBs">
<result column="title" jdbcType="LONGVARCHAR" property="title" />
<result column="content" jdbcType="LONGVARCHAR" property="content" />
<result column="question" jdbcType="LONGVARCHAR" property="question" />
<result column="answer" jdbcType="LONGVARCHAR" property="answer" />
<result column="content_original" jdbcType="LONGVARCHAR" property="contentOriginal" />
<result column="question_original" jdbcType="LONGVARCHAR" property="questionOriginal" />
<result column="answer_original" jdbcType="LONGVARCHAR" property="answerOriginal" />
<result column="practice_answer" jdbcType="LONGVARCHAR" property="practiceAnswer" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
case_step_id
, case_id, title, content, question, answer, content_original, question_original,
answer_original, sort, score
</sql>
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from sys_case_question_step
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from sys_case_question_step
where case_step_id = #{caseStepId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete
from sys_case_question_step
where case_step_id = #{caseStepId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample">
delete from sys_case_question_step
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep">
insert into sys_case_question_step (case_step_id, case_id, title,
content, question, answer,
content_original, question_original, answer_original,
sort, score)
values (#{caseStepId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
#{content,jdbcType=VARCHAR}, #{question,jdbcType=VARCHAR}, #{answer,jdbcType=VARCHAR},
#{contentOriginal,jdbcType=VARCHAR}, #{questionOriginal,jdbcType=VARCHAR},
#{answerOriginal,jdbcType=VARCHAR},
#{sort,jdbcType=INTEGER}, #{score,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep">
insert into sys_case_question_step
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="caseStepId != null">
case_step_id,
</if>
<if test="caseId != null">
case_id,
</if>
<if test="title != null">
title,
</if>
<if test="content != null">
content,
</if>
<if test="question != null">
question,
</if>
<if test="answer != null">
answer,
</if>
<if test="contentOriginal != null">
content_original,
</if>
<if test="questionOriginal != null">
question_original,
</if>
<if test="answerOriginal != null">
answer_original,
</if>
<if test="sort != null">
sort,
</if>
<if test="score != null">
score,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="caseStepId != null">
#{caseStepId,jdbcType=VARCHAR},
</if>
<if test="caseId != null">
#{caseId,jdbcType=VARCHAR},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="question != null">
#{question,jdbcType=VARCHAR},
</if>
<if test="answer != null">
#{answer,jdbcType=VARCHAR},
</if>
<if test="contentOriginal != null">
#{contentOriginal,jdbcType=VARCHAR},
</if>
<if test="questionOriginal != null">
#{questionOriginal,jdbcType=VARCHAR},
</if>
<if test="answerOriginal != null">
#{answerOriginal,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="score != null">
#{score,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample"
resultType="java.lang.Long">
select count(*) from sys_case_question_step
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</trim>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_case_question_step
<set>
<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.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
</if>
<if test="record.question != null">
question = #{record.question,jdbcType=VARCHAR},
</if>
<if test="record.answer != null">
answer = #{record.answer,jdbcType=VARCHAR},
</if>
<if test="record.contentOriginal != null">
content_original = #{record.contentOriginal,jdbcType=VARCHAR},
</if>
<if test="record.questionOriginal != null">
question_original = #{record.questionOriginal,jdbcType=VARCHAR},
</if>
<if test="record.answerOriginal != null">
answer_original = #{record.answerOriginal,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>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_case_question_step
set case_step_id = #{record.caseStepId,jdbcType=VARCHAR},
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
case_step_id, case_id, sort, score
</sql>
<sql id="Blob_Column_List">
title, content, question, answer, content_original, question_original, answer_original,
practice_answer
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from sys_case_question_step
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_case_question_step
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from sys_case_question_step
where case_step_id = #{caseStepId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from sys_case_question_step
where case_step_id = #{caseStepId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample">
delete from sys_case_question_step
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepWithBLOBs">
insert into sys_case_question_step (case_step_id, case_id, sort,
score, title, content,
question, answer, content_original,
question_original, answer_original,
practice_answer)
values (#{caseStepId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER},
#{score,jdbcType=DECIMAL}, #{title,jdbcType=LONGVARCHAR}, #{content,jdbcType=LONGVARCHAR},
#{question,jdbcType=LONGVARCHAR}, #{answer,jdbcType=LONGVARCHAR}, #{contentOriginal,jdbcType=LONGVARCHAR},
#{questionOriginal,jdbcType=LONGVARCHAR}, #{answerOriginal,jdbcType=LONGVARCHAR},
#{practiceAnswer,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepWithBLOBs">
insert into sys_case_question_step
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="caseStepId != null">
case_step_id,
</if>
<if test="caseId != null">
case_id,
</if>
<if test="sort != null">
sort,
</if>
<if test="score != null">
score,
</if>
<if test="title != null">
title,
</if>
<if test="content != null">
content,
</if>
<if test="question != null">
question,
</if>
<if test="answer != null">
answer,
</if>
<if test="contentOriginal != null">
content_original,
</if>
<if test="questionOriginal != null">
question_original,
</if>
<if test="answerOriginal != null">
answer_original,
</if>
<if test="practiceAnswer != null">
practice_answer,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="caseStepId != null">
#{caseStepId,jdbcType=VARCHAR},
</if>
<if test="caseId != null">
#{caseId,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="score != null">
#{score,jdbcType=DECIMAL},
</if>
<if test="title != null">
#{title,jdbcType=LONGVARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
<if test="question != null">
#{question,jdbcType=LONGVARCHAR},
</if>
<if test="answer != null">
#{answer,jdbcType=LONGVARCHAR},
</if>
<if test="contentOriginal != null">
#{contentOriginal,jdbcType=LONGVARCHAR},
</if>
<if test="questionOriginal != null">
#{questionOriginal,jdbcType=LONGVARCHAR},
</if>
<if test="answerOriginal != null">
#{answerOriginal,jdbcType=LONGVARCHAR},
</if>
<if test="practiceAnswer != null">
#{practiceAnswer,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample" resultType="java.lang.Long">
select count(*) from sys_case_question_step
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_case_question_step
<set>
<if test="record.caseStepId != null">
case_step_id = #{record.caseStepId,jdbcType=VARCHAR},
</if>
<if test="record.caseId != null">
case_id = #{record.caseId,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR},
content = #{record.content,jdbcType=VARCHAR},
question = #{record.question,jdbcType=VARCHAR},
answer = #{record.answer,jdbcType=VARCHAR},
content_original = #{record.contentOriginal,jdbcType=VARCHAR},
question_original = #{record.questionOriginal,jdbcType=VARCHAR},
answer_original = #{record.answerOriginal,jdbcType=VARCHAR},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
score = #{record.score,jdbcType=DECIMAL}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep">
update sys_case_question_step
<set>
<if test="caseId != null">
case_id = #{caseId,jdbcType=VARCHAR},
</if>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="question != null">
question = #{question,jdbcType=VARCHAR},
</if>
<if test="answer != null">
answer = #{answer,jdbcType=VARCHAR},
</if>
<if test="contentOriginal != null">
content_original = #{contentOriginal,jdbcType=VARCHAR},
</if>
<if test="questionOriginal != null">
question_original = #{questionOriginal,jdbcType=VARCHAR},
</if>
<if test="answerOriginal != null">
answer_original = #{answerOriginal,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="score != null">
score = #{score,jdbcType=DECIMAL},
</if>
</set>
where case_step_id = #{caseStepId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep">
update sys_case_question_step
set case_id = #{caseId,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR},
question = #{question,jdbcType=VARCHAR},
answer = #{answer,jdbcType=VARCHAR},
content_original = #{contentOriginal,jdbcType=VARCHAR},
question_original = #{questionOriginal,jdbcType=VARCHAR},
answer_original = #{answerOriginal,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
score = #{score,jdbcType=DECIMAL}
where case_step_id = #{caseStepId,jdbcType=VARCHAR}
</update>
</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.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.practiceAnswer != null">
practice_answer = #{record.practiceAnswer,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_step
set case_step_id = #{record.caseStepId,jdbcType=VARCHAR},
case_id = #{record.caseId,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=INTEGER},
score = #{record.score,jdbcType=DECIMAL},
title = #{record.title,jdbcType=LONGVARCHAR},
content = #{record.content,jdbcType=LONGVARCHAR},
question = #{record.question,jdbcType=LONGVARCHAR},
answer = #{record.answer,jdbcType=LONGVARCHAR},
content_original = #{record.contentOriginal,jdbcType=LONGVARCHAR},
question_original = #{record.questionOriginal,jdbcType=LONGVARCHAR},
answer_original = #{record.answerOriginal,jdbcType=LONGVARCHAR},
practice_answer = #{record.practiceAnswer,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_case_question_step
set case_step_id = #{record.caseStepId,jdbcType=VARCHAR},
case_id = #{record.caseId,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=INTEGER},
score = #{record.score,jdbcType=DECIMAL}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepWithBLOBs">
update sys_case_question_step
<set>
<if test="caseId != null">
case_id = #{caseId,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="score != null">
score = #{score,jdbcType=DECIMAL},
</if>
<if test="title != null">
title = #{title,jdbcType=LONGVARCHAR},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
</if>
<if test="question != null">
question = #{question,jdbcType=LONGVARCHAR},
</if>
<if test="answer != null">
answer = #{answer,jdbcType=LONGVARCHAR},
</if>
<if test="contentOriginal != null">
content_original = #{contentOriginal,jdbcType=LONGVARCHAR},
</if>
<if test="questionOriginal != null">
question_original = #{questionOriginal,jdbcType=LONGVARCHAR},
</if>
<if test="answerOriginal != null">
answer_original = #{answerOriginal,jdbcType=LONGVARCHAR},
</if>
<if test="practiceAnswer != null">
practice_answer = #{practiceAnswer,jdbcType=LONGVARCHAR},
</if>
</set>
where case_step_id = #{caseStepId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepWithBLOBs">
update sys_case_question_step
set case_id = #{caseId,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
score = #{score,jdbcType=DECIMAL},
title = #{title,jdbcType=LONGVARCHAR},
content = #{content,jdbcType=LONGVARCHAR},
question = #{question,jdbcType=LONGVARCHAR},
answer = #{answer,jdbcType=LONGVARCHAR},
content_original = #{contentOriginal,jdbcType=LONGVARCHAR},
question_original = #{questionOriginal,jdbcType=LONGVARCHAR},
answer_original = #{answerOriginal,jdbcType=LONGVARCHAR},
practice_answer = #{practiceAnswer,jdbcType=LONGVARCHAR}
where case_step_id = #{caseStepId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep">
update sys_case_question_step
set case_id = #{caseId,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
score = #{score,jdbcType=DECIMAL}
where case_step_id = #{caseStepId,jdbcType=VARCHAR}
</update>
<resultMap id="DtoMap" type="com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep">
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="chapter_name" jdbcType="VARCHAR" property="questionOriginal"/>
<result column="step_count" jdbcType="VARCHAR" property="contentOriginal"/>
<result column="content" jdbcType="VARCHAR" property="questionOriginal"/>
<result column="answer_original" jdbcType="VARCHAR" property="answerOriginal"/>
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="chapter_name" jdbcType="VARCHAR" property="questionOriginal" />
<result column="step_count" jdbcType="VARCHAR" property="contentOriginal" />
<result column="content" jdbcType="VARCHAR" property="questionOriginal" />
<result column="answer_original" jdbcType="VARCHAR" property="answerOriginal" />
</resultMap>
<select id="getGradeReportCase" parameterType="java.util.List" resultMap="DtoMap">
SELECT s2.title, s3.chapter_name, COUNT(*) AS step_count
@ -324,7 +375,7 @@
JOIN sys_case_question s2 ON s1.case_id = s2.case_id
JOIN sys_course_chapter s3 ON s2.chapter_id = s3.chapter_id
WHERE s2.case_id IN
<foreach collection="list" separator="," item="id" open="(" close=")">
<foreach close=")" collection="list" item="id" open="(" separator=",">
#{id}
</foreach>
GROUP BY s2.title, s3.chapter_name

Loading…
Cancel
Save