新增资源中心部分功能

newBigdata
yz 1 year ago
parent 2a558ffa78
commit 74e7c87540

@ -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 {
}

@ -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,"客观题新增失败");
}
}
//客观题批量导入
//客观题删除
//客观题列表查看
//客观题单个详情查看
}

@ -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<List<TeaResourceCenter>> uploadResourceCenter(@ApiParam("学校id") @RequestParam(required = false) String schoolId,
@ApiParam("章节Id") @RequestParam String chapterId){
List<TeaResourceCenter> list=resourceCenterService.selectResource(schoolId,chapterId);
@ApiParam("章节Id") @RequestParam String chapterId) {
List<TeaResourceCenter> 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<FileSystemResource> streamVideo(@RequestParam String module, @RequestParam String name, HttpServletResponse response) {
return null;
//
//
// StuResourcesExample example = new StuResourcesExample();
// example.createCriteria().andModuleEqualTo(module).andResourcesNameEqualTo(name);
// List<StuResources> 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<FileSystemResource> 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();
}
}

@ -7,7 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
*
*
* @author xcj
* stu_user
* stu_userinfo
*/
public class StuUser {
@ApiModelProperty("用户ID")

@ -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();
}
}

@ -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<Criteria> 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<String> values) {
addCriterion("school_id in", values, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolIdNotIn(List<String> 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 {

@ -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();
}
}

@ -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<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 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<String> values) {
addCriterion("analyze in", values, "analyze");
return (Criteria) this;
}
public Criteria andAnalyzeNotIn(List<String> 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<String> values) {
addCriterion("school_id in", values, "schoolId");
return (Criteria) this;
}
public Criteria andSchoolIdNotIn(List<String> 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 {

@ -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();
}
}

@ -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<String> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<String> 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 {

@ -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<StuUser> 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);
}

@ -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<SysCaseQuestionBank> 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);
}

@ -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<SysCaseQuestion> 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);
}

@ -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<SysObjectiveQuestionWithBLOBs> selectByExampleWithBLOBs(SysObjectiveQuestionExample example);
int insertSelective(SysObjectiveQuestion record);
List<SysObjectiveQuestion> 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);
}

@ -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);
}

@ -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<TeaResourceCenter> selectResource(String schoolId, String chapterId);
void downloadResource(String resourceId, HttpServletResponse response);

@ -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;
}
}
}

@ -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());
}
}
}

@ -1,7 +1,7 @@
<?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.SysCaseQuestionBankMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.SysCaseQuestionBank">
<mapper namespace="com.sztzjy.financial_bigdata.mapper.SysCaseQuestionMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.SysCaseQuestion">
<id column="case_id" jdbcType="VARCHAR" property="caseId" />
<result column="case_step_id" jdbcType="VARCHAR" property="caseStepId" />
<result column="chapter_id" jdbcType="VARCHAR" property="chapterId" />
@ -14,8 +14,9 @@
<result column="question_original" jdbcType="VARCHAR" property="questionOriginal" />
<result column="answer_original" jdbcType="VARCHAR" property="answerOriginal" />
<result column="step_score" jdbcType="DECIMAL" property="stepScore" />
<result column="input_type" jdbcType="CHAR" property="inputType" />
<result column="type" jdbcType="CHAR" property="type" />
<result column="input_type" jdbcType="VARCHAR" property="inputType" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="school_id" jdbcType="VARCHAR" property="schoolId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -77,15 +78,15 @@
</sql>
<sql id="Base_Column_List">
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
</sql>
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionBankExample" resultMap="BaseResultMap">
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_case_question_bank
from sys_case_question
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@ -96,33 +97,35 @@
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_case_question_bank
from sys_case_question
where case_id = #{caseId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from sys_case_question_bank
delete from sys_case_question
where case_id = #{caseId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionBankExample">
delete from sys_case_question_bank
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionExample">
delete from sys_case_question
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionBank">
insert into sys_case_question_bank (case_id, case_step_id, chapter_id,
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestion">
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>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionBank">
insert into sys_case_question_bank
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestion">
insert into sys_case_question
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="caseId != null">
case_id,
@ -166,6 +169,9 @@
<if test="type != null">
type,
</if>
<if test="schoolId != null">
school_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="caseId != null">
@ -205,21 +211,24 @@
#{stepScore,jdbcType=DECIMAL},
</if>
<if test="inputType != null">
#{inputType,jdbcType=CHAR},
#{inputType,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=CHAR},
#{type,jdbcType=VARCHAR},
</if>
<if test="schoolId != null">
#{schoolId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionBankExample" resultType="java.lang.Long">
select count(*) from sys_case_question_bank
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionExample" resultType="java.lang.Long">
select count(*) from sys_case_question
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_case_question_bank
update sys_case_question
<set>
<if test="record.caseId != null">
case_id = #{record.caseId,jdbcType=VARCHAR},
@ -258,10 +267,13 @@
step_score = #{record.stepScore,jdbcType=DECIMAL},
</if>
<if test="record.inputType != null">
input_type = #{record.inputType,jdbcType=CHAR},
input_type = #{record.inputType,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=CHAR},
type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.schoolId != null">
school_id = #{record.schoolId,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
@ -269,7 +281,7 @@
</if>
</update>
<update id="updateByExample" parameterType="map">
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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionBank">
update sys_case_question_bank
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestion">
update sys_case_question
<set>
<if test="caseStepId != null">
case_step_id = #{caseStepId,jdbcType=VARCHAR},
@ -325,16 +338,19 @@
step_score = #{stepScore,jdbcType=DECIMAL},
</if>
<if test="inputType != null">
input_type = #{inputType,jdbcType=CHAR},
input_type = #{inputType,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=CHAR},
type = #{type,jdbcType=VARCHAR},
</if>
<if test="schoolId != null">
school_id = #{schoolId,jdbcType=VARCHAR},
</if>
</set>
where case_id = #{caseId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestionBank">
update sys_case_question_bank
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.SysCaseQuestion">
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}
</update>
</mapper>

@ -7,19 +7,18 @@
<result column="course_name" jdbcType="VARCHAR" property="courseName" />
<result column="chapter_id" jdbcType="VARCHAR" property="chapterId" />
<result column="chapter_name" jdbcType="VARCHAR" property="chapterName" />
<result column="input_type" jdbcType="CHAR" property="inputType" />
<result column="type" jdbcType="CHAR" property="type" />
<result column="input_type" jdbcType="VARCHAR" property="inputType" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="score" jdbcType="DECIMAL" property="score" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="question_a" jdbcType="VARCHAR" property="questionA" />
<result column="question_b" jdbcType="VARCHAR" property="questionB" />
<result column="question_c" jdbcType="VARCHAR" property="questionC" />
<result column="question_d" jdbcType="VARCHAR" property="questionD" />
<result column="question_e" jdbcType="VARCHAR" property="questionE" />
<result column="answer" jdbcType="VARCHAR" property="answer" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionWithBLOBs">
<result column="content" jdbcType="LONGVARCHAR" property="content" />
<result column="analyze" jdbcType="LONGVARCHAR" property="analyze" />
<result column="analyze" jdbcType="VARCHAR" property="analyze" />
<result column="school_id" jdbcType="VARCHAR" property="schoolId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -81,27 +80,9 @@
</sql>
<sql id="Base_Column_List">
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
</sql>
<sql id="Blob_Column_List">
content, analyze
score, content, question_a, question_b, question_c, question_d, question_e, answer,
analyze, school_id
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from sys_objective_question
<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.SysObjectiveQuestionExample" resultMap="BaseResultMap">
select
<if test="distinct">
@ -116,11 +97,9 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from sys_objective_question
where objective_id = #{objectiveId,jdbcType=VARCHAR}
</select>
@ -134,21 +113,21 @@
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionWithBLOBs">
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion">
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>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionWithBLOBs">
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion">
insert into sys_objective_question
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objectiveId != null">
@ -175,6 +154,9 @@
<if test="score != null">
score,
</if>
<if test="content != null">
content,
</if>
<if test="questionA != null">
question_a,
</if>
@ -193,12 +175,12 @@
<if test="answer != null">
answer,
</if>
<if test="content != null">
content,
</if>
<if test="analyze != null">
analyze,
</if>
<if test="schoolId != null">
school_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objectiveId != null">
@ -217,14 +199,17 @@
#{chapterName,jdbcType=VARCHAR},
</if>
<if test="inputType != null">
#{inputType,jdbcType=CHAR},
#{inputType,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=CHAR},
#{type,jdbcType=VARCHAR},
</if>
<if test="score != null">
#{score,jdbcType=DECIMAL},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="questionA != null">
#{questionA,jdbcType=VARCHAR},
</if>
@ -243,11 +228,11 @@
<if test="answer != null">
#{answer,jdbcType=VARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
<if test="analyze != null">
#{analyze,jdbcType=LONGVARCHAR},
#{analyze,jdbcType=VARCHAR},
</if>
<if test="schoolId != null">
#{schoolId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
@ -276,14 +261,17 @@
chapter_name = #{record.chapterName,jdbcType=VARCHAR},
</if>
<if test="record.inputType != null">
input_type = #{record.inputType,jdbcType=CHAR},
input_type = #{record.inputType,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=CHAR},
type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.score != null">
score = #{record.score,jdbcType=DECIMAL},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
</if>
<if test="record.questionA != null">
question_a = #{record.questionA,jdbcType=VARCHAR},
</if>
@ -302,39 +290,17 @@
<if test="record.answer != null">
answer = #{record.answer,jdbcType=VARCHAR},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=LONGVARCHAR},
</if>
<if test="record.analyze != null">
analyze = #{record.analyze,jdbcType=LONGVARCHAR},
analyze = #{record.analyze,jdbcType=VARCHAR},
</if>
<if test="record.schoolId != null">
school_id = #{record.schoolId,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionWithBLOBs">
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion">
update sys_objective_question
<set>
<if test="courseId != null">
@ -371,14 +340,17 @@
chapter_name = #{chapterName,jdbcType=VARCHAR},
</if>
<if test="inputType != null">
input_type = #{inputType,jdbcType=CHAR},
input_type = #{inputType,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=CHAR},
type = #{type,jdbcType=VARCHAR},
</if>
<if test="score != null">
score = #{score,jdbcType=DECIMAL},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="questionA != null">
question_a = #{questionA,jdbcType=VARCHAR},
</if>
@ -397,49 +369,33 @@
<if test="answer != null">
answer = #{answer,jdbcType=VARCHAR},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
</if>
<if test="analyze != null">
analyze = #{analyze,jdbcType=LONGVARCHAR},
analyze = #{analyze,jdbcType=VARCHAR},
</if>
<if test="schoolId != null">
school_id = #{schoolId,jdbcType=VARCHAR},
</if>
</set>
where objective_id = #{objectiveId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionWithBLOBs">
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>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion">
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}
</update>
</mapper>

@ -8,6 +8,7 @@
<result column="image_url" jdbcType="VARCHAR" property="imageUrl" />
<result column="resource_name" jdbcType="VARCHAR" property="resourceName" />
<result column="school_id" jdbcType="VARCHAR" property="schoolId" />
<result column="type" jdbcType="VARCHAR" property="type" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -68,7 +69,7 @@
</where>
</sql>
<sql id="Base_Column_List">
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
</sql>
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.TeaResourceCenterExample" resultMap="BaseResultMap">
select
@ -102,11 +103,11 @@
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.TeaResourceCenter">
insert into tea_resource_center (resource_id, chapter_id, resource_url,
image_url, resource_name, school_id
)
image_url, resource_name, school_id,
type)
values (#{resourceId,jdbcType=VARCHAR}, #{chapterId,jdbcType=VARCHAR}, #{resourceUrl,jdbcType=VARCHAR},
#{imageUrl,jdbcType=VARCHAR}, #{resourceName,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR}
)
#{imageUrl,jdbcType=VARCHAR}, #{resourceName,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR},
#{type,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.TeaResourceCenter">
insert into tea_resource_center
@ -129,6 +130,9 @@
<if test="schoolId != null">
school_id,
</if>
<if test="type != null">
type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="resourceId != null">
@ -149,6 +153,9 @@
<if test="schoolId != null">
#{schoolId,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.TeaResourceCenterExample" resultType="java.lang.Long">
@ -178,6 +185,9 @@
<if test="record.schoolId != null">
school_id = #{record.schoolId,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -213,6 +224,9 @@
<if test="schoolId != null">
school_id = #{schoolId,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
</set>
where resource_id = #{resourceId,jdbcType=VARCHAR}
</update>
@ -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}
</update>
</mapper>
Loading…
Cancel
Save