From 6b84bd6f2031ffb9247844a103d875a8ab2a68ee Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Mon, 8 Jul 2024 11:50:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=9E=E8=AE=AD=E6=BC=94?= =?UTF-8?q?=E7=BB=83=E9=A1=B5=E9=9D=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 80 +- .../stu/ExerciseExperimentalTraining.java | 125 ++- .../controller/tea/UserController.java | 29 +- .../financial_bigdata/entity/StuUser.java | 21 + .../entity/sys_dto/SysCourseDto.java | 4 + .../mapper/StuTrainingMapper.java | 5 + .../mapper/SysCourseChapterMapper.java | 4 + .../resources/mapper/StuTrainingMapper.xml | 975 +++++++++--------- .../mapper/SysCourseChapterMapper.xml | 19 + src/main/resources/mapper/SysCourseMapper.xml | 6 +- 10 files changed, 720 insertions(+), 548 deletions(-) diff --git a/.gitignore b/.gitignore index 1094bc2..2371a3b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,34 +1,58 @@ -HELP.md +# ignore these folders target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/**/target/ -!**/src/test/**/target/ - -### STS ### -.apt_generated +.idea/ +.settings/ +.vscode/ +bin/ +out/ + +# ignore these files .classpath -.factorypath .project .settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### .idea -*.iws + +# filter databfile、sln file +*.mdb +*.ldb +*.sln + +# class file +*.com +*.class +*.dll +*.exe +*.o +*.so + +# compression file +*.7z +*.dmg +*.gz +*.iso +*.jar +*.rar +*.tar +*.zip +*.via +*.tmp +*.err +*.log *.iml -*.ipr -.log -.jar -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ -!**/src/main/**/build/ -!**/src/test/**/build/ - -### VS Code ### -.vscode/ + +# OS generated files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +Icon? +ehthumbs.db +Thumbs.db +.factorypath +.mvn/ +mvnw.cmd +mvnw + +# Files or folders need to be retained +# ... \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/controller/stu/ExerciseExperimentalTraining.java b/src/main/java/com/sztzjy/financial_bigdata/controller/stu/ExerciseExperimentalTraining.java index 61a4cd9..a6858c7 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/controller/stu/ExerciseExperimentalTraining.java +++ b/src/main/java/com/sztzjy/financial_bigdata/controller/stu/ExerciseExperimentalTraining.java @@ -19,8 +19,8 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; //实训演练-实训案例-实验实训 @RestController @@ -97,70 +97,115 @@ public class ExerciseExperimentalTraining { } } - @AnonymousAccess - @ApiOperation("实训演练页面查询") - @PostMapping("getCourseChapter") - public ResultEntity<List<SysCourseDto>> getIndexTheoryTest(@RequestParam String userId) { - List<SysCourse> sysCourseList = sysCourseMapper.getBySchoolId(); - List<SysCourseDto> dtoList = new ArrayList<>(); - for (SysCourse sysCourse : sysCourseList) { - SysCourseDto newDto = new SysCourseDto(); - BeanUtils.copyProperties(sysCourse, newDto); - String courseId = newDto.getCourseId(); - SysCourseChapterExample courseChapterExample = new SysCourseChapterExample(); - courseChapterExample.createCriteria().andCourseIdEqualTo(courseId); - courseChapterExample.setOrderByClause("sequence ASC"); - List<SysCourseChapter> sysCourseChapters = sysCourseChapterMapper.selectByExample(courseChapterExample); - List<SysCourseChapterDto> CourseChapterDtoList = new ArrayList<>(); - - for (SysCourseChapter sysCourseChapter : sysCourseChapters) { - SysCourseChapterDto sysCourseChapterDto = new SysCourseChapterDto(); - BeanUtils.copyProperties(sysCourseChapter, sysCourseChapterDto); - BigDecimal progress = stuTrainingMapper.getByUserIdAndChapterId(userId, sysCourseChapter.getChapterId()); - sysCourseChapterDto.setSchedule(progress); - CourseChapterDtoList.add(sysCourseChapterDto); - } - newDto.setSysCourseChapterDtos(CourseChapterDtoList); - dtoList.add(newDto); - } - return new ResultEntity<List<SysCourseDto>>(dtoList); - } - -// // @AnonymousAccess // @ApiOperation("实训演练页面查询") // @PostMapping("getCourseChapter") // public ResultEntity<List<SysCourseDto>> getIndexTheoryTest(@RequestParam String userId) { // List<SysCourse> sysCourseList = sysCourseMapper.getBySchoolId(); // List<SysCourseDto> dtoList = new ArrayList<>(); +// Map<String, SysCourseDto> map = new HashMap<>(); // for (SysCourse sysCourse : sysCourseList) { // SysCourseDto newDto = new SysCourseDto(); // BeanUtils.copyProperties(sysCourse, newDto); // String courseId = newDto.getCourseId(); +// map.put(courseId,newDto); // SysCourseChapterExample courseChapterExample = new SysCourseChapterExample(); // courseChapterExample.createCriteria().andCourseIdEqualTo(courseId); // courseChapterExample.setOrderByClause("sequence ASC"); // List<SysCourseChapter> sysCourseChapters = sysCourseChapterMapper.selectByExample(courseChapterExample); // List<SysCourseChapterDto> CourseChapterDtoList = new ArrayList<>(); +// +// List<String> chapterIds = new ArrayList<>(); // for (SysCourseChapter sysCourseChapter : sysCourseChapters) { -//// stuTrainingMapper.getByUserIdAndChaptetId() // SysCourseChapterDto sysCourseChapterDto = new SysCourseChapterDto(); // BeanUtils.copyProperties(sysCourseChapter, sysCourseChapterDto); -// StuTrainingExample example = new StuTrainingExample(); -// example.createCriteria().andUserIdEqualTo(userId).andChapterIdEqualTo(sysCourseChapter.getChapterId()); -// List<StuTrainingWithBLOBs> list = stuTrainingMapper.selectByExampleWithBLOBs(example); -// if (!list.isEmpty()) { -// StuTrainingWithBLOBs stuTrainingWithBLOBs = list.get(0); -// sysCourseChapterDto.setSchedule(stuTrainingWithBLOBs.getProgress()); -// } +// String chapterId = sysCourseChapter.getChapterId(); +// BigDecimal progress = stuTrainingMapper.getByUserIdAndChapterId(userId, chapterId); +// sysCourseChapterDto.setSchedule(progress); // CourseChapterDtoList.add(sysCourseChapterDto); +// chapterIds.add(chapterId); // } +// SysCaseQuestionExample example = new SysCaseQuestionExample(); +// example.createCriteria().andChapterIdIn(chapterIds); +// List<SysCaseQuestion> list = caseQuestionMapper.selectByExample(example); +// List<String> caseIds = list.stream().map(SysCaseQuestion::getCaseId).collect(Collectors.toList()); +// SysCaseQuestionStepExample sysCaseQuestionStepExample = new SysCaseQuestionStepExample(); +// sysCaseQuestionStepExample.createCriteria().andCaseIdIn(caseIds); +// List<SysCaseQuestionStep> sysCaseQuestionSteps = caseQuestionStepMapper.selectByExample(sysCaseQuestionStepExample); +// Map<String,String> collect = sysCaseQuestionSteps.stream().collect(Collectors.toMap(SysCaseQuestionStep::getCaseStepId,SysCaseQuestionStep::getTitle)); +// newDto.setTitleAndId(collect); // newDto.setSysCourseChapterDtos(CourseChapterDtoList); // dtoList.add(newDto); // } // return new ResultEntity<List<SysCourseDto>>(dtoList); // } +// + + + @AnonymousAccess + @ApiOperation("实训演练页面查询") + @PostMapping("getCourseChapter") + public ResultEntity<List<SysCourseDto>> getIndexTheoryTest(@RequestParam String userId) { + List<SysCourse> sysCourseList = sysCourseMapper.getBySchoolId(); + List<SysCourseDto> dtoList = new ArrayList<>(); + + List<String> courseIds = sysCourseList.stream() + .map(SysCourse::getCourseId) + .collect(Collectors.toList()); + + + List<SysCourseChapter> sysCourseChapters = sysCourseChapterMapper.getChaptersByCourseIds(courseIds); + List<String> courseChapterIds = sysCourseChapters.stream().map(SysCourseChapter::getChapterId).collect(Collectors.toList()); + + Map<String, List<String>> idMap = new HashMap<>(); + for (SysCourse sysCourse : sysCourseList) { + String courseId = sysCourse.getCourseId(); + List<String> chapterIds = sysCourseChapters.stream() + .filter(chapter -> chapter.getCourseId().equals(courseId)) + .map(SysCourseChapter::getChapterId) + .collect(Collectors.toList()); + idMap.put(courseId, chapterIds); + } + //为循环提供数据 + List<StuTraining> progressByChapterIds = stuTrainingMapper.getByUserIdAndChapterIds(userId, courseChapterIds); //循环外先查出所有进度 + Map<String, BigDecimal> progressMap = progressByChapterIds.stream() + .collect(Collectors.toMap(StuTraining::getChapterId, + stuTraining -> Optional.ofNullable(stuTraining.getProgress()).orElse(BigDecimal.ZERO), + (p1, p2) -> p1)); // 默认值为 BigDecimal.ZERO //进度为空则给0 + + //一层一层查出 课程,章节,章节下案例题 + for (SysCourse sysCourse : sysCourseList) { + SysCourseDto newDto = new SysCourseDto(); + BeanUtils.copyProperties(sysCourse, newDto); + String courseId = newDto.getCourseId(); + List<SysCourseChapterDto> CourseChapterDtoList = new ArrayList<>(); + for (SysCourseChapter sysCourseChapter : sysCourseChapters) { + SysCourseChapterDto sysCourseChapterDto = new SysCourseChapterDto(); + BeanUtils.copyProperties(sysCourseChapter, sysCourseChapterDto); + String chapterId = sysCourseChapter.getChapterId(); + BigDecimal progress = progressMap.get(chapterId); + sysCourseChapterDto.setSchedule(progress); + CourseChapterDtoList.add(sysCourseChapterDto); + } + //查询案例题 + List<String> list1 = idMap.get(courseId); //取出章节ID + SysCaseQuestionExample example = new SysCaseQuestionExample(); + example.createCriteria().andChapterIdIn(list1); + List<SysCaseQuestion> list = caseQuestionMapper.selectByExample(example); + List<String> caseIds = list.stream().map(SysCaseQuestion::getCaseId).collect(Collectors.toList()); + SysCaseQuestionStepExample sysCaseQuestionStepExample = new SysCaseQuestionStepExample(); + sysCaseQuestionStepExample.createCriteria().andCaseIdIn(caseIds); + List<SysCaseQuestionStep> sysCaseQuestionSteps = caseQuestionStepMapper.selectByExample(sysCaseQuestionStepExample); + Map<String, String> collect = sysCaseQuestionSteps.stream().collect(Collectors.toMap(SysCaseQuestionStep::getCaseStepId, SysCaseQuestionStep::getTitle)); + newDto.setSysCourseChapterDtos(CourseChapterDtoList); + dtoList.add(newDto); + newDto.setTitleAndId(collect); + newDto.setSysCourseChapterDtos(CourseChapterDtoList); + dtoList.add(newDto); + } + return new ResultEntity<List<SysCourseDto>>(dtoList); + } //数据集下载 diff --git a/src/main/java/com/sztzjy/financial_bigdata/controller/tea/UserController.java b/src/main/java/com/sztzjy/financial_bigdata/controller/tea/UserController.java index db0ff85..773e507 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/controller/tea/UserController.java +++ b/src/main/java/com/sztzjy/financial_bigdata/controller/tea/UserController.java @@ -1,5 +1,5 @@ package com.sztzjy.financial_bigdata.controller.tea; - +import javax.swing.JOptionPane; import cn.hutool.core.util.IdUtil; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -22,7 +22,6 @@ import com.sztzjy.financial_bigdata.util.excel.FilePortUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; -import lombok.Synchronized; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -39,6 +38,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.time.LocalDateTime; import java.util.*; +import java.util.stream.Collectors; /** * @Author xcj @@ -66,6 +66,30 @@ public class UserController { private static String loginIp; +// public static void main(String[] args) { +// StuUser a = new StuUser(); +// a.setPhone("111"); +// a.setUserid("111"); +// StuUser a2 = new StuUser(); +// a2.setPhone("111"); +// a2.setUserid("111"); +// StuUser a3 = new StuUser(); +// a3.setPhone("222"); +// a3.setUserid("111"); +// List<StuUser> list = new ArrayList<>(); +// list.add(a); +// list.add(a2); +// list.add(a3); +// List<String> collect = list.stream().map(StuUser::getPhone).collect(Collectors.toList()); +// Map<String, String> collect1 = list.stream() +// .collect(Collectors.toMap(StuUser::getPhone, StuUser::getUserid,(w, ww) -> w)); +//// System.out.println(collect); +// System.out.println(collect1); + +// } + + + @PostMapping("/login") @ApiOperation("登录接口") @AnonymousAccess @@ -97,7 +121,6 @@ public class UserController { if (stuUsers.isEmpty()) { return new ResultEntity(HttpStatus.BAD_REQUEST, "密码错误"); } - StuUser user1 = stuUsers.get(0); // 保存用户的登录信息 Map<String, Object> map = new HashMap<>(); StuUser user = stuUsers.get(0); 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 8eead5b..b27fbf0 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/StuUser.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/StuUser.java @@ -16,6 +16,27 @@ public class StuUser { @ApiModelProperty("姓名") private String name; + @Override + public String toString() { + return "StuUser{" + + "userid='" + userid + '\'' + + ", name='" + name + '\'' + + ", studentId='" + studentId + '\'' + + ", classId='" + classId + '\'' + + ", username='" + username + '\'' + + ", password='" + password + '\'' + + ", phone='" + phone + '\'' + + ", email='" + email + '\'' + + ", major='" + major + '\'' + + ", roleId=" + roleId + + ", createTime=" + createTime + + ", schoolId='" + schoolId + '\'' + + ", schoolName='" + schoolName + '\'' + + ", status=" + status + + ", examStatus='" + examStatus + '\'' + + '}'; + } + @ApiModelProperty("学号") private String studentId; diff --git a/src/main/java/com/sztzjy/financial_bigdata/entity/sys_dto/SysCourseDto.java b/src/main/java/com/sztzjy/financial_bigdata/entity/sys_dto/SysCourseDto.java index 6f50b49..4bbc6ae 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/entity/sys_dto/SysCourseDto.java +++ b/src/main/java/com/sztzjy/financial_bigdata/entity/sys_dto/SysCourseDto.java @@ -6,6 +6,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.util.List; +import java.util.Map; /** * @Author xcj @@ -29,5 +30,8 @@ public class SysCourseDto { @ApiModelProperty("0为老师导入 1为内置") private String inputType; + @ApiModelProperty("案例题名称和步骤ID") + private Map<String,String> titleAndId; + private List<SysCourseChapterDto> sysCourseChapterDtos; } diff --git a/src/main/java/com/sztzjy/financial_bigdata/mapper/StuTrainingMapper.java b/src/main/java/com/sztzjy/financial_bigdata/mapper/StuTrainingMapper.java index fc80e12..4da7da8 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/mapper/StuTrainingMapper.java +++ b/src/main/java/com/sztzjy/financial_bigdata/mapper/StuTrainingMapper.java @@ -5,12 +5,15 @@ import com.sztzjy.financial_bigdata.entity.StuTrainingExample; import com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs; import java.math.BigDecimal; +import java.util.Arrays; import java.util.List; +import java.util.Map; import com.sztzjy.financial_bigdata.entity.tea_dto.TrainingDto; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; +import org.geolatte.geom.M; @Mapper public interface StuTrainingMapper { @@ -52,4 +55,6 @@ public interface StuTrainingMapper { @Select("SELECT progress FROM stu_training WHERE user_id = #{userId} AND chapter_id = #{chapterId}") BigDecimal getByUserIdAndChapterId(@Param("userId")String userId, @Param("chapterId")String chapterId); + + List<StuTraining> getByUserIdAndChapterIds(@Param("userId") String userId, @Param("chapterIds") List<String> chapterIds); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/financial_bigdata/mapper/SysCourseChapterMapper.java b/src/main/java/com/sztzjy/financial_bigdata/mapper/SysCourseChapterMapper.java index 7bcbd0f..5775061 100644 --- a/src/main/java/com/sztzjy/financial_bigdata/mapper/SysCourseChapterMapper.java +++ b/src/main/java/com/sztzjy/financial_bigdata/mapper/SysCourseChapterMapper.java @@ -38,4 +38,8 @@ public interface SysCourseChapterMapper { BigDecimal selectChapterBySchoolId(@Param("schoolId")String schoolId); List<SysCourseChapter> selectChapterDataBySchoolId(@Param("schoolId")String schoolId); + + List<SysCourseChapter> getChapters(@Param("courseId") String courseId); + + List<SysCourseChapter> getChaptersByCourseIds(@Param("courseIds")List<String> courseIds); } \ No newline at end of file diff --git a/src/main/resources/mapper/StuTrainingMapper.xml b/src/main/resources/mapper/StuTrainingMapper.xml index 4e624b9..5d225fd 100644 --- a/src/main/resources/mapper/StuTrainingMapper.xml +++ b/src/main/resources/mapper/StuTrainingMapper.xml @@ -1,500 +1,527 @@ <?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.StuTrainingMapper"> - <resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.StuTraining"> - <id column="training_id" jdbcType="VARCHAR" property="trainingId" /> - <result column="user_id" jdbcType="VARCHAR" property="userId" /> - <result column="chapter_id" jdbcType="VARCHAR" property="chapterId" /> - <result column="progress" jdbcType="DECIMAL" property="progress" /> - <result column="case_stu_score" jdbcType="DECIMAL" property="caseStuScore" /> - <result column="knowledge_summary_score" jdbcType="DECIMAL" property="knowledgeSummaryScore" /> - <result column="resource_learning_score" jdbcType="DECIMAL" property="resourceLearningScore" /> - <result column="learning_eval_score" jdbcType="DECIMAL" property="learningEvalScore" /> - <result column="exp_training_score" jdbcType="DECIMAL" property="expTrainingScore" /> - <result column="knowledge_summary_complete_status" jdbcType="INTEGER" property="knowledgeSummaryCompleteStatus" /> - <result column="resource_learning_complete_status" jdbcType="INTEGER" property="resourceLearningCompleteStatus" /> - <result column="learning_eval_complete_status" jdbcType="INTEGER" property="learningEvalCompleteStatus" /> - <result column="exp_training_complete_status" jdbcType="INTEGER" property="expTrainingCompleteStatus" /> - <result column="report_id" jdbcType="VARCHAR" property="reportId" /> - </resultMap> - <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs"> - <result column="learning_eval_idList" jdbcType="LONGVARCHAR" property="learningEvalIdlist" /> - <result column="learning_eval_answer" jdbcType="LONGVARCHAR" property="learningEvalAnswer" /> - <result column="case_stu_answer" jdbcType="LONGVARCHAR" property="caseStuAnswer" /> - <result column="knowledge_note" jdbcType="LONGVARCHAR" property="knowledgeNote" /> - </resultMap> - <sql id="Example_Where_Clause"> - <where> - <foreach collection="oredCriteria" item="criteria" separator="or"> - <if test="criteria.valid"> - <trim prefix="(" prefixOverrides="and" suffix=")"> - <foreach collection="criteria.criteria" item="criterion"> - <choose> - <when test="criterion.noValue"> - and ${criterion.condition} - </when> - <when test="criterion.singleValue"> - and ${criterion.condition} #{criterion.value} - </when> - <when test="criterion.betweenValue"> - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - </when> - <when test="criterion.listValue"> - and ${criterion.condition} - <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> - #{listItem} - </foreach> - </when> - </choose> + <resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.StuTraining"> + <id column="training_id" jdbcType="VARCHAR" property="trainingId"/> + <result column="user_id" jdbcType="VARCHAR" property="userId"/> + <result column="chapter_id" jdbcType="VARCHAR" property="chapterId"/> + <result column="progress" jdbcType="DECIMAL" property="progress"/> + <result column="case_stu_score" jdbcType="DECIMAL" property="caseStuScore"/> + <result column="knowledge_summary_score" jdbcType="DECIMAL" property="knowledgeSummaryScore"/> + <result column="resource_learning_score" jdbcType="DECIMAL" property="resourceLearningScore"/> + <result column="learning_eval_score" jdbcType="DECIMAL" property="learningEvalScore"/> + <result column="exp_training_score" jdbcType="DECIMAL" property="expTrainingScore"/> + <result column="knowledge_summary_complete_status" jdbcType="INTEGER" + property="knowledgeSummaryCompleteStatus"/> + <result column="resource_learning_complete_status" jdbcType="INTEGER" + property="resourceLearningCompleteStatus"/> + <result column="learning_eval_complete_status" jdbcType="INTEGER" property="learningEvalCompleteStatus"/> + <result column="exp_training_complete_status" jdbcType="INTEGER" property="expTrainingCompleteStatus"/> + <result column="report_id" jdbcType="VARCHAR" property="reportId"/> + </resultMap> + <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" + type="com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs"> + <result column="learning_eval_idList" jdbcType="LONGVARCHAR" property="learningEvalIdlist"/> + <result column="learning_eval_answer" jdbcType="LONGVARCHAR" property="learningEvalAnswer"/> + <result column="case_stu_answer" jdbcType="LONGVARCHAR" property="caseStuAnswer"/> + <result column="knowledge_note" jdbcType="LONGVARCHAR" property="knowledgeNote"/> + </resultMap> + <sql id="Example_Where_Clause"> + <where> + <foreach collection="oredCriteria" item="criteria" separator="or"> + <if test="criteria.valid"> + <trim prefix="(" prefixOverrides="and" suffix=")"> + <foreach collection="criteria.criteria" item="criterion"> + <choose> + <when test="criterion.noValue"> + and ${criterion.condition} + </when> + <when test="criterion.singleValue"> + and ${criterion.condition} #{criterion.value} + </when> + <when test="criterion.betweenValue"> + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + </when> + <when test="criterion.listValue"> + and ${criterion.condition} + <foreach close=")" collection="criterion.value" item="listItem" open="(" + separator=","> + #{listItem} + </foreach> + </when> + </choose> + </foreach> + </trim> + </if> </foreach> - </trim> - </if> - </foreach> - </where> - </sql> - <sql id="Update_By_Example_Where_Clause"> - <where> - <foreach collection="example.oredCriteria" item="criteria" separator="or"> - <if test="criteria.valid"> - <trim prefix="(" prefixOverrides="and" suffix=")"> - <foreach collection="criteria.criteria" item="criterion"> - <choose> - <when test="criterion.noValue"> - and ${criterion.condition} - </when> - <when test="criterion.singleValue"> - and ${criterion.condition} #{criterion.value} - </when> - <when test="criterion.betweenValue"> - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - </when> - <when test="criterion.listValue"> - and ${criterion.condition} - <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> - #{listItem} - </foreach> - </when> - </choose> + </where> + </sql> + <sql id="Update_By_Example_Where_Clause"> + <where> + <foreach collection="example.oredCriteria" item="criteria" separator="or"> + <if test="criteria.valid"> + <trim prefix="(" prefixOverrides="and" suffix=")"> + <foreach collection="criteria.criteria" item="criterion"> + <choose> + <when test="criterion.noValue"> + and ${criterion.condition} + </when> + <when test="criterion.singleValue"> + and ${criterion.condition} #{criterion.value} + </when> + <when test="criterion.betweenValue"> + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + </when> + <when test="criterion.listValue"> + and ${criterion.condition} + <foreach close=")" collection="criterion.value" item="listItem" open="(" + separator=","> + #{listItem} + </foreach> + </when> + </choose> + </foreach> + </trim> + </if> </foreach> - </trim> - </if> - </foreach> - </where> - </sql> - <sql id="Base_Column_List"> - training_id, user_id, chapter_id, progress, case_stu_score, knowledge_summary_score, + </where> + </sql> + <sql id="Base_Column_List"> + training_id + , user_id, chapter_id, progress, case_stu_score, knowledge_summary_score, resource_learning_score, learning_eval_score, exp_training_score, knowledge_summary_complete_status, resource_learning_complete_status, learning_eval_complete_status, exp_training_complete_status, report_id - </sql> - <sql id="Blob_Column_List"> - learning_eval_idList, learning_eval_answer, case_stu_answer, knowledge_note - </sql> - <select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample" resultMap="ResultMapWithBLOBs"> - select - <if test="distinct"> - distinct - </if> - <include refid="Base_Column_List" /> - , - <include refid="Blob_Column_List" /> - from stu_training - <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.StuTrainingExample" resultMap="BaseResultMap"> - select - <if test="distinct"> - distinct - </if> - <include refid="Base_Column_List" /> - from stu_training - <if test="_parameter != null"> - <include refid="Example_Where_Clause" /> - </if> - <if test="orderByClause != null"> - order by ${orderByClause} - </if> - </select> - <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs"> - select - <include refid="Base_Column_List" /> - , - <include refid="Blob_Column_List" /> - from stu_training - where training_id = #{trainingId,jdbcType=VARCHAR} - </select> - <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> - delete from stu_training - where training_id = #{trainingId,jdbcType=VARCHAR} - </delete> - <delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample"> - delete from stu_training - <if test="_parameter != null"> - <include refid="Example_Where_Clause" /> - </if> - </delete> - <insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs"> - insert into stu_training (training_id, user_id, chapter_id, - progress, case_stu_score, knowledge_summary_score, - resource_learning_score, learning_eval_score, - exp_training_score, knowledge_summary_complete_status, - resource_learning_complete_status, learning_eval_complete_status, - exp_training_complete_status, report_id, learning_eval_idList, - learning_eval_answer, case_stu_answer, - knowledge_note) - values (#{trainingId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{chapterId,jdbcType=VARCHAR}, - #{progress,jdbcType=DECIMAL}, #{caseStuScore,jdbcType=DECIMAL}, #{knowledgeSummaryScore,jdbcType=DECIMAL}, - #{resourceLearningScore,jdbcType=DECIMAL}, #{learningEvalScore,jdbcType=DECIMAL}, - #{expTrainingScore,jdbcType=DECIMAL}, #{knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, - #{resourceLearningCompleteStatus,jdbcType=INTEGER}, #{learningEvalCompleteStatus,jdbcType=INTEGER}, - #{expTrainingCompleteStatus,jdbcType=INTEGER}, #{reportId,jdbcType=VARCHAR}, #{learningEvalIdlist,jdbcType=LONGVARCHAR}, - #{learningEvalAnswer,jdbcType=LONGVARCHAR}, #{caseStuAnswer,jdbcType=LONGVARCHAR}, - #{knowledgeNote,jdbcType=LONGVARCHAR}) - </insert> - <insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs"> - insert into stu_training - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="trainingId != null"> - training_id, - </if> - <if test="userId != null"> - user_id, - </if> - <if test="chapterId != null"> - chapter_id, - </if> - <if test="progress != null"> - progress, - </if> - <if test="caseStuScore != null"> - case_stu_score, - </if> - <if test="knowledgeSummaryScore != null"> - knowledge_summary_score, - </if> - <if test="resourceLearningScore != null"> - resource_learning_score, - </if> - <if test="learningEvalScore != null"> - learning_eval_score, - </if> - <if test="expTrainingScore != null"> - exp_training_score, - </if> - <if test="knowledgeSummaryCompleteStatus != null"> - knowledge_summary_complete_status, - </if> - <if test="resourceLearningCompleteStatus != null"> - resource_learning_complete_status, - </if> - <if test="learningEvalCompleteStatus != null"> - learning_eval_complete_status, - </if> - <if test="expTrainingCompleteStatus != null"> - exp_training_complete_status, - </if> - <if test="reportId != null"> - report_id, - </if> - <if test="learningEvalIdlist != null"> - learning_eval_idList, - </if> - <if test="learningEvalAnswer != null"> - learning_eval_answer, - </if> - <if test="caseStuAnswer != null"> - case_stu_answer, - </if> - <if test="knowledgeNote != null"> - knowledge_note, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="trainingId != null"> - #{trainingId,jdbcType=VARCHAR}, - </if> - <if test="userId != null"> - #{userId,jdbcType=VARCHAR}, - </if> - <if test="chapterId != null"> - #{chapterId,jdbcType=VARCHAR}, - </if> - <if test="progress != null"> - #{progress,jdbcType=DECIMAL}, - </if> - <if test="caseStuScore != null"> - #{caseStuScore,jdbcType=DECIMAL}, - </if> - <if test="knowledgeSummaryScore != null"> - #{knowledgeSummaryScore,jdbcType=DECIMAL}, - </if> - <if test="resourceLearningScore != null"> - #{resourceLearningScore,jdbcType=DECIMAL}, - </if> - <if test="learningEvalScore != null"> - #{learningEvalScore,jdbcType=DECIMAL}, - </if> - <if test="expTrainingScore != null"> - #{expTrainingScore,jdbcType=DECIMAL}, - </if> - <if test="knowledgeSummaryCompleteStatus != null"> - #{knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, - </if> - <if test="resourceLearningCompleteStatus != null"> - #{resourceLearningCompleteStatus,jdbcType=INTEGER}, - </if> - <if test="learningEvalCompleteStatus != null"> - #{learningEvalCompleteStatus,jdbcType=INTEGER}, - </if> - <if test="expTrainingCompleteStatus != null"> - #{expTrainingCompleteStatus,jdbcType=INTEGER}, - </if> - <if test="reportId != null"> - #{reportId,jdbcType=VARCHAR}, - </if> - <if test="learningEvalIdlist != null"> - #{learningEvalIdlist,jdbcType=LONGVARCHAR}, - </if> - <if test="learningEvalAnswer != null"> - #{learningEvalAnswer,jdbcType=LONGVARCHAR}, - </if> - <if test="caseStuAnswer != null"> - #{caseStuAnswer,jdbcType=LONGVARCHAR}, - </if> - <if test="knowledgeNote != null"> - #{knowledgeNote,jdbcType=LONGVARCHAR}, - </if> - </trim> - </insert> - <select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample" resultType="java.lang.Long"> - select count(*) from stu_training - <if test="_parameter != null"> - <include refid="Example_Where_Clause" /> - </if> - </select> - <update id="updateByExampleSelective" parameterType="map"> - update stu_training - <set> - <if test="record.trainingId != null"> - training_id = #{record.trainingId,jdbcType=VARCHAR}, - </if> - <if test="record.userId != null"> + </sql> + <sql id="Blob_Column_List"> + learning_eval_idList + , learning_eval_answer, case_stu_answer, knowledge_note + </sql> + <select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample" + resultMap="ResultMapWithBLOBs"> + select + <if test="distinct"> + distinct + </if> + <include refid="Base_Column_List"/> + , + <include refid="Blob_Column_List"/> + from stu_training + <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.StuTrainingExample" + resultMap="BaseResultMap"> + select + <if test="distinct"> + distinct + </if> + <include refid="Base_Column_List"/> + from stu_training + <if test="_parameter != null"> + <include refid="Example_Where_Clause"/> + </if> + <if test="orderByClause != null"> + order by ${orderByClause} + </if> + </select> + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs"> + select + <include refid="Base_Column_List"/> + , + <include refid="Blob_Column_List"/> + from stu_training + where training_id = #{trainingId,jdbcType=VARCHAR} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> + delete + from stu_training + where training_id = #{trainingId,jdbcType=VARCHAR} + </delete> + <delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample"> + delete from stu_training + <if test="_parameter != null"> + <include refid="Example_Where_Clause"/> + </if> + </delete> + <insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs"> + insert into stu_training (training_id, user_id, chapter_id, + progress, case_stu_score, knowledge_summary_score, + resource_learning_score, learning_eval_score, + exp_training_score, knowledge_summary_complete_status, + resource_learning_complete_status, learning_eval_complete_status, + exp_training_complete_status, report_id, learning_eval_idList, + learning_eval_answer, case_stu_answer, + knowledge_note) + values (#{trainingId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{chapterId,jdbcType=VARCHAR}, + #{progress,jdbcType=DECIMAL}, #{caseStuScore,jdbcType=DECIMAL}, + #{knowledgeSummaryScore,jdbcType=DECIMAL}, + #{resourceLearningScore,jdbcType=DECIMAL}, #{learningEvalScore,jdbcType=DECIMAL}, + #{expTrainingScore,jdbcType=DECIMAL}, #{knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, + #{resourceLearningCompleteStatus,jdbcType=INTEGER}, #{learningEvalCompleteStatus,jdbcType=INTEGER}, + #{expTrainingCompleteStatus,jdbcType=INTEGER}, #{reportId,jdbcType=VARCHAR}, + #{learningEvalIdlist,jdbcType=LONGVARCHAR}, + #{learningEvalAnswer,jdbcType=LONGVARCHAR}, #{caseStuAnswer,jdbcType=LONGVARCHAR}, + #{knowledgeNote,jdbcType=LONGVARCHAR}) + </insert> + <insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs"> + insert into stu_training + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="trainingId != null"> + training_id, + </if> + <if test="userId != null"> + user_id, + </if> + <if test="chapterId != null"> + chapter_id, + </if> + <if test="progress != null"> + progress, + </if> + <if test="caseStuScore != null"> + case_stu_score, + </if> + <if test="knowledgeSummaryScore != null"> + knowledge_summary_score, + </if> + <if test="resourceLearningScore != null"> + resource_learning_score, + </if> + <if test="learningEvalScore != null"> + learning_eval_score, + </if> + <if test="expTrainingScore != null"> + exp_training_score, + </if> + <if test="knowledgeSummaryCompleteStatus != null"> + knowledge_summary_complete_status, + </if> + <if test="resourceLearningCompleteStatus != null"> + resource_learning_complete_status, + </if> + <if test="learningEvalCompleteStatus != null"> + learning_eval_complete_status, + </if> + <if test="expTrainingCompleteStatus != null"> + exp_training_complete_status, + </if> + <if test="reportId != null"> + report_id, + </if> + <if test="learningEvalIdlist != null"> + learning_eval_idList, + </if> + <if test="learningEvalAnswer != null"> + learning_eval_answer, + </if> + <if test="caseStuAnswer != null"> + case_stu_answer, + </if> + <if test="knowledgeNote != null"> + knowledge_note, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="trainingId != null"> + #{trainingId,jdbcType=VARCHAR}, + </if> + <if test="userId != null"> + #{userId,jdbcType=VARCHAR}, + </if> + <if test="chapterId != null"> + #{chapterId,jdbcType=VARCHAR}, + </if> + <if test="progress != null"> + #{progress,jdbcType=DECIMAL}, + </if> + <if test="caseStuScore != null"> + #{caseStuScore,jdbcType=DECIMAL}, + </if> + <if test="knowledgeSummaryScore != null"> + #{knowledgeSummaryScore,jdbcType=DECIMAL}, + </if> + <if test="resourceLearningScore != null"> + #{resourceLearningScore,jdbcType=DECIMAL}, + </if> + <if test="learningEvalScore != null"> + #{learningEvalScore,jdbcType=DECIMAL}, + </if> + <if test="expTrainingScore != null"> + #{expTrainingScore,jdbcType=DECIMAL}, + </if> + <if test="knowledgeSummaryCompleteStatus != null"> + #{knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, + </if> + <if test="resourceLearningCompleteStatus != null"> + #{resourceLearningCompleteStatus,jdbcType=INTEGER}, + </if> + <if test="learningEvalCompleteStatus != null"> + #{learningEvalCompleteStatus,jdbcType=INTEGER}, + </if> + <if test="expTrainingCompleteStatus != null"> + #{expTrainingCompleteStatus,jdbcType=INTEGER}, + </if> + <if test="reportId != null"> + #{reportId,jdbcType=VARCHAR}, + </if> + <if test="learningEvalIdlist != null"> + #{learningEvalIdlist,jdbcType=LONGVARCHAR}, + </if> + <if test="learningEvalAnswer != null"> + #{learningEvalAnswer,jdbcType=LONGVARCHAR}, + </if> + <if test="caseStuAnswer != null"> + #{caseStuAnswer,jdbcType=LONGVARCHAR}, + </if> + <if test="knowledgeNote != null"> + #{knowledgeNote,jdbcType=LONGVARCHAR}, + </if> + </trim> + </insert> + <select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample" + resultType="java.lang.Long"> + select count(*) from stu_training + <if test="_parameter != null"> + <include refid="Example_Where_Clause"/> + </if> + </select> + <update id="updateByExampleSelective" parameterType="map"> + update stu_training + <set> + <if test="record.trainingId != null"> + training_id = #{record.trainingId,jdbcType=VARCHAR}, + </if> + <if test="record.userId != null"> + user_id = #{record.userId,jdbcType=VARCHAR}, + </if> + <if test="record.chapterId != null"> + chapter_id = #{record.chapterId,jdbcType=VARCHAR}, + </if> + <if test="record.progress != null"> + progress = #{record.progress,jdbcType=DECIMAL}, + </if> + <if test="record.caseStuScore != null"> + case_stu_score = #{record.caseStuScore,jdbcType=DECIMAL}, + </if> + <if test="record.knowledgeSummaryScore != null"> + knowledge_summary_score = #{record.knowledgeSummaryScore,jdbcType=DECIMAL}, + </if> + <if test="record.resourceLearningScore != null"> + resource_learning_score = #{record.resourceLearningScore,jdbcType=DECIMAL}, + </if> + <if test="record.learningEvalScore != null"> + learning_eval_score = #{record.learningEvalScore,jdbcType=DECIMAL}, + </if> + <if test="record.expTrainingScore != null"> + exp_training_score = #{record.expTrainingScore,jdbcType=DECIMAL}, + </if> + <if test="record.knowledgeSummaryCompleteStatus != null"> + knowledge_summary_complete_status = #{record.knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, + </if> + <if test="record.resourceLearningCompleteStatus != null"> + resource_learning_complete_status = #{record.resourceLearningCompleteStatus,jdbcType=INTEGER}, + </if> + <if test="record.learningEvalCompleteStatus != null"> + learning_eval_complete_status = #{record.learningEvalCompleteStatus,jdbcType=INTEGER}, + </if> + <if test="record.expTrainingCompleteStatus != null"> + exp_training_complete_status = #{record.expTrainingCompleteStatus,jdbcType=INTEGER}, + </if> + <if test="record.reportId != null"> + report_id = #{record.reportId,jdbcType=VARCHAR}, + </if> + <if test="record.learningEvalIdlist != null"> + learning_eval_idList = #{record.learningEvalIdlist,jdbcType=LONGVARCHAR}, + </if> + <if test="record.learningEvalAnswer != null"> + learning_eval_answer = #{record.learningEvalAnswer,jdbcType=LONGVARCHAR}, + </if> + <if test="record.caseStuAnswer != null"> + case_stu_answer = #{record.caseStuAnswer,jdbcType=LONGVARCHAR}, + </if> + <if test="record.knowledgeNote != null"> + knowledge_note = #{record.knowledgeNote,jdbcType=LONGVARCHAR}, + </if> + </set> + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause"/> + </if> + </update> + <update id="updateByExampleWithBLOBs" parameterType="map"> + update stu_training + set training_id = #{record.trainingId,jdbcType=VARCHAR}, user_id = #{record.userId,jdbcType=VARCHAR}, - </if> - <if test="record.chapterId != null"> chapter_id = #{record.chapterId,jdbcType=VARCHAR}, - </if> - <if test="record.progress != null"> progress = #{record.progress,jdbcType=DECIMAL}, - </if> - <if test="record.caseStuScore != null"> case_stu_score = #{record.caseStuScore,jdbcType=DECIMAL}, - </if> - <if test="record.knowledgeSummaryScore != null"> knowledge_summary_score = #{record.knowledgeSummaryScore,jdbcType=DECIMAL}, - </if> - <if test="record.resourceLearningScore != null"> resource_learning_score = #{record.resourceLearningScore,jdbcType=DECIMAL}, - </if> - <if test="record.learningEvalScore != null"> learning_eval_score = #{record.learningEvalScore,jdbcType=DECIMAL}, - </if> - <if test="record.expTrainingScore != null"> exp_training_score = #{record.expTrainingScore,jdbcType=DECIMAL}, - </if> - <if test="record.knowledgeSummaryCompleteStatus != null"> knowledge_summary_complete_status = #{record.knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, - </if> - <if test="record.resourceLearningCompleteStatus != null"> resource_learning_complete_status = #{record.resourceLearningCompleteStatus,jdbcType=INTEGER}, - </if> - <if test="record.learningEvalCompleteStatus != null"> learning_eval_complete_status = #{record.learningEvalCompleteStatus,jdbcType=INTEGER}, - </if> - <if test="record.expTrainingCompleteStatus != null"> exp_training_complete_status = #{record.expTrainingCompleteStatus,jdbcType=INTEGER}, - </if> - <if test="record.reportId != null"> report_id = #{record.reportId,jdbcType=VARCHAR}, - </if> - <if test="record.learningEvalIdlist != null"> learning_eval_idList = #{record.learningEvalIdlist,jdbcType=LONGVARCHAR}, - </if> - <if test="record.learningEvalAnswer != null"> learning_eval_answer = #{record.learningEvalAnswer,jdbcType=LONGVARCHAR}, - </if> - <if test="record.caseStuAnswer != null"> case_stu_answer = #{record.caseStuAnswer,jdbcType=LONGVARCHAR}, - </if> - <if test="record.knowledgeNote != null"> - knowledge_note = #{record.knowledgeNote,jdbcType=LONGVARCHAR}, - </if> - </set> - <if test="_parameter != null"> - <include refid="Update_By_Example_Where_Clause" /> - </if> - </update> - <update id="updateByExampleWithBLOBs" parameterType="map"> - update stu_training - set training_id = #{record.trainingId,jdbcType=VARCHAR}, - user_id = #{record.userId,jdbcType=VARCHAR}, - chapter_id = #{record.chapterId,jdbcType=VARCHAR}, - progress = #{record.progress,jdbcType=DECIMAL}, - case_stu_score = #{record.caseStuScore,jdbcType=DECIMAL}, - knowledge_summary_score = #{record.knowledgeSummaryScore,jdbcType=DECIMAL}, - resource_learning_score = #{record.resourceLearningScore,jdbcType=DECIMAL}, - learning_eval_score = #{record.learningEvalScore,jdbcType=DECIMAL}, - exp_training_score = #{record.expTrainingScore,jdbcType=DECIMAL}, - knowledge_summary_complete_status = #{record.knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, - resource_learning_complete_status = #{record.resourceLearningCompleteStatus,jdbcType=INTEGER}, - learning_eval_complete_status = #{record.learningEvalCompleteStatus,jdbcType=INTEGER}, - exp_training_complete_status = #{record.expTrainingCompleteStatus,jdbcType=INTEGER}, - report_id = #{record.reportId,jdbcType=VARCHAR}, - learning_eval_idList = #{record.learningEvalIdlist,jdbcType=LONGVARCHAR}, - learning_eval_answer = #{record.learningEvalAnswer,jdbcType=LONGVARCHAR}, - case_stu_answer = #{record.caseStuAnswer,jdbcType=LONGVARCHAR}, - knowledge_note = #{record.knowledgeNote,jdbcType=LONGVARCHAR} - <if test="_parameter != null"> - <include refid="Update_By_Example_Where_Clause" /> - </if> - </update> - <update id="updateByExample" parameterType="map"> - update stu_training - set training_id = #{record.trainingId,jdbcType=VARCHAR}, - user_id = #{record.userId,jdbcType=VARCHAR}, - chapter_id = #{record.chapterId,jdbcType=VARCHAR}, - progress = #{record.progress,jdbcType=DECIMAL}, - case_stu_score = #{record.caseStuScore,jdbcType=DECIMAL}, - knowledge_summary_score = #{record.knowledgeSummaryScore,jdbcType=DECIMAL}, - resource_learning_score = #{record.resourceLearningScore,jdbcType=DECIMAL}, - learning_eval_score = #{record.learningEvalScore,jdbcType=DECIMAL}, - exp_training_score = #{record.expTrainingScore,jdbcType=DECIMAL}, - knowledge_summary_complete_status = #{record.knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, - resource_learning_complete_status = #{record.resourceLearningCompleteStatus,jdbcType=INTEGER}, - learning_eval_complete_status = #{record.learningEvalCompleteStatus,jdbcType=INTEGER}, - exp_training_complete_status = #{record.expTrainingCompleteStatus,jdbcType=INTEGER}, - report_id = #{record.reportId,jdbcType=VARCHAR} - <if test="_parameter != null"> - <include refid="Update_By_Example_Where_Clause" /> - </if> - </update> - <update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs"> - update stu_training - <set> - <if test="userId != null"> - user_id = #{userId,jdbcType=VARCHAR}, - </if> - <if test="chapterId != null"> - chapter_id = #{chapterId,jdbcType=VARCHAR}, - </if> - <if test="progress != null"> - progress = #{progress,jdbcType=DECIMAL}, - </if> - <if test="caseStuScore != null"> - case_stu_score = #{caseStuScore,jdbcType=DECIMAL}, - </if> - <if test="knowledgeSummaryScore != null"> - knowledge_summary_score = #{knowledgeSummaryScore,jdbcType=DECIMAL}, - </if> - <if test="resourceLearningScore != null"> - resource_learning_score = #{resourceLearningScore,jdbcType=DECIMAL}, - </if> - <if test="learningEvalScore != null"> - learning_eval_score = #{learningEvalScore,jdbcType=DECIMAL}, - </if> - <if test="expTrainingScore != null"> - exp_training_score = #{expTrainingScore,jdbcType=DECIMAL}, - </if> - <if test="knowledgeSummaryCompleteStatus != null"> - knowledge_summary_complete_status = #{knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, - </if> - <if test="resourceLearningCompleteStatus != null"> - resource_learning_complete_status = #{resourceLearningCompleteStatus,jdbcType=INTEGER}, - </if> - <if test="learningEvalCompleteStatus != null"> - learning_eval_complete_status = #{learningEvalCompleteStatus,jdbcType=INTEGER}, - </if> - <if test="expTrainingCompleteStatus != null"> - exp_training_complete_status = #{expTrainingCompleteStatus,jdbcType=INTEGER}, - </if> - <if test="reportId != null"> - report_id = #{reportId,jdbcType=VARCHAR}, - </if> - <if test="learningEvalIdlist != null"> - learning_eval_idList = #{learningEvalIdlist,jdbcType=LONGVARCHAR}, - </if> - <if test="learningEvalAnswer != null"> - learning_eval_answer = #{learningEvalAnswer,jdbcType=LONGVARCHAR}, - </if> - <if test="caseStuAnswer != null"> - case_stu_answer = #{caseStuAnswer,jdbcType=LONGVARCHAR}, - </if> - <if test="knowledgeNote != null"> - knowledge_note = #{knowledgeNote,jdbcType=LONGVARCHAR}, - </if> - </set> - where training_id = #{trainingId,jdbcType=VARCHAR} - </update> - <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs"> - update stu_training - set user_id = #{userId,jdbcType=VARCHAR}, - chapter_id = #{chapterId,jdbcType=VARCHAR}, - progress = #{progress,jdbcType=DECIMAL}, - case_stu_score = #{caseStuScore,jdbcType=DECIMAL}, - knowledge_summary_score = #{knowledgeSummaryScore,jdbcType=DECIMAL}, - resource_learning_score = #{resourceLearningScore,jdbcType=DECIMAL}, - learning_eval_score = #{learningEvalScore,jdbcType=DECIMAL}, - exp_training_score = #{expTrainingScore,jdbcType=DECIMAL}, - knowledge_summary_complete_status = #{knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, - resource_learning_complete_status = #{resourceLearningCompleteStatus,jdbcType=INTEGER}, - learning_eval_complete_status = #{learningEvalCompleteStatus,jdbcType=INTEGER}, - exp_training_complete_status = #{expTrainingCompleteStatus,jdbcType=INTEGER}, - report_id = #{reportId,jdbcType=VARCHAR}, - learning_eval_idList = #{learningEvalIdlist,jdbcType=LONGVARCHAR}, - learning_eval_answer = #{learningEvalAnswer,jdbcType=LONGVARCHAR}, - case_stu_answer = #{caseStuAnswer,jdbcType=LONGVARCHAR}, - knowledge_note = #{knowledgeNote,jdbcType=LONGVARCHAR} - where training_id = #{trainingId,jdbcType=VARCHAR} - </update> - <update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.StuTraining"> - update stu_training - set user_id = #{userId,jdbcType=VARCHAR}, - chapter_id = #{chapterId,jdbcType=VARCHAR}, - progress = #{progress,jdbcType=DECIMAL}, - case_stu_score = #{caseStuScore,jdbcType=DECIMAL}, - knowledge_summary_score = #{knowledgeSummaryScore,jdbcType=DECIMAL}, - resource_learning_score = #{resourceLearningScore,jdbcType=DECIMAL}, - learning_eval_score = #{learningEvalScore,jdbcType=DECIMAL}, - exp_training_score = #{expTrainingScore,jdbcType=DECIMAL}, - knowledge_summary_complete_status = #{knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, - resource_learning_complete_status = #{resourceLearningCompleteStatus,jdbcType=INTEGER}, - learning_eval_complete_status = #{learningEvalCompleteStatus,jdbcType=INTEGER}, - exp_training_complete_status = #{expTrainingCompleteStatus,jdbcType=INTEGER}, - report_id = #{reportId,jdbcType=VARCHAR} - where training_id = #{trainingId,jdbcType=VARCHAR} - </update> - <resultMap id="DtoBaseResultMap" type="com.sztzjy.financial_bigdata.entity.tea_dto.TrainingDto"> - <result column="title" jdbcType="VARCHAR" property="name" /> - <result column="chapter_name" jdbcType="VARCHAR" property="task" /> - <result column="case_id" jdbcType="VARCHAR" property="caseId" /> - <result column="total_steps_count" jdbcType="INTEGER" property="count" /> - <result column="total_steps_score" jdbcType="DECIMAL" property="score" /> - <result column="total_steps_score" jdbcType="DECIMAL" property="score" /> - </resultMap> + knowledge_note = #{record.knowledgeNote,jdbcType=LONGVARCHAR} + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause"/> + </if> + </update> + <update id="updateByExample" parameterType="map"> + update stu_training + set training_id = #{record.trainingId,jdbcType=VARCHAR}, + user_id = #{record.userId,jdbcType=VARCHAR}, + chapter_id = #{record.chapterId,jdbcType=VARCHAR}, + progress = #{record.progress,jdbcType=DECIMAL}, + case_stu_score = #{record.caseStuScore,jdbcType=DECIMAL}, + knowledge_summary_score = #{record.knowledgeSummaryScore,jdbcType=DECIMAL}, + resource_learning_score = #{record.resourceLearningScore,jdbcType=DECIMAL}, + learning_eval_score = #{record.learningEvalScore,jdbcType=DECIMAL}, + exp_training_score = #{record.expTrainingScore,jdbcType=DECIMAL}, + knowledge_summary_complete_status = #{record.knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, + resource_learning_complete_status = #{record.resourceLearningCompleteStatus,jdbcType=INTEGER}, + learning_eval_complete_status = #{record.learningEvalCompleteStatus,jdbcType=INTEGER}, + exp_training_complete_status = #{record.expTrainingCompleteStatus,jdbcType=INTEGER}, + report_id = #{record.reportId,jdbcType=VARCHAR} + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause"/> + </if> + </update> + <update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs"> + update stu_training + <set> + <if test="userId != null"> + user_id = #{userId,jdbcType=VARCHAR}, + </if> + <if test="chapterId != null"> + chapter_id = #{chapterId,jdbcType=VARCHAR}, + </if> + <if test="progress != null"> + progress = #{progress,jdbcType=DECIMAL}, + </if> + <if test="caseStuScore != null"> + case_stu_score = #{caseStuScore,jdbcType=DECIMAL}, + </if> + <if test="knowledgeSummaryScore != null"> + knowledge_summary_score = #{knowledgeSummaryScore,jdbcType=DECIMAL}, + </if> + <if test="resourceLearningScore != null"> + resource_learning_score = #{resourceLearningScore,jdbcType=DECIMAL}, + </if> + <if test="learningEvalScore != null"> + learning_eval_score = #{learningEvalScore,jdbcType=DECIMAL}, + </if> + <if test="expTrainingScore != null"> + exp_training_score = #{expTrainingScore,jdbcType=DECIMAL}, + </if> + <if test="knowledgeSummaryCompleteStatus != null"> + knowledge_summary_complete_status = #{knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, + </if> + <if test="resourceLearningCompleteStatus != null"> + resource_learning_complete_status = #{resourceLearningCompleteStatus,jdbcType=INTEGER}, + </if> + <if test="learningEvalCompleteStatus != null"> + learning_eval_complete_status = #{learningEvalCompleteStatus,jdbcType=INTEGER}, + </if> + <if test="expTrainingCompleteStatus != null"> + exp_training_complete_status = #{expTrainingCompleteStatus,jdbcType=INTEGER}, + </if> + <if test="reportId != null"> + report_id = #{reportId,jdbcType=VARCHAR}, + </if> + <if test="learningEvalIdlist != null"> + learning_eval_idList = #{learningEvalIdlist,jdbcType=LONGVARCHAR}, + </if> + <if test="learningEvalAnswer != null"> + learning_eval_answer = #{learningEvalAnswer,jdbcType=LONGVARCHAR}, + </if> + <if test="caseStuAnswer != null"> + case_stu_answer = #{caseStuAnswer,jdbcType=LONGVARCHAR}, + </if> + <if test="knowledgeNote != null"> + knowledge_note = #{knowledgeNote,jdbcType=LONGVARCHAR}, + </if> + </set> + where training_id = #{trainingId,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs"> + update stu_training + set user_id = #{userId,jdbcType=VARCHAR}, + chapter_id = #{chapterId,jdbcType=VARCHAR}, + progress = #{progress,jdbcType=DECIMAL}, + case_stu_score = #{caseStuScore,jdbcType=DECIMAL}, + knowledge_summary_score = #{knowledgeSummaryScore,jdbcType=DECIMAL}, + resource_learning_score = #{resourceLearningScore,jdbcType=DECIMAL}, + learning_eval_score = #{learningEvalScore,jdbcType=DECIMAL}, + exp_training_score = #{expTrainingScore,jdbcType=DECIMAL}, + knowledge_summary_complete_status = #{knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, + resource_learning_complete_status = #{resourceLearningCompleteStatus,jdbcType=INTEGER}, + learning_eval_complete_status = #{learningEvalCompleteStatus,jdbcType=INTEGER}, + exp_training_complete_status = #{expTrainingCompleteStatus,jdbcType=INTEGER}, + report_id = #{reportId,jdbcType=VARCHAR}, + learning_eval_idList = #{learningEvalIdlist,jdbcType=LONGVARCHAR}, + learning_eval_answer = #{learningEvalAnswer,jdbcType=LONGVARCHAR}, + case_stu_answer = #{caseStuAnswer,jdbcType=LONGVARCHAR}, + knowledge_note = #{knowledgeNote,jdbcType=LONGVARCHAR} + where training_id = #{trainingId,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.StuTraining"> + update stu_training + set user_id = #{userId,jdbcType=VARCHAR}, + chapter_id = #{chapterId,jdbcType=VARCHAR}, + progress = #{progress,jdbcType=DECIMAL}, + case_stu_score = #{caseStuScore,jdbcType=DECIMAL}, + knowledge_summary_score = #{knowledgeSummaryScore,jdbcType=DECIMAL}, + resource_learning_score = #{resourceLearningScore,jdbcType=DECIMAL}, + learning_eval_score = #{learningEvalScore,jdbcType=DECIMAL}, + exp_training_score = #{expTrainingScore,jdbcType=DECIMAL}, + knowledge_summary_complete_status = #{knowledgeSummaryCompleteStatus,jdbcType=INTEGER}, + resource_learning_complete_status = #{resourceLearningCompleteStatus,jdbcType=INTEGER}, + learning_eval_complete_status = #{learningEvalCompleteStatus,jdbcType=INTEGER}, + exp_training_complete_status = #{expTrainingCompleteStatus,jdbcType=INTEGER}, + report_id = #{reportId,jdbcType=VARCHAR} + where training_id = #{trainingId,jdbcType=VARCHAR} + </update> + <resultMap id="DtoBaseResultMap" type="com.sztzjy.financial_bigdata.entity.tea_dto.TrainingDto"> + <result column="title" jdbcType="VARCHAR" property="name"/> + <result column="chapter_name" jdbcType="VARCHAR" property="task"/> + <result column="case_id" jdbcType="VARCHAR" property="caseId"/> + <result column="total_steps_count" jdbcType="INTEGER" property="count"/> + <result column="total_steps_score" jdbcType="DECIMAL" property="score"/> + <result column="total_steps_score" jdbcType="DECIMAL" property="score"/> + </resultMap> + + <select id="selectTrainingByIds" parameterType="com.sztzjy.financial_bigdata.entity.StuTraining" + resultMap="DtoBaseResultMap"> + SELECT SUM(sqs.score) AS total_steps_score, sqs.case_id,COUNT(sqs.case_step_id) AS total_steps_count, sq.title, + scc.chapter_name + FROM sys_case_question_step sqs + JOIN sys_case_question sq ON sqs.case_id = sq.case_id + JOIN sys_course_chapter scc ON sq.chapter_id = scc.chapter_id + WHERE sqs.case_id IN + <foreach item="item" collection="ids" open="(" separator="," close=")"> + #{item} + </foreach> + GROUP BY sq.title, scc.chapter_name,sqs.case_id; + </select> + - <select id="selectTrainingByIds" parameterType="com.sztzjy.financial_bigdata.entity.StuTraining" resultMap="DtoBaseResultMap"> - SELECT SUM(sqs.score) AS total_steps_score, sqs.case_id,COUNT(sqs.case_step_id) AS total_steps_count, sq.title, scc.chapter_name - FROM sys_case_question_step sqs - JOIN sys_case_question sq ON sqs.case_id = sq.case_id - JOIN sys_course_chapter scc ON sq.chapter_id = scc.chapter_id - WHERE sqs.case_id IN <foreach item="item" collection="ids" open="(" separator="," close=")"> - #{item} - </foreach> - GROUP BY sq.title, scc.chapter_name,sqs.case_id; - </select> + <select id="getByUserIdAndChapterIds" resultMap="BaseResultMap"> + SELECT chapter_id,progress + FROM stu_training + WHERE user_id = #{userId} + AND chapter_id IN + <foreach collection="chapterIds" item="chapterId" separator="," open="(" close=")"> + #{chapterId} + </foreach> + </select> </mapper> \ No newline at end of file diff --git a/src/main/resources/mapper/SysCourseChapterMapper.xml b/src/main/resources/mapper/SysCourseChapterMapper.xml index 0aa35bb..9e4fab7 100644 --- a/src/main/resources/mapper/SysCourseChapterMapper.xml +++ b/src/main/resources/mapper/SysCourseChapterMapper.xml @@ -207,4 +207,23 @@ WHERE sys_course.course_id = sys_course_chapter.course_id AND school_Id in (999999999, #{schoolId}) </select> + + <select id="getChapters" parameterType="java.lang.String" resultMap="BaseResultMap"> + select * + from sys_course_chapter + where course_id =#{courseId} + order by sequence ASC + </select> + + <select id="getChaptersByCourseIds" parameterType="java.lang.String" resultMap="BaseResultMap"> + select * + from sys_course_chapter + where course_id IN + <foreach item="item" index="index" collection="courseIds" open="(" separator="," close=")"> + #{item} + </foreach> + order by sequence ASC + </select> + + </mapper> \ No newline at end of file diff --git a/src/main/resources/mapper/SysCourseMapper.xml b/src/main/resources/mapper/SysCourseMapper.xml index 874fa03..11684de 100644 --- a/src/main/resources/mapper/SysCourseMapper.xml +++ b/src/main/resources/mapper/SysCourseMapper.xml @@ -84,7 +84,7 @@ </if> </select> <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> - select + select <include refid="Base_Column_List" /> from sys_course where course_id = #{courseId,jdbcType=VARCHAR} @@ -100,9 +100,9 @@ </if> </delete> <insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.SysCourse"> - insert into sys_course (course_id, course_name, sequence, + insert into sys_course (course_id, course_name, sequence, school_id, input_type) - values (#{courseId,jdbcType=VARCHAR}, #{courseName,jdbcType=VARCHAR}, #{sequence,jdbcType=INTEGER}, + values (#{courseId,jdbcType=VARCHAR}, #{courseName,jdbcType=VARCHAR}, #{sequence,jdbcType=INTEGER}, #{schoolId,jdbcType=VARCHAR}, #{inputType,jdbcType=VARCHAR}) </insert> <insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.SysCourse">