From 74e7c8754059c3972632aed7bfc1e88eb3aed187 Mon Sep 17 00:00:00 2001 From: yz <3614508250@qq.com> Date: Wed, 13 Mar 2024 09:55:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B5=84=E6=BA=90=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E9=83=A8=E5=88=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/ObjectiveController.java | 14 ++ .../tea/TeaObjectiveController.java | 34 +++ .../tea/TeaResourceCenterController.java | 108 +++++---- .../financial_bigdata/entity/StuUser.java | 2 +- ...QuestionBank.java => SysCaseQuestion.java} | 17 +- ...ample.java => SysCaseQuestionExample.java} | 74 +++++- .../entity/SysObjectiveQuestion.java | 35 ++- .../entity/SysObjectiveQuestionExample.java | 210 ++++++++++++++++++ .../entity/TeaResourceCenter.java | 11 + .../entity/TeaResourceCenterExample.java | 70 ++++++ .../mapper/StuUserMapper.java | 16 +- .../mapper/SysCaseQuestionBankMapper.java | 30 --- .../mapper/SysCaseQuestionMapper.java | 32 +++ .../mapper/SysObjectiveQuestionMapper.java | 21 +- .../service/tea/ITeaObjectiveService.java | 7 + .../tea/ITeaResourceCenterService.java | 2 +- .../tea/impl/TeaObjectiveServiceImpl.java | 31 +++ .../impl/TeaResourceCenterServiceImpl.java | 7 +- ...nkMapper.xml => SysCaseQuestionMapper.xml} | 87 +++++--- .../mapper/SysObjectiveQuestionMapper.xml | 174 ++++++--------- .../mapper/TeaResourceCenterMapper.xml | 29 ++- 21 files changed, 743 insertions(+), 268 deletions(-) create mode 100644 src/main/java/com/sztzjy/financial_bigdata/controller/common/ObjectiveController.java create mode 100644 src/main/java/com/sztzjy/financial_bigdata/controller/tea/TeaObjectiveController.java rename src/main/java/com/sztzjy/financial_bigdata/entity/{SysCaseQuestionBank.java => SysCaseQuestion.java} (91%) rename src/main/java/com/sztzjy/financial_bigdata/entity/{SysCaseQuestionBankExample.java => SysCaseQuestionExample.java} (93%) delete mode 100644 src/main/java/com/sztzjy/financial_bigdata/mapper/SysCaseQuestionBankMapper.java create mode 100644 src/main/java/com/sztzjy/financial_bigdata/mapper/SysCaseQuestionMapper.java create mode 100644 src/main/java/com/sztzjy/financial_bigdata/service/tea/ITeaObjectiveService.java create mode 100644 src/main/java/com/sztzjy/financial_bigdata/service/tea/impl/TeaObjectiveServiceImpl.java rename src/main/resources/mapper/{SysCaseQuestionBankMapper.xml => SysCaseQuestionMapper.xml} (85%) diff --git a/src/main/java/com/sztzjy/financial_bigdata/controller/common/ObjectiveController.java b/src/main/java/com/sztzjy/financial_bigdata/controller/common/ObjectiveController.java new file mode 100644 index 0000000..da83a6e --- /dev/null +++ b/src/main/java/com/sztzjy/financial_bigdata/controller/common/ObjectiveController.java @@ -0,0 +1,14 @@ +package com.sztzjy.financial_bigdata.controller.common; + +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +//客观题 +@RestController +@Api(tags = "客观题相关") +@RequestMapping("api/common/objective") +public class ObjectiveController { + + +} diff --git a/src/main/java/com/sztzjy/financial_bigdata/controller/tea/TeaObjectiveController.java b/src/main/java/com/sztzjy/financial_bigdata/controller/tea/TeaObjectiveController.java new file mode 100644 index 0000000..27d1237 --- /dev/null +++ b/src/main/java/com/sztzjy/financial_bigdata/controller/tea/TeaObjectiveController.java @@ -0,0 +1,34 @@ +package com.sztzjy.financial_bigdata.controller.tea; + +import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion; +import com.sztzjy.financial_bigdata.service.tea.ITeaObjectiveService; +import com.sztzjy.financial_bigdata.util.ResultEntity; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.*; + +@RestController +@Api(tags = "教师端--资源中心-题库管理") +@RequestMapping("api/tea/objective") +public class TeaObjectiveController { + @Autowired + ITeaObjectiveService teaObjectiveService; + + //客观题新增 + @PostMapping("insertObjective") + @ApiOperation("客观题新增") + public ResultEntity insertObjective(@RequestBody SysObjectiveQuestion objectiveQuestion) { + Boolean flag=teaObjectiveService.insertObjective(objectiveQuestion); + if (flag){ + return new ResultEntity<>(HttpStatus.OK,"客观题新增成功"); + }else { + return new ResultEntity<>(HttpStatus.BAD_REQUEST,"客观题新增失败"); + } + } + //客观题批量导入 + //客观题删除 + //客观题列表查看 + //客观题单个详情查看 +} diff --git a/src/main/java/com/sztzjy/financial_bigdata/controller/tea/TeaResourceCenterController.java b/src/main/java/com/sztzjy/financial_bigdata/controller/tea/TeaResourceCenterController.java index a305a62..bf6caaf 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/controller/tea/TeaResourceCenterController.java +++ b/src/main/java/com/sztzjy/financial_bigdata/controller/tea/TeaResourceCenterController.java @@ -1,6 +1,8 @@ package com.sztzjy.financial_bigdata.controller.tea; import com.sztzjy.financial_bigdata.entity.TeaResourceCenter; +import com.sztzjy.financial_bigdata.entity.TeaResourceCenterExample; +import com.sztzjy.financial_bigdata.mapper.TeaResourceCenterMapper; import com.sztzjy.financial_bigdata.service.tea.ITeaResourceCenterService; import com.sztzjy.financial_bigdata.util.ResultEntity; import com.sztzjy.financial_bigdata.util.file.IFileUtil; @@ -8,7 +10,9 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.core.io.FileSystemResource; +import org.springframework.core.io.Resource; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -24,90 +28,80 @@ import java.util.List; //资源中心 @RestController @Api(tags = "教师端--资源中心-资源列表") -@RequestMapping("api/tch/resourceCenter") +@RequestMapping("api/tea/resourceCenter") public class TeaResourceCenterController { @Autowired IFileUtil fileUtil; @Autowired ITeaResourceCenterService resourceCenterService; + @Autowired + TeaResourceCenterMapper resourceCenterMapper; + @Value("${file.path}") + private String filePath; //上传资源文件 @GetMapping("uploadResource") @ApiOperation("上传资源文件") public ResultEntity uploadResource(@RequestParam MultipartFile file, - @ApiParam("学校id") @RequestParam(required = false) String schoolId, - @ApiParam("章节Id") @RequestParam String chapterId){ - Boolean flag=resourceCenterService.uploadResource(file,schoolId,chapterId); - if (flag){ - return new ResultEntity<>(HttpStatus.OK,"新增成功"); - }else { - return new ResultEntity<>(HttpStatus.BAD_REQUEST,"新增失败"); + @ApiParam("学校id") @RequestParam(required = false) String schoolId, + @ApiParam("章节Id") @RequestParam String chapterId, + @ApiParam("上传文件类型 文件/视频") @RequestParam String type) { + Boolean flag = resourceCenterService.uploadResource(file, schoolId, chapterId,type); + if (flag) { + return new ResultEntity<>(HttpStatus.OK, "新增成功"); + } else { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "新增失败"); } } - //查看资源文件 + //查看资源文件列表 @GetMapping("selectResource") - @ApiOperation("查看资源文件,图片资源使用默认图片") + @ApiOperation("查看资源文件列表,图片资源使用默认图片") public ResultEntity> uploadResourceCenter(@ApiParam("学校id") @RequestParam(required = false) String schoolId, - @ApiParam("章节Id") @RequestParam String chapterId){ - List list=resourceCenterService.selectResource(schoolId,chapterId); + @ApiParam("章节Id") @RequestParam String chapterId) { + List list = resourceCenterService.selectResource(schoolId, chapterId); return new ResultEntity(HttpStatus.OK, "相对估值法-PS市盈率法,展示成功", list); } //下载资源文件 @GetMapping("downloadResource") @ApiOperation("下载资源文件") - public void downloadResource(@ApiParam("资源ID") @RequestParam String resourceId ,HttpServletResponse response){ - resourceCenterService.downloadResource(resourceId,response); + public void downloadResource(@ApiParam("资源ID") @RequestParam String resourceId, HttpServletResponse response) { + resourceCenterService.downloadResource(resourceId, response); } //查看资源文件 @GetMapping("/getResource") - @ApiOperation("获取视频流") - public ResponseEntity streamVideo(@RequestParam String module, @RequestParam String name, HttpServletResponse response) { - return null; -// -// -// StuResourcesExample example = new StuResourcesExample(); -// example.createCriteria().andModuleEqualTo(module).andResourcesNameEqualTo(name); -// List stuResources = stuResourcesMapper.selectByExample(example); -// if (stuResources.size() > 0) { -// StuResources stuResources1 = stuResources.get(0); -// String url = stuResources1.getResourcesUrl(); -// String videoPath = filePath + url; -// File videoFile = new File(videoPath); -// if ("mp4".equals(stuResources1.getResourcesType())) { -// -// -// if (videoFile.exists()) { -// Path path = Paths.get(videoPath); -// FileSystemResource fileSystemResource = new FileSystemResource(videoFile); -// return ResponseEntity.ok() -// .contentType(MediaType.parseMediaType("video/mp4")) -// .body(fileSystemResource); -// } else { -// return ResponseEntity.notFound().build(); -// } -// } else if ("pdf".equals(stuResources1.getResourcesType())) { -// -//// fileUtil.getPdf(response,name,url); -// if (videoFile.exists()) { -// Path path = Paths.get(videoPath); -// FileSystemResource fileSystemResource = new FileSystemResource(videoFile); -// return ResponseEntity.ok() -// .contentType(MediaType.parseMediaType("application/pdf")) -// .body(fileSystemResource); -// -// } else { -// return ResponseEntity.notFound().build(); -// } -// -// } -// -// } -// return ResponseEntity.notFound().build(); + @ApiOperation("查看资源文件") + public ResponseEntity streamVideo(@RequestParam String resourceId, HttpServletResponse response) { + TeaResourceCenter resourceCenter = resourceCenterMapper.selectByPrimaryKey(resourceId); + String url = resourceCenter.getResourceUrl(); + String videoPath = filePath + url; + File videoFile = new File(videoPath); + if("视频".equals(resourceCenter.getType())){ + if (videoFile.exists()) { + Path path = Paths.get(videoPath); + FileSystemResource fileSystemResource = new FileSystemResource(videoFile); + return ResponseEntity.ok() + .contentType(MediaType.parseMediaType("video/mp4")) + .body(fileSystemResource); + } else { + return ResponseEntity.notFound().build(); + } + }else if("文件".equals(resourceCenter.getType())){ + if (videoFile.exists()) { + Path path = Paths.get(videoPath); + FileSystemResource fileSystemResource = new FileSystemResource(videoFile); + return ResponseEntity.ok() + .contentType(MediaType.parseMediaType("application/pdf")) + .body(fileSystemResource); + } else { + return ResponseEntity.notFound().build(); + } + } + return ResponseEntity.notFound().build(); } } diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/StuUser.java b/src/main/java/com/sztzjy/financial_bigdata/entity/StuUser.java index 8157785..1c3865f 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/StuUser.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/StuUser.java @@ -7,7 +7,7 @@ import io.swagger.annotations.ApiModelProperty; * 学生用户信息表 * * @author xcj - * stu_user + * stu_userinfo */ public class StuUser { @ApiModelProperty("用户ID") diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/SysCaseQuestionBank.java b/src/main/java/com/sztzjy/financial_bigdata/entity/SysCaseQuestion.java similarity index 91% rename from src/main/java/com/sztzjy/financial_bigdata/entity/SysCaseQuestionBank.java rename to src/main/java/com/sztzjy/financial_bigdata/entity/SysCaseQuestion.java index 699bdc9..988e01f 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/SysCaseQuestionBank.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/SysCaseQuestion.java @@ -7,9 +7,9 @@ import io.swagger.annotations.ApiModelProperty; * 案例题库表 * * @author xcj - * sys_case_question_bank + * sys_case_question */ -public class SysCaseQuestionBank { +public class SysCaseQuestion { @ApiModelProperty("案例题ID") private String caseId; @@ -46,12 +46,15 @@ public class SysCaseQuestionBank { @ApiModelProperty("步骤分数") private BigDecimal stepScore; - @ApiModelProperty("输入类型") + @ApiModelProperty("输入类型 内置,新增") private String inputType; @ApiModelProperty("题目类型") private String type; + @ApiModelProperty("学校id") + private String schoolId; + public String getCaseId() { return caseId; } @@ -163,4 +166,12 @@ public class SysCaseQuestionBank { public void setType(String type) { this.type = type == null ? null : type.trim(); } + + public String getSchoolId() { + return schoolId; + } + + public void setSchoolId(String schoolId) { + this.schoolId = schoolId == null ? null : schoolId.trim(); + } } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/SysCaseQuestionBankExample.java b/src/main/java/com/sztzjy/financial_bigdata/entity/SysCaseQuestionExample.java similarity index 93% rename from src/main/java/com/sztzjy/financial_bigdata/entity/SysCaseQuestionBankExample.java rename to src/main/java/com/sztzjy/financial_bigdata/entity/SysCaseQuestionExample.java index 582de39..db2565c 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/SysCaseQuestionBankExample.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/SysCaseQuestionExample.java @@ -4,14 +4,14 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -public class SysCaseQuestionBankExample { +public class SysCaseQuestionExample { protected String orderByClause; protected boolean distinct; protected List oredCriteria; - public SysCaseQuestionBankExample() { + public SysCaseQuestionExample() { oredCriteria = new ArrayList<>(); } @@ -1064,6 +1064,76 @@ public class SysCaseQuestionBankExample { addCriterion("type not between", value1, value2, "type"); return (Criteria) this; } + + public Criteria andSchoolIdIsNull() { + addCriterion("school_id is null"); + return (Criteria) this; + } + + public Criteria andSchoolIdIsNotNull() { + addCriterion("school_id is not null"); + return (Criteria) this; + } + + public Criteria andSchoolIdEqualTo(String value) { + addCriterion("school_id =", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotEqualTo(String value) { + addCriterion("school_id <>", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdGreaterThan(String value) { + addCriterion("school_id >", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdGreaterThanOrEqualTo(String value) { + addCriterion("school_id >=", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdLessThan(String value) { + addCriterion("school_id <", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdLessThanOrEqualTo(String value) { + addCriterion("school_id <=", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdLike(String value) { + addCriterion("school_id like", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotLike(String value) { + addCriterion("school_id not like", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdIn(List values) { + addCriterion("school_id in", values, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotIn(List values) { + addCriterion("school_id not in", values, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdBetween(String value1, String value2) { + addCriterion("school_id between", value1, value2, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotBetween(String value1, String value2) { + addCriterion("school_id not between", value1, value2, "schoolId"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/SysObjectiveQuestion.java b/src/main/java/com/sztzjy/financial_bigdata/entity/SysObjectiveQuestion.java index 054ce59..0d180ac 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/SysObjectiveQuestion.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/SysObjectiveQuestion.java @@ -25,7 +25,7 @@ public class SysObjectiveQuestion { @ApiModelProperty("章节名称") private String chapterName; - @ApiModelProperty("输入类型") + @ApiModelProperty("内置,新增") private String inputType; @ApiModelProperty("题目类型") @@ -34,6 +34,9 @@ public class SysObjectiveQuestion { @ApiModelProperty("分数") private BigDecimal score; + @ApiModelProperty("题目内容") + private String content; + @ApiModelProperty("选项A") private String questionA; @@ -52,6 +55,12 @@ public class SysObjectiveQuestion { @ApiModelProperty("答案") private String answer; + @ApiModelProperty("答案解析") + private String analyze; + + @ApiModelProperty("学校Id") + private String schoolId; + public String getObjectiveId() { return objectiveId; } @@ -116,6 +125,14 @@ public class SysObjectiveQuestion { this.score = score; } + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + public String getQuestionA() { return questionA; } @@ -163,4 +180,20 @@ public class SysObjectiveQuestion { public void setAnswer(String answer) { this.answer = answer == null ? null : answer.trim(); } + + public String getAnalyze() { + return analyze; + } + + public void setAnalyze(String analyze) { + this.analyze = analyze == null ? null : analyze.trim(); + } + + public String getSchoolId() { + return schoolId; + } + + public void setSchoolId(String schoolId) { + this.schoolId = schoolId == null ? null : schoolId.trim(); + } } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/SysObjectiveQuestionExample.java b/src/main/java/com/sztzjy/financial_bigdata/entity/SysObjectiveQuestionExample.java index 7645ede..42c77f2 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/SysObjectiveQuestionExample.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/SysObjectiveQuestionExample.java @@ -655,6 +655,76 @@ public class SysObjectiveQuestionExample { 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 values) { + addCriterion("content in", values, "content"); + return (Criteria) this; + } + + public Criteria andContentNotIn(List 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 andQuestionAIsNull() { addCriterion("question_a is null"); return (Criteria) this; @@ -1074,6 +1144,146 @@ public class SysObjectiveQuestionExample { addCriterion("answer not between", value1, value2, "answer"); return (Criteria) this; } + + public Criteria andAnalyzeIsNull() { + addCriterion("analyze is null"); + return (Criteria) this; + } + + public Criteria andAnalyzeIsNotNull() { + addCriterion("analyze is not null"); + return (Criteria) this; + } + + public Criteria andAnalyzeEqualTo(String value) { + addCriterion("analyze =", value, "analyze"); + return (Criteria) this; + } + + public Criteria andAnalyzeNotEqualTo(String value) { + addCriterion("analyze <>", value, "analyze"); + return (Criteria) this; + } + + public Criteria andAnalyzeGreaterThan(String value) { + addCriterion("analyze >", value, "analyze"); + return (Criteria) this; + } + + public Criteria andAnalyzeGreaterThanOrEqualTo(String value) { + addCriterion("analyze >=", value, "analyze"); + return (Criteria) this; + } + + public Criteria andAnalyzeLessThan(String value) { + addCriterion("analyze <", value, "analyze"); + return (Criteria) this; + } + + public Criteria andAnalyzeLessThanOrEqualTo(String value) { + addCriterion("analyze <=", value, "analyze"); + return (Criteria) this; + } + + public Criteria andAnalyzeLike(String value) { + addCriterion("analyze like", value, "analyze"); + return (Criteria) this; + } + + public Criteria andAnalyzeNotLike(String value) { + addCriterion("analyze not like", value, "analyze"); + return (Criteria) this; + } + + public Criteria andAnalyzeIn(List values) { + addCriterion("analyze in", values, "analyze"); + return (Criteria) this; + } + + public Criteria andAnalyzeNotIn(List values) { + addCriterion("analyze not in", values, "analyze"); + return (Criteria) this; + } + + public Criteria andAnalyzeBetween(String value1, String value2) { + addCriterion("analyze between", value1, value2, "analyze"); + return (Criteria) this; + } + + public Criteria andAnalyzeNotBetween(String value1, String value2) { + addCriterion("analyze not between", value1, value2, "analyze"); + return (Criteria) this; + } + + public Criteria andSchoolIdIsNull() { + addCriterion("school_id is null"); + return (Criteria) this; + } + + public Criteria andSchoolIdIsNotNull() { + addCriterion("school_id is not null"); + return (Criteria) this; + } + + public Criteria andSchoolIdEqualTo(String value) { + addCriterion("school_id =", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotEqualTo(String value) { + addCriterion("school_id <>", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdGreaterThan(String value) { + addCriterion("school_id >", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdGreaterThanOrEqualTo(String value) { + addCriterion("school_id >=", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdLessThan(String value) { + addCriterion("school_id <", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdLessThanOrEqualTo(String value) { + addCriterion("school_id <=", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdLike(String value) { + addCriterion("school_id like", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotLike(String value) { + addCriterion("school_id not like", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdIn(List values) { + addCriterion("school_id in", values, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotIn(List values) { + addCriterion("school_id not in", values, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdBetween(String value1, String value2) { + addCriterion("school_id between", value1, value2, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotBetween(String value1, String value2) { + addCriterion("school_id not between", value1, value2, "schoolId"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/TeaResourceCenter.java b/src/main/java/com/sztzjy/financial_bigdata/entity/TeaResourceCenter.java index d3a49a4..026a525 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/TeaResourceCenter.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/TeaResourceCenter.java @@ -26,6 +26,9 @@ public class TeaResourceCenter { @ApiModelProperty("学校ID") private String schoolId; + @ApiModelProperty("视频/文件") + private String type; + public String getResourceId() { return resourceId; } @@ -73,4 +76,12 @@ public class TeaResourceCenter { public void setSchoolId(String schoolId) { this.schoolId = schoolId == null ? null : schoolId.trim(); } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/TeaResourceCenterExample.java b/src/main/java/com/sztzjy/financial_bigdata/entity/TeaResourceCenterExample.java index aa97e8a..2e1f1c5 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/TeaResourceCenterExample.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/TeaResourceCenterExample.java @@ -523,6 +523,76 @@ public class TeaResourceCenterExample { addCriterion("school_id not between", value1, value2, "schoolId"); return (Criteria) this; } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/src/main/java/com/sztzjy/financial_bigdata/mapper/StuUserMapper.java b/src/main/java/com/sztzjy/financial_bigdata/mapper/StuUserMapper.java index 0e46e95..d4f3b98 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/mapper/StuUserMapper.java +++ b/src/main/java/com/sztzjy/financial_bigdata/mapper/StuUserMapper.java @@ -2,19 +2,19 @@ package com.sztzjy.financial_bigdata.mapper; import com.sztzjy.financial_bigdata.entity.StuUser; import com.sztzjy.financial_bigdata.entity.StuUserExample; +import java.util.List; + import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; -import java.util.List; @Mapper public interface StuUserMapper { long countByExample(StuUserExample example); int deleteByExample(StuUserExample example); - - int deleteByPrimaryKey(String classId); + int deleteByPrimaryKey(String userid); int insert(StuUser record); @@ -22,14 +22,16 @@ public interface StuUserMapper { List selectByExample(StuUserExample example); - StuUser selectByPrimaryKey(String classId); + StuUser selectByPrimaryKey(String userid); + + int updateByExampleSelective(@Param("record") StuUser record, @Param("example") StuUserExample example); + + int updateByExample(@Param("record") StuUser record, @Param("example") StuUserExample example); int updateByPrimaryKeySelective(StuUser record); int updateByPrimaryKey(StuUser record); - int updateByExampleSelective(@Param("record") StuUser record, @Param("example") StuUserExample example); - int updateByExample(@Param("record") StuUser record, @Param("example") StuUserExample example); @Select("select DISTINCT stu_users.school_name from stu_users where school_id =#{schoolId}") - String selectSchoolNameById(@Param("schoolId")String schoolId); + String selectSchoolNameById(@Param("schoolId") String schoolId); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/mapper/SysCaseQuestionBankMapper.java b/src/main/java/com/sztzjy/financial_bigdata/mapper/SysCaseQuestionBankMapper.java deleted file mode 100644 index bc8e932..0000000 --- a/src/main/java/com/sztzjy/financial_bigdata/mapper/SysCaseQuestionBankMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sztzjy.financial_bigdata.mapper; - -import com.sztzjy.financial_bigdata.entity.SysCaseQuestionBank; -import com.sztzjy.financial_bigdata.entity.SysCaseQuestionBankExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface SysCaseQuestionBankMapper { - long countByExample(SysCaseQuestionBankExample example); - - int deleteByExample(SysCaseQuestionBankExample example); - - int deleteByPrimaryKey(String caseId); - - int insert(SysCaseQuestionBank record); - - int insertSelective(SysCaseQuestionBank record); - - List selectByExample(SysCaseQuestionBankExample example); - - SysCaseQuestionBank selectByPrimaryKey(String caseId); - - int updateByExampleSelective(@Param("record") SysCaseQuestionBank record, @Param("example") SysCaseQuestionBankExample example); - - int updateByExample(@Param("record") SysCaseQuestionBank record, @Param("example") SysCaseQuestionBankExample example); - - int updateByPrimaryKeySelective(SysCaseQuestionBank record); - - int updateByPrimaryKey(SysCaseQuestionBank record); -} \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/mapper/SysCaseQuestionMapper.java b/src/main/java/com/sztzjy/financial_bigdata/mapper/SysCaseQuestionMapper.java new file mode 100644 index 0000000..4d5dd82 --- /dev/null +++ b/src/main/java/com/sztzjy/financial_bigdata/mapper/SysCaseQuestionMapper.java @@ -0,0 +1,32 @@ +package com.sztzjy.financial_bigdata.mapper; + +import com.sztzjy.financial_bigdata.entity.SysCaseQuestion; +import com.sztzjy.financial_bigdata.entity.SysCaseQuestionExample; +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +@Mapper +public interface SysCaseQuestionMapper { + long countByExample(SysCaseQuestionExample example); + + int deleteByExample(SysCaseQuestionExample example); + + int deleteByPrimaryKey(String caseId); + + int insert(SysCaseQuestion record); + + int insertSelective(SysCaseQuestion record); + + List selectByExample(SysCaseQuestionExample example); + + SysCaseQuestion selectByPrimaryKey(String caseId); + + int updateByExampleSelective(@Param("record") SysCaseQuestion record, @Param("example") SysCaseQuestionExample example); + + int updateByExample(@Param("record") SysCaseQuestion record, @Param("example") SysCaseQuestionExample example); + + int updateByPrimaryKeySelective(SysCaseQuestion record); + + int updateByPrimaryKey(SysCaseQuestion record); +} \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/mapper/SysObjectiveQuestionMapper.java b/src/main/java/com/sztzjy/financial_bigdata/mapper/SysObjectiveQuestionMapper.java index 2bfb07e..496ea0a 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/mapper/SysObjectiveQuestionMapper.java +++ b/src/main/java/com/sztzjy/financial_bigdata/mapper/SysObjectiveQuestionMapper.java @@ -2,10 +2,11 @@ package com.sztzjy.financial_bigdata.mapper; import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion; import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionExample; -import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionWithBLOBs; import java.util.List; -import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +@Mapper public interface SysObjectiveQuestionMapper { long countByExample(SysObjectiveQuestionExample example); @@ -13,25 +14,19 @@ public interface SysObjectiveQuestionMapper { int deleteByPrimaryKey(String objectiveId); - int insert(SysObjectiveQuestionWithBLOBs record); - - int insertSelective(SysObjectiveQuestionWithBLOBs record); + int insert(SysObjectiveQuestion record); - List selectByExampleWithBLOBs(SysObjectiveQuestionExample example); + int insertSelective(SysObjectiveQuestion record); List selectByExample(SysObjectiveQuestionExample example); - SysObjectiveQuestionWithBLOBs selectByPrimaryKey(String objectiveId); + SysObjectiveQuestion selectByPrimaryKey(String objectiveId); - int updateByExampleSelective(@Param("record") SysObjectiveQuestionWithBLOBs record, @Param("example") SysObjectiveQuestionExample example); - - int updateByExampleWithBLOBs(@Param("record") SysObjectiveQuestionWithBLOBs record, @Param("example") SysObjectiveQuestionExample example); + int updateByExampleSelective(@Param("record") SysObjectiveQuestion record, @Param("example") SysObjectiveQuestionExample example); int updateByExample(@Param("record") SysObjectiveQuestion record, @Param("example") SysObjectiveQuestionExample example); - int updateByPrimaryKeySelective(SysObjectiveQuestionWithBLOBs record); - - int updateByPrimaryKeyWithBLOBs(SysObjectiveQuestionWithBLOBs record); + int updateByPrimaryKeySelective(SysObjectiveQuestion record); int updateByPrimaryKey(SysObjectiveQuestion record); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/service/tea/ITeaObjectiveService.java b/src/main/java/com/sztzjy/financial_bigdata/service/tea/ITeaObjectiveService.java new file mode 100644 index 0000000..cd065a3 --- /dev/null +++ b/src/main/java/com/sztzjy/financial_bigdata/service/tea/ITeaObjectiveService.java @@ -0,0 +1,7 @@ +package com.sztzjy.financial_bigdata.service.tea; + +import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion; + +public interface ITeaObjectiveService { + Boolean insertObjective(SysObjectiveQuestion objectiveQuestion); +} diff --git a/src/main/java/com/sztzjy/financial_bigdata/service/tea/ITeaResourceCenterService.java b/src/main/java/com/sztzjy/financial_bigdata/service/tea/ITeaResourceCenterService.java index 316ee5c..200aea8 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/service/tea/ITeaResourceCenterService.java +++ b/src/main/java/com/sztzjy/financial_bigdata/service/tea/ITeaResourceCenterService.java @@ -7,7 +7,7 @@ import javax.servlet.http.HttpServletResponse; import java.util.List; public interface ITeaResourceCenterService { - Boolean uploadResource(MultipartFile file, String schoolId,String chapterId); + Boolean uploadResource(MultipartFile file, String schoolId,String chapterId,String type); List selectResource(String schoolId, String chapterId); void downloadResource(String resourceId, HttpServletResponse response); diff --git a/src/main/java/com/sztzjy/financial_bigdata/service/tea/impl/TeaObjectiveServiceImpl.java b/src/main/java/com/sztzjy/financial_bigdata/service/tea/impl/TeaObjectiveServiceImpl.java new file mode 100644 index 0000000..0e17b7f --- /dev/null +++ b/src/main/java/com/sztzjy/financial_bigdata/service/tea/impl/TeaObjectiveServiceImpl.java @@ -0,0 +1,31 @@ +package com.sztzjy.financial_bigdata.service.tea.impl; + +import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion; +import com.sztzjy.financial_bigdata.mapper.SysObjectiveQuestionMapper; +import com.sztzjy.financial_bigdata.service.tea.ITeaObjectiveService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.UUID; + +@Service +public class TeaObjectiveServiceImpl implements ITeaObjectiveService { + @Autowired + SysObjectiveQuestionMapper objectiveQuestionMapper; + @Override + public Boolean insertObjective(SysObjectiveQuestion objectiveQuestion) { + //数据库需要添加schoolid字段 + if("999999999".equals(objectiveQuestion.getSchoolId())){ + objectiveQuestion.setInputType("内置"); + }else { + objectiveQuestion.setInputType("新增"); + } + objectiveQuestion.setObjectiveId(String.valueOf(UUID.randomUUID())); + int insert = objectiveQuestionMapper.insert(objectiveQuestion); + if(insert!=0){ + return true; + }else { + return false; + } + } +} diff --git a/src/main/java/com/sztzjy/financial_bigdata/service/tea/impl/TeaResourceCenterServiceImpl.java b/src/main/java/com/sztzjy/financial_bigdata/service/tea/impl/TeaResourceCenterServiceImpl.java index 67a6cd1..8541f44 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/service/tea/impl/TeaResourceCenterServiceImpl.java +++ b/src/main/java/com/sztzjy/financial_bigdata/service/tea/impl/TeaResourceCenterServiceImpl.java @@ -20,7 +20,7 @@ public class TeaResourceCenterServiceImpl implements ITeaResourceCenterService { @Autowired TeaResourceCenterMapper resourceCenterMapper; @Override - public Boolean uploadResource(MultipartFile file, String schoolId,String chapterId) { + public Boolean uploadResource(MultipartFile file, String schoolId,String chapterId,String type) { String uploadUrl = fileUtil.upload(file); TeaResourceCenter resourceCenter=new TeaResourceCenter(); resourceCenter.setResourceId(String.valueOf(UUID.randomUUID())); @@ -28,6 +28,7 @@ public class TeaResourceCenterServiceImpl implements ITeaResourceCenterService { resourceCenter.setResourceUrl(uploadUrl); resourceCenter.setChapterId(chapterId); resourceCenter.setSchoolId(schoolId); + resourceCenter.setType(type); resourceCenter.setImageUrl(null); int insert = resourceCenterMapper.insert(resourceCenter); if(insert!=0){ @@ -52,7 +53,9 @@ public class TeaResourceCenterServiceImpl implements ITeaResourceCenterService { @Override public void downloadResource(String resourceId, HttpServletResponse response) { TeaResourceCenter resourceCenter = resourceCenterMapper.selectByPrimaryKey(resourceId); - fileUtil.download(response, resourceCenter.getResourceName(), resourceCenter.getResourceUrl()); + if("文件".equals(resourceCenter.getType())){ + fileUtil.download(response, resourceCenter.getResourceName(), resourceCenter.getResourceUrl()); + } } } diff --git a/src/main/resources/mapper/SysCaseQuestionBankMapper.xml b/src/main/resources/mapper/SysCaseQuestionMapper.xml similarity index 85% rename from src/main/resources/mapper/SysCaseQuestionBankMapper.xml rename to src/main/resources/mapper/SysCaseQuestionMapper.xml index b2343db..0dfefc6 100644 --- a/src/main/resources/mapper/SysCaseQuestionBankMapper.xml +++ b/src/main/resources/mapper/SysCaseQuestionMapper.xml @@ -1,7 +1,7 @@ - - + + @@ -14,8 +14,9 @@ - - + + + @@ -77,15 +78,15 @@ case_id, case_step_id, chapter_id, sort, title, content, question, answer, content_original, - question_original, answer_original, step_score, input_type, type + question_original, answer_original, step_score, input_type, type, school_id - select distinct - from sys_case_question_bank + from sys_case_question @@ -96,33 +97,35 @@ - delete from sys_case_question_bank + delete from sys_case_question where case_id = #{caseId,jdbcType=VARCHAR} - - delete from sys_case_question_bank + + delete from sys_case_question - - insert into sys_case_question_bank (case_id, case_step_id, chapter_id, + + insert into sys_case_question (case_id, case_step_id, chapter_id, sort, title, content, question, answer, content_original, question_original, answer_original, step_score, - input_type, type) + input_type, type, school_id + ) values (#{caseId,jdbcType=VARCHAR}, #{caseStepId,jdbcType=VARCHAR}, #{chapterId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{question,jdbcType=VARCHAR}, #{answer,jdbcType=VARCHAR}, #{contentOriginal,jdbcType=VARCHAR}, #{questionOriginal,jdbcType=VARCHAR}, #{answerOriginal,jdbcType=VARCHAR}, #{stepScore,jdbcType=DECIMAL}, - #{inputType,jdbcType=CHAR}, #{type,jdbcType=CHAR}) + #{inputType,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR} + ) - - insert into sys_case_question_bank + + insert into sys_case_question case_id, @@ -166,6 +169,9 @@ type, + + school_id, + @@ -205,21 +211,24 @@ #{stepScore,jdbcType=DECIMAL}, - #{inputType,jdbcType=CHAR}, + #{inputType,jdbcType=VARCHAR}, - #{type,jdbcType=CHAR}, + #{type,jdbcType=VARCHAR}, + + + #{schoolId,jdbcType=VARCHAR}, - + select count(*) from sys_case_question - update sys_case_question_bank + update sys_case_question case_id = #{record.caseId,jdbcType=VARCHAR}, @@ -258,10 +267,13 @@ step_score = #{record.stepScore,jdbcType=DECIMAL}, - input_type = #{record.inputType,jdbcType=CHAR}, + input_type = #{record.inputType,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=CHAR}, + type = #{record.type,jdbcType=VARCHAR}, + + + school_id = #{record.schoolId,jdbcType=VARCHAR}, @@ -269,7 +281,7 @@ - update sys_case_question_bank + update sys_case_question set case_id = #{record.caseId,jdbcType=VARCHAR}, case_step_id = #{record.caseStepId,jdbcType=VARCHAR}, chapter_id = #{record.chapterId,jdbcType=VARCHAR}, @@ -282,14 +294,15 @@ question_original = #{record.questionOriginal,jdbcType=VARCHAR}, answer_original = #{record.answerOriginal,jdbcType=VARCHAR}, step_score = #{record.stepScore,jdbcType=DECIMAL}, - input_type = #{record.inputType,jdbcType=CHAR}, - type = #{record.type,jdbcType=CHAR} + input_type = #{record.inputType,jdbcType=VARCHAR}, + type = #{record.type,jdbcType=VARCHAR}, + school_id = #{record.schoolId,jdbcType=VARCHAR} - - update sys_case_question_bank + + update sys_case_question case_step_id = #{caseStepId,jdbcType=VARCHAR}, @@ -325,16 +338,19 @@ step_score = #{stepScore,jdbcType=DECIMAL}, - input_type = #{inputType,jdbcType=CHAR}, + input_type = #{inputType,jdbcType=VARCHAR}, - type = #{type,jdbcType=CHAR}, + type = #{type,jdbcType=VARCHAR}, + + + school_id = #{schoolId,jdbcType=VARCHAR}, where case_id = #{caseId,jdbcType=VARCHAR} - - update sys_case_question_bank + + update sys_case_question set case_step_id = #{caseStepId,jdbcType=VARCHAR}, chapter_id = #{chapterId,jdbcType=VARCHAR}, sort = #{sort,jdbcType=INTEGER}, @@ -346,8 +362,9 @@ question_original = #{questionOriginal,jdbcType=VARCHAR}, answer_original = #{answerOriginal,jdbcType=VARCHAR}, step_score = #{stepScore,jdbcType=DECIMAL}, - input_type = #{inputType,jdbcType=CHAR}, - type = #{type,jdbcType=CHAR} + input_type = #{inputType,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + school_id = #{schoolId,jdbcType=VARCHAR} where case_id = #{caseId,jdbcType=VARCHAR} \ No newline at end of file diff --git a/src/main/resources/mapper/SysObjectiveQuestionMapper.xml b/src/main/resources/mapper/SysObjectiveQuestionMapper.xml index f6442f4..f009666 100644 --- a/src/main/resources/mapper/SysObjectiveQuestionMapper.xml +++ b/src/main/resources/mapper/SysObjectiveQuestionMapper.xml @@ -7,19 +7,18 @@ - - + + + - - - - + + @@ -81,27 +80,9 @@ objective_id, course_id, course_name, chapter_id, chapter_name, input_type, type, - score, question_a, question_b, question_c, question_d, question_e, answer - - - content, analyze + score, content, question_a, question_b, question_c, question_d, question_e, answer, + analyze, school_id - - select - , - from sys_objective_question where objective_id = #{objectiveId,jdbcType=VARCHAR} @@ -134,21 +113,21 @@ - + insert into sys_objective_question (objective_id, course_id, course_name, chapter_id, chapter_name, input_type, - type, score, question_a, - question_b, question_c, question_d, - question_e, answer, content, - analyze) + type, score, content, + question_a, question_b, question_c, + question_d, question_e, answer, + analyze, school_id) values (#{objectiveId,jdbcType=VARCHAR}, #{courseId,jdbcType=VARCHAR}, #{courseName,jdbcType=VARCHAR}, - #{chapterId,jdbcType=VARCHAR}, #{chapterName,jdbcType=VARCHAR}, #{inputType,jdbcType=CHAR}, - #{type,jdbcType=CHAR}, #{score,jdbcType=DECIMAL}, #{questionA,jdbcType=VARCHAR}, - #{questionB,jdbcType=VARCHAR}, #{questionC,jdbcType=VARCHAR}, #{questionD,jdbcType=VARCHAR}, - #{questionE,jdbcType=VARCHAR}, #{answer,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR}, - #{analyze,jdbcType=LONGVARCHAR}) + #{chapterId,jdbcType=VARCHAR}, #{chapterName,jdbcType=VARCHAR}, #{inputType,jdbcType=VARCHAR}, + #{type,jdbcType=VARCHAR}, #{score,jdbcType=DECIMAL}, #{content,jdbcType=VARCHAR}, + #{questionA,jdbcType=VARCHAR}, #{questionB,jdbcType=VARCHAR}, #{questionC,jdbcType=VARCHAR}, + #{questionD,jdbcType=VARCHAR}, #{questionE,jdbcType=VARCHAR}, #{answer,jdbcType=VARCHAR}, + #{analyze,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR}) - + insert into sys_objective_question @@ -175,6 +154,9 @@ score, + + content, + question_a, @@ -193,12 +175,12 @@ answer, - - content, - analyze, + + school_id, + @@ -217,14 +199,17 @@ #{chapterName,jdbcType=VARCHAR}, - #{inputType,jdbcType=CHAR}, + #{inputType,jdbcType=VARCHAR}, - #{type,jdbcType=CHAR}, + #{type,jdbcType=VARCHAR}, #{score,jdbcType=DECIMAL}, + + #{content,jdbcType=VARCHAR}, + #{questionA,jdbcType=VARCHAR}, @@ -243,11 +228,11 @@ #{answer,jdbcType=VARCHAR}, - - #{content,jdbcType=LONGVARCHAR}, - - #{analyze,jdbcType=LONGVARCHAR}, + #{analyze,jdbcType=VARCHAR}, + + + #{schoolId,jdbcType=VARCHAR}, @@ -276,14 +261,17 @@ chapter_name = #{record.chapterName,jdbcType=VARCHAR}, - input_type = #{record.inputType,jdbcType=CHAR}, + input_type = #{record.inputType,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=CHAR}, + type = #{record.type,jdbcType=VARCHAR}, score = #{record.score,jdbcType=DECIMAL}, + + content = #{record.content,jdbcType=VARCHAR}, + question_a = #{record.questionA,jdbcType=VARCHAR}, @@ -302,39 +290,17 @@ answer = #{record.answer,jdbcType=VARCHAR}, - - content = #{record.content,jdbcType=LONGVARCHAR}, - - analyze = #{record.analyze,jdbcType=LONGVARCHAR}, + analyze = #{record.analyze,jdbcType=VARCHAR}, + + + school_id = #{record.schoolId,jdbcType=VARCHAR}, - - update sys_objective_question - set objective_id = #{record.objectiveId,jdbcType=VARCHAR}, - course_id = #{record.courseId,jdbcType=VARCHAR}, - course_name = #{record.courseName,jdbcType=VARCHAR}, - chapter_id = #{record.chapterId,jdbcType=VARCHAR}, - chapter_name = #{record.chapterName,jdbcType=VARCHAR}, - input_type = #{record.inputType,jdbcType=CHAR}, - type = #{record.type,jdbcType=CHAR}, - score = #{record.score,jdbcType=DECIMAL}, - question_a = #{record.questionA,jdbcType=VARCHAR}, - question_b = #{record.questionB,jdbcType=VARCHAR}, - question_c = #{record.questionC,jdbcType=VARCHAR}, - question_d = #{record.questionD,jdbcType=VARCHAR}, - question_e = #{record.questionE,jdbcType=VARCHAR}, - answer = #{record.answer,jdbcType=VARCHAR}, - content = #{record.content,jdbcType=LONGVARCHAR}, - analyze = #{record.analyze,jdbcType=LONGVARCHAR} - - - - update sys_objective_question set objective_id = #{record.objectiveId,jdbcType=VARCHAR}, @@ -342,20 +308,23 @@ course_name = #{record.courseName,jdbcType=VARCHAR}, chapter_id = #{record.chapterId,jdbcType=VARCHAR}, chapter_name = #{record.chapterName,jdbcType=VARCHAR}, - input_type = #{record.inputType,jdbcType=CHAR}, - type = #{record.type,jdbcType=CHAR}, + input_type = #{record.inputType,jdbcType=VARCHAR}, + type = #{record.type,jdbcType=VARCHAR}, score = #{record.score,jdbcType=DECIMAL}, + content = #{record.content,jdbcType=VARCHAR}, question_a = #{record.questionA,jdbcType=VARCHAR}, question_b = #{record.questionB,jdbcType=VARCHAR}, question_c = #{record.questionC,jdbcType=VARCHAR}, question_d = #{record.questionD,jdbcType=VARCHAR}, question_e = #{record.questionE,jdbcType=VARCHAR}, - answer = #{record.answer,jdbcType=VARCHAR} + answer = #{record.answer,jdbcType=VARCHAR}, + analyze = #{record.analyze,jdbcType=VARCHAR}, + school_id = #{record.schoolId,jdbcType=VARCHAR} - + update sys_objective_question @@ -371,14 +340,17 @@ chapter_name = #{chapterName,jdbcType=VARCHAR}, - input_type = #{inputType,jdbcType=CHAR}, + input_type = #{inputType,jdbcType=VARCHAR}, - type = #{type,jdbcType=CHAR}, + type = #{type,jdbcType=VARCHAR}, score = #{score,jdbcType=DECIMAL}, + + content = #{content,jdbcType=VARCHAR}, + question_a = #{questionA,jdbcType=VARCHAR}, @@ -397,49 +369,33 @@ answer = #{answer,jdbcType=VARCHAR}, - - content = #{content,jdbcType=LONGVARCHAR}, - - analyze = #{analyze,jdbcType=LONGVARCHAR}, + analyze = #{analyze,jdbcType=VARCHAR}, + + + school_id = #{schoolId,jdbcType=VARCHAR}, where objective_id = #{objectiveId,jdbcType=VARCHAR} - - update sys_objective_question - set course_id = #{courseId,jdbcType=VARCHAR}, - course_name = #{courseName,jdbcType=VARCHAR}, - chapter_id = #{chapterId,jdbcType=VARCHAR}, - chapter_name = #{chapterName,jdbcType=VARCHAR}, - input_type = #{inputType,jdbcType=CHAR}, - type = #{type,jdbcType=CHAR}, - score = #{score,jdbcType=DECIMAL}, - question_a = #{questionA,jdbcType=VARCHAR}, - question_b = #{questionB,jdbcType=VARCHAR}, - question_c = #{questionC,jdbcType=VARCHAR}, - question_d = #{questionD,jdbcType=VARCHAR}, - question_e = #{questionE,jdbcType=VARCHAR}, - answer = #{answer,jdbcType=VARCHAR}, - content = #{content,jdbcType=LONGVARCHAR}, - analyze = #{analyze,jdbcType=LONGVARCHAR} - where objective_id = #{objectiveId,jdbcType=VARCHAR} - update sys_objective_question set course_id = #{courseId,jdbcType=VARCHAR}, course_name = #{courseName,jdbcType=VARCHAR}, chapter_id = #{chapterId,jdbcType=VARCHAR}, chapter_name = #{chapterName,jdbcType=VARCHAR}, - input_type = #{inputType,jdbcType=CHAR}, - type = #{type,jdbcType=CHAR}, + input_type = #{inputType,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, score = #{score,jdbcType=DECIMAL}, + content = #{content,jdbcType=VARCHAR}, question_a = #{questionA,jdbcType=VARCHAR}, question_b = #{questionB,jdbcType=VARCHAR}, question_c = #{questionC,jdbcType=VARCHAR}, question_d = #{questionD,jdbcType=VARCHAR}, question_e = #{questionE,jdbcType=VARCHAR}, - answer = #{answer,jdbcType=VARCHAR} + answer = #{answer,jdbcType=VARCHAR}, + analyze = #{analyze,jdbcType=VARCHAR}, + school_id = #{schoolId,jdbcType=VARCHAR} where objective_id = #{objectiveId,jdbcType=VARCHAR} \ No newline at end of file diff --git a/src/main/resources/mapper/TeaResourceCenterMapper.xml b/src/main/resources/mapper/TeaResourceCenterMapper.xml index f8e234c..146a3fa 100644 --- a/src/main/resources/mapper/TeaResourceCenterMapper.xml +++ b/src/main/resources/mapper/TeaResourceCenterMapper.xml @@ -8,6 +8,7 @@ + @@ -68,7 +69,7 @@ - resource_id, chapter_id, resource_url, image_url, resource_name, school_id + resource_id, chapter_id, resource_url, image_url, resource_name, school_id, type @@ -178,6 +185,9 @@ school_id = #{record.schoolId,jdbcType=VARCHAR}, + + type = #{record.type,jdbcType=VARCHAR}, + @@ -190,7 +200,8 @@ resource_url = #{record.resourceUrl,jdbcType=VARCHAR}, image_url = #{record.imageUrl,jdbcType=VARCHAR}, resource_name = #{record.resourceName,jdbcType=VARCHAR}, - school_id = #{record.schoolId,jdbcType=VARCHAR} + school_id = #{record.schoolId,jdbcType=VARCHAR}, + type = #{record.type,jdbcType=VARCHAR} @@ -213,6 +224,9 @@ school_id = #{schoolId,jdbcType=VARCHAR}, + + type = #{type,jdbcType=VARCHAR}, + where resource_id = #{resourceId,jdbcType=VARCHAR} @@ -222,7 +236,8 @@ resource_url = #{resourceUrl,jdbcType=VARCHAR}, image_url = #{imageUrl,jdbcType=VARCHAR}, resource_name = #{resourceName,jdbcType=VARCHAR}, - school_id = #{schoolId,jdbcType=VARCHAR} + school_id = #{schoolId,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR} where resource_id = #{resourceId,jdbcType=VARCHAR} \ No newline at end of file