修改实训演练页面接口

master
xiaoCJ 9 months ago
parent ec4bd7c526
commit 6b84bd6f20

76
.gitignore vendored

@ -1,34 +1,58 @@
HELP.md
# ignore these folders
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
.idea/
.settings/
.vscode/
bin/
out/
### STS ###
.apt_generated
# 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
# ...

@ -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);
}
//数据集下载

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

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

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

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

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

@ -2,26 +2,29 @@
<!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" />
<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 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>
@ -41,7 +44,8 @@
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
@ -70,7 +74,8 @@
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
@ -82,39 +87,43 @@
</where>
</sql>
<sql id="Base_Column_List">
training_id, user_id, chapter_id, progress, case_stu_score, knowledge_summary_score,
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
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 id="selectByExampleWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample"
resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List" />
<include refid="Blob_Column_List"/>
from stu_training
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
<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 id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from stu_training
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
@ -122,20 +131,21 @@
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
,
<include refid="Blob_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
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" />
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs">
@ -148,11 +158,13 @@
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},
#{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},
#{expTrainingCompleteStatus,jdbcType=INTEGER}, #{reportId,jdbcType=VARCHAR},
#{learningEvalIdlist,jdbcType=LONGVARCHAR},
#{learningEvalAnswer,jdbcType=LONGVARCHAR}, #{caseStuAnswer,jdbcType=LONGVARCHAR},
#{knowledgeNote,jdbcType=LONGVARCHAR})
</insert>
@ -271,10 +283,11 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample" resultType="java.lang.Long">
<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" />
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
@ -336,7 +349,7 @@
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
@ -360,7 +373,7 @@
case_stu_answer = #{record.caseStuAnswer,jdbcType=LONGVARCHAR},
knowledge_note = #{record.knowledgeNote,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
@ -380,7 +393,7 @@
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" />
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs">
@ -479,22 +492,36 @@
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" />
<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
<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=")">
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>

@ -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>
Loading…
Cancel
Save