完成教师端实验报告及评阅相关功能

main
whb 3 months ago
parent 8d59c46fa8
commit 175c5688b9

@ -0,0 +1,169 @@
package com.sztzjy.trade.controller.tch;
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sztzjy.trade.annotation.AnonymousAccess;
import com.sztzjy.trade.entity.*;
import com.sztzjy.trade.mapper.StuPracticalTrainingReportMapper;
import com.sztzjy.trade.service.TchGeneralViewService;
import com.sztzjy.trade.util.ResultEntity;
import com.sztzjy.trade.util.excel.FilePortUtil;
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.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
//教师端成绩总览
@RestController
@RequestMapping("/api/tch/generalView")
@Api("课程成绩")
public class TchGeneralViewController {
@Autowired
TchGeneralViewService tchGeneralViewService;
@Autowired
private StuPracticalTrainingReportMapper stuPracticalTrainingReportMapper;
@PostMapping("/getGeneralViewList")
@AnonymousAccess
@ApiOperation("成绩总览展示 (条件查询)")
public ResultEntity getGeneralViewList(@RequestBody TchGeneralViewDTO tchGeneralViewDTO) {
return tchGeneralViewService.selectGeneralViewList(tchGeneralViewDTO);
}
@AnonymousAccess
@GetMapping("/generalViewExport")
@ApiOperation("成绩总览导出")
public void generalViewExport(HttpServletResponse response, @RequestParam String schoolId) {
//导出的表名
String title = IdUtil.simpleUUID();
//表中第一行表头字段
String[] headers = {"用户名", "学号", "班级","考勤成绩","作业考试成绩","理实案例成绩","权重","总分","排名"};
//实际数据结果集
List tchGeneralViewDTOS = tchGeneralViewService.generalViewExport(schoolId);
//具体需要写入excel需要哪些字段这些字段取自UserReward类也就是上面的实际数据结果集的泛型
List<String> listColumn = Arrays.asList("name", "studentId"
, "className", "attendanceScore","examResultsForHomeworkAssignments",
"resultsOfPracticalCaseStudies","weight","totalScore","totalRank");
try {
FilePortUtil.exportExcel(response, title, headers, tchGeneralViewDTOS, listColumn);
} catch (Exception e) {
e.printStackTrace();
}
}
@AnonymousAccess
@ApiOperation("成绩总览权重回显")
@GetMapping("/getResultsOverviewWeight")
public ResultEntity getResultsOverviewWeight(@RequestParam String schoolId) {
return tchGeneralViewService.getResultsOverviewWeight(schoolId);
}
//成绩总览权重设置
@AnonymousAccess
@ApiOperation("成绩总览权重设置")
@PostMapping("/setResultsOverviewWeight")
public ResultEntity setResultsOverviewWeight(@RequestBody TchDigitalTradeWeight weight) {
return tchGeneralViewService.setResultsOverviewWeight(weight);
}
@AnonymousAccess
@ApiOperation("获取所有实验报告")
@GetMapping("/getTrainingReportList")
public ResultEntity getTrainingReportList(@RequestParam String schoolId,@RequestParam Integer page,@RequestParam Integer size){
PageHelper.startPage(page, size);
StuPracticalTrainingReportExample example=new StuPracticalTrainingReportExample();
example.setOrderByClause("module");
StuPracticalTrainingReportExample.Criteria criteria = example.createCriteria();
criteria.andSchoolIdEqualTo(schoolId).andStatusEqualTo(0);
List<StuPracticalTrainingReport> stuPracticalTrainingReports = stuPracticalTrainingReportMapper.selectByExample(example);
PageInfo<StuPracticalTrainingReport> pageInfo=new PageInfo<>(stuPracticalTrainingReports);
return new ResultEntity(HttpStatus.OK, "实训报告展示成功",pageInfo);
}
@GetMapping("/getCurrencyScoreReport")
@ApiOperation("评阅界面")
@AnonymousAccess
public ResultEntity<PageInfo<StuPracticalTrainingReport>> getCurrencyScoreReport(@RequestParam String schoolId,
@RequestParam Integer page,
@RequestParam Integer size,
@RequestParam String module,
@ApiParam("姓名或者学号") @RequestParam(required = false) String name,
@RequestParam(required = false) String className) {
return new ResultEntity<>(tchGeneralViewService.getScoreReport(schoolId, page, size, module, name, className));
}
@AnonymousAccess
@GetMapping("/getClassNameBySchoolId")
@ApiOperation("班级下拉框")
public ResultEntity<List<String>> getClassNameBySchoolId(@RequestParam String schoolId) {
return new ResultEntity(tchGeneralViewService.getClassNameBySchoolId(schoolId));
}
@GetMapping("/getReportFileURLByUserIdAndModule")
@ApiOperation("获取获取单个学生报告")
@AnonymousAccess
public ResultEntity getReportFileURLByUserIdAndModule(@RequestParam String userId, @RequestParam String module){
StuPracticalTrainingReportExample practicalTrainingReportExample = new StuPracticalTrainingReportExample();
practicalTrainingReportExample.createCriteria().andUserIdEqualTo(userId).andModuleEqualTo(module).andStatusEqualTo(0);
List<StuPracticalTrainingReport> stuPracticalTrainingReports = stuPracticalTrainingReportMapper.selectByExample(practicalTrainingReportExample);
if (stuPracticalTrainingReports.isEmpty()) {
return new ResultEntity<>(HttpStatus.OK,"实验报告不存在!");
}
return new ResultEntity<>(HttpStatus.OK,"获取成功",stuPracticalTrainingReports.get(0).getUrl());
}
@PostMapping("/ratingAndComment")
@ApiOperation("老师输入评语和打分")
@AnonymousAccess
public void ratingAndComment(@RequestBody StuPracticalTrainingReport practicalTrainingReport) {
stuPracticalTrainingReportMapper.updateByPrimaryKeySelective(practicalTrainingReport);
if (practicalTrainingReport.getRating() != null) {
//todo 同步学生端成绩 实验报告中
// StuScoreDetailsExample stuScoreDetailsExample = new StuScoreDetailsExample();
// stuScoreDetailsExample.createCriteria().andModuleEqualTo(practicalTrainingReport.getModule()).andUserIdEqualTo(practicalTrainingReport.getUserid()).andSerialNumberEqualTo(5).andAscriptionEqualTo(practicalTrainingReport.getAscription());
// List<StuScoreDetails> stuScoreDetails = stuScoreDetailsMapper.selectByExample(stuScoreDetailsExample);
// if (!stuScoreDetails.isEmpty()) {
// StuScoreDetails stuScoreDetails1 = stuScoreDetails.get(0);
// stuScoreDetails1.setScoreProject(practicalTrainingReport.getRating());
// stuScoreDetailsMapper.updateByPrimaryKey(stuScoreDetails1);
// }
}
}
}

@ -49,6 +49,9 @@ public class TchQuestionBankController {
@Autowired
private StuQuestionBankService questionBankService;
@Autowired
private StuLearningAssessmentMapper stuLearningAssessmentMapper;
@GetMapping("/getQuestionBankBySchoolId")
@ApiOperation("分页查询获取所有题目")
@ -113,8 +116,7 @@ public class TchQuestionBankController {
}
@Autowired
private StuLearningAssessmentMapper stuLearningAssessmentMapper;
//批量导入模板
//导入外部Excel格式的数据
@ -137,7 +139,6 @@ private StuLearningAssessmentMapper stuLearningAssessmentMapper;
}
@ApiOperation("题库导入模板下载")
@GetMapping("/templateDown")
@AnonymousAccess
@ -149,9 +150,4 @@ private StuLearningAssessmentMapper stuLearningAssessmentMapper;
}

@ -1,8 +1,12 @@
package com.sztzjy.trade.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @author whb
@ -16,6 +20,8 @@ public class StuPracticalTrainingReport {
private String reportName;
@ApiModelProperty(notes = "上传时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private Date uploadTime;
@ApiModelProperty(notes = "报告大小")
@ -42,8 +48,18 @@ public class StuPracticalTrainingReport {
@ApiModelProperty(notes = "学校ID")
private String schoolId;
@ApiModelProperty(notes = "删除状态1已删除0未删除")
private Integer status;
@ApiModelProperty(notes = "学号")
private String studentId;
@ApiModelProperty(notes = "姓名")
private String name;
@ApiModelProperty(notes = "班级名称")
private String className;
public Integer getId() {
return id;
}
@ -139,4 +155,28 @@ public class StuPracticalTrainingReport {
public void setStatus(Integer status) {
this.status = status;
}
public String getStudentId() {
return studentId;
}
public void setStudentId(String studentId) {
this.studentId = studentId == null ? null : studentId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className == null ? null : className.trim();
}
}

@ -884,6 +884,216 @@ public class StuPracticalTrainingReportExample {
addCriterion("status not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStudentIdIsNull() {
addCriterion("student_id is null");
return (Criteria) this;
}
public Criteria andStudentIdIsNotNull() {
addCriterion("student_id is not null");
return (Criteria) this;
}
public Criteria andStudentIdEqualTo(String value) {
addCriterion("student_id =", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdNotEqualTo(String value) {
addCriterion("student_id <>", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdGreaterThan(String value) {
addCriterion("student_id >", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdGreaterThanOrEqualTo(String value) {
addCriterion("student_id >=", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdLessThan(String value) {
addCriterion("student_id <", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdLessThanOrEqualTo(String value) {
addCriterion("student_id <=", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdLike(String value) {
addCriterion("student_id like", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdNotLike(String value) {
addCriterion("student_id not like", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdIn(List<String> values) {
addCriterion("student_id in", values, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdNotIn(List<String> values) {
addCriterion("student_id not in", values, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdBetween(String value1, String value2) {
addCriterion("student_id between", value1, value2, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdNotBetween(String value1, String value2) {
addCriterion("student_id not between", value1, value2, "studentId");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andClassNameIsNull() {
addCriterion("class_name is null");
return (Criteria) this;
}
public Criteria andClassNameIsNotNull() {
addCriterion("class_name is not null");
return (Criteria) this;
}
public Criteria andClassNameEqualTo(String value) {
addCriterion("class_name =", value, "className");
return (Criteria) this;
}
public Criteria andClassNameNotEqualTo(String value) {
addCriterion("class_name <>", value, "className");
return (Criteria) this;
}
public Criteria andClassNameGreaterThan(String value) {
addCriterion("class_name >", value, "className");
return (Criteria) this;
}
public Criteria andClassNameGreaterThanOrEqualTo(String value) {
addCriterion("class_name >=", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLessThan(String value) {
addCriterion("class_name <", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLessThanOrEqualTo(String value) {
addCriterion("class_name <=", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLike(String value) {
addCriterion("class_name like", value, "className");
return (Criteria) this;
}
public Criteria andClassNameNotLike(String value) {
addCriterion("class_name not like", value, "className");
return (Criteria) this;
}
public Criteria andClassNameIn(List<String> values) {
addCriterion("class_name in", values, "className");
return (Criteria) this;
}
public Criteria andClassNameNotIn(List<String> values) {
addCriterion("class_name not in", values, "className");
return (Criteria) this;
}
public Criteria andClassNameBetween(String value1, String value2) {
addCriterion("class_name between", value1, value2, "className");
return (Criteria) this;
}
public Criteria andClassNameNotBetween(String value1, String value2) {
addCriterion("class_name not between", value1, value2, "className");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

@ -13,7 +13,7 @@ public class TchDigitalTradeWeight {
@ApiModelProperty(notes = "学校ID")
private String schoolId;
@ApiModelProperty(notes = "考勤成绩权重(考勤成绩权重设置)")
@ApiModelProperty(notes = "满勤得分标准")
private BigDecimal weightOfAttendanceScoresSmall;
@ApiModelProperty(notes = "考勤成绩权重(权重设置)")

@ -0,0 +1,84 @@
package com.sztzjy.trade.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.math.RoundingMode;
/**
* @author 17803
* @date 2024-12-17 13:51
*/
@Data
public class TchGeneralViewDTO {
@ApiModelProperty(notes = "学号")
private String studentId;
@ApiModelProperty(notes = "姓名")
private String name;
@ApiModelProperty(notes = "班级名称")
private String className;
@ApiModelProperty(notes = "学校ID")
private String schoolId;
@ApiModelProperty(notes = "当前页")
private Integer page;
@ApiModelProperty(notes = "每页展示条数")
private Integer size;
@ApiModelProperty(notes = "权重")
private BigDecimal weight;
@ApiModelProperty(notes = "考勤成绩")
private BigDecimal attendanceScore;
@ApiModelProperty(notes = "作业考试成绩")
private BigDecimal examResultsForHomeworkAssignments;
@ApiModelProperty(notes = "理实案例成绩")
private BigDecimal resultsOfPracticalCaseStudies;
@ApiModelProperty(notes = "总排名(学校)")
private Integer totalRank;
@ApiModelProperty(notes = "综合得分(学校)(乘完权重后)")
private BigDecimal totalScore;
public TchGeneralViewDTO(StuUser stuUser, TchDigitalTradeWeight resultsOverviewWeight) {
this.name=stuUser.getName();
this.studentId=stuUser.getStudentId();
this.className=stuUser.getClassName();
this.attendanceScore = stuUser.getAttendanceScore()
.multiply(resultsOverviewWeight.getWeightOfAttendanceScores())
.setScale(2, RoundingMode.HALF_UP); // 四舍五入
this.examResultsForHomeworkAssignments = stuUser.getExamResultsForHomeworkAssignments()
.multiply(resultsOverviewWeight.getWeightOfHomeworkExamScores())
.setScale(2, RoundingMode.HALF_UP); // 四舍五入
this.resultsOfPracticalCaseStudies = stuUser.getResultsOfPracticalCaseStudies()
.multiply(resultsOverviewWeight.getWeightOfPracticalCaseScores())
.setScale(2, RoundingMode.HALF_UP); // 四舍五入
this.weight=resultsOverviewWeight.getWeightOfAttendanceScores().add(resultsOverviewWeight.getWeightOfHomeworkExamScores()).add(resultsOverviewWeight.getWeightOfPracticalCaseScores());
this.totalScore=stuUser.getTotalScore();
if(stuUser.getTotalRank()!=null){
this.totalRank=stuUser.getTotalRank();
}
}
}

@ -0,0 +1,40 @@
package com.sztzjy.trade.service;
import com.github.pagehelper.PageInfo;
import com.sztzjy.trade.entity.StuPracticalTrainingReport;
import com.sztzjy.trade.entity.TchDigitalTradeWeight;
import com.sztzjy.trade.entity.TchGeneralViewDTO;
import com.sztzjy.trade.util.ResultEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author 17803
* @date 2024-12-17 13:48
*/
public interface TchGeneralViewService {
/*
* ()
* @param null
* @return
*/
ResultEntity selectGeneralViewList(TchGeneralViewDTO tchGeneralViewDTO);
List generalViewExport(String schoolId);
//成绩总览权重回显
ResultEntity getResultsOverviewWeight(String schoolId);
//成绩总览权重设置
ResultEntity setResultsOverviewWeight(TchDigitalTradeWeight weight);
//评阅界面
PageInfo<StuPracticalTrainingReport> getScoreReport(String schoolId, Integer page, Integer size, String module, String name, String className);
//班级下拉框
List<String> getClassNameBySchoolId(@Param("schoolId") String schoolId);
}

@ -0,0 +1,194 @@
package com.sztzjy.trade.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sztzjy.trade.entity.*;
import com.sztzjy.trade.mapper.StuPracticalTrainingReportMapper;
import com.sztzjy.trade.mapper.StuUserMapper;
import com.sztzjy.trade.mapper.TchDigitalTradeWeightMapper;
import com.sztzjy.trade.service.TchGeneralViewService;
import com.sztzjy.trade.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author 17803
* @date 2024-12-17 13:48
*/
@Service
public class TchGeneralViewServiceImpl implements TchGeneralViewService {
@Autowired
private StuUserMapper stuUserMapper;
@Autowired
private TchDigitalTradeWeightMapper tchDigitalTradeWeightMapper;
@Autowired
private StuPracticalTrainingReportMapper stuPracticalTrainingReportMapper;
@Override
public ResultEntity selectGeneralViewList(TchGeneralViewDTO tchGeneralViewDTO) {
if (!StringUtils.hasText(tchGeneralViewDTO.getSchoolId()))
{
return new ResultEntity<>(HttpStatus.BAD_REQUEST,"学校ID不能为空");
}
//获取该学校权重数据
TchDigitalTradeWeight tchDigitalTradeWeight = tchDigitalTradeWeightMapper.selectByPrimaryKey(tchGeneralViewDTO.getSchoolId());
//条件查询学生信息根据SchoolID
StuUserExample stuUserExample = new StuUserExample();
stuUserExample.setOrderByClause("total_rank asc");
StuUserExample.Criteria criteria = stuUserExample.createCriteria();
criteria.andSchoolIdEqualTo(tchGeneralViewDTO.getSchoolId()).andDelStateEqualTo(0);
if (tchGeneralViewDTO.getName()!=null)
{
criteria.andNameLike("%"+tchGeneralViewDTO.getName()+"%");
}
if (tchGeneralViewDTO.getClassName()!=null)
{
criteria.andClassNameLike("%"+tchGeneralViewDTO.getClassName()+"%");
}
if (tchGeneralViewDTO.getStudentId()!=null)
{
criteria.andStudentIdLike("%"+tchGeneralViewDTO.getStudentId()+"%");
}
List<StuUser> stuUserList = stuUserMapper.selectByExample(stuUserExample);
if (stuUserList.isEmpty())
{
return new ResultEntity<>(HttpStatus.OK);
}
List<TchGeneralViewDTO> list = new ArrayList();
for (int i = 0; i < stuUserList.size(); i++) {
TchGeneralViewDTO dto = new TchGeneralViewDTO(stuUserList.get(i), tchDigitalTradeWeight);
list.add(dto);
}
PageInfo<TchGeneralViewDTO> pageInfo = new PageInfo<>(list);
return new ResultEntity<>(HttpStatus.OK,pageInfo);
}
@Override
public List generalViewExport(String schoolId) {
if (!StringUtils.hasText(schoolId))
{
return Collections.emptyList();
}
//获取该学校权重数据
TchDigitalTradeWeight tchDigitalTradeWeight = tchDigitalTradeWeightMapper.selectByPrimaryKey(schoolId);
//条件查询学生信息根据SchoolID
StuUserExample stuUserExample = new StuUserExample();
stuUserExample.setOrderByClause("total_rank asc");
StuUserExample.Criteria criteria = stuUserExample.createCriteria();
criteria.andSchoolIdEqualTo(schoolId).andDelStateEqualTo(0);
List<StuUser> stuUserList = stuUserMapper.selectByExample(stuUserExample);
if (stuUserList.isEmpty())
{
return Collections.emptyList();
}
List<TchGeneralViewDTO> list = new ArrayList();
for (int i = 0; i < stuUserList.size(); i++) {
TchGeneralViewDTO dto = new TchGeneralViewDTO(stuUserList.get(i), tchDigitalTradeWeight);
list.add(dto);
}
return list;
}
//成绩总览权重回显
@Override
public ResultEntity getResultsOverviewWeight(String schoolId) {
TchDigitalTradeWeight tchDigitalTradeWeight = tchDigitalTradeWeightMapper.selectByPrimaryKey(schoolId);
return new ResultEntity<>(HttpStatus.OK,tchDigitalTradeWeight);
}
/**
*
* @param weight
* @return
*/
@Override
public ResultEntity setResultsOverviewWeight(TchDigitalTradeWeight weight) {
tchDigitalTradeWeightMapper.updateByPrimaryKeySelective(weight);
return new ResultEntity<>(HttpStatus.OK,"更新成功");
}
//评阅界面
@Override
public PageInfo<StuPracticalTrainingReport> getScoreReport(String schoolId, Integer page, Integer size, String module, String name, String className) {
PageHelper.startPage(page, size);
StuPracticalTrainingReportExample example = new StuPracticalTrainingReportExample();
example.setOrderByClause("rating desc");
StuPracticalTrainingReportExample.Criteria criteria = example.createCriteria();
criteria.andSchoolIdEqualTo(schoolId);
criteria.andModuleEqualTo(module);
criteria.andStatusEqualTo(0);
if (StringUtils.hasText(className)){
criteria.andClassNameEqualTo(className);
}
if (StringUtils.hasText(name)){
criteria.andNameLike("%"+name+"%");
}
if (StringUtils.hasText(name)){
criteria.andStudentIdLike("%"+name+"%");
}
List<StuPracticalTrainingReport> stuPracticalTrainingReportList = stuPracticalTrainingReportMapper.selectByExample(example);
if (stuPracticalTrainingReportList.isEmpty())
{
return new PageInfo<>(Collections.EMPTY_LIST);
}
PageInfo<StuPracticalTrainingReport> stuPracticalTrainingReportPageInfo = new PageInfo<>(stuPracticalTrainingReportList);
return stuPracticalTrainingReportPageInfo;
}
//班级下拉框
@Override
public List<String> getClassNameBySchoolId(String schoolId) {
StuUserExample stuUserExample = new StuUserExample();
stuUserExample.createCriteria().andSchoolIdEqualTo(schoolId).andDelStateEqualTo(0);
List<StuUser> stuUserList = stuUserMapper.selectByExample(stuUserExample);
if (!stuUserList.isEmpty())
{
List<String> stringList = stuUserList.stream().map(StuUser::getClassName).distinct().collect(Collectors.toList());
return stringList;
}
else {
return Collections.emptyList();
}
}
}

@ -14,6 +14,9 @@
<result column="teacher_comments" jdbcType="VARCHAR" property="teacherComments" />
<result column="school_id" jdbcType="VARCHAR" property="schoolId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="student_id" jdbcType="VARCHAR" property="studentId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="class_name" jdbcType="VARCHAR" property="className" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -75,7 +78,7 @@
</sql>
<sql id="Base_Column_List">
id, report_name, upload_time, size, rating, module, user_id, url, socre_id, teacher_comments,
school_id, status
school_id, status, student_id, name, class_name
</sql>
<select id="selectByExample" parameterType="com.sztzjy.trade.entity.StuPracticalTrainingReportExample" resultMap="BaseResultMap">
select
@ -111,12 +114,14 @@
insert into stu_practical_training_report (id, report_name, upload_time,
size, rating, module,
user_id, url, socre_id,
teacher_comments, school_id, status
teacher_comments, school_id, status,
student_id, name, class_name
)
values (#{id,jdbcType=INTEGER}, #{reportName,jdbcType=VARCHAR}, #{uploadTime,jdbcType=TIMESTAMP},
#{size,jdbcType=INTEGER}, #{rating,jdbcType=DOUBLE}, #{module,jdbcType=VARCHAR},
#{userId,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{socreId,jdbcType=INTEGER},
#{teacherComments,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}
#{teacherComments,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{studentId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{className,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.trade.entity.StuPracticalTrainingReport">
@ -158,6 +163,15 @@
<if test="status != null">
status,
</if>
<if test="studentId != null">
student_id,
</if>
<if test="name != null">
name,
</if>
<if test="className != null">
class_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -196,6 +210,15 @@
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="studentId != null">
#{studentId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="className != null">
#{className,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.trade.entity.StuPracticalTrainingReportExample" resultType="java.lang.Long">
@ -243,6 +266,15 @@
<if test="record.status != null">
status = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.studentId != null">
student_id = #{record.studentId,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.className != null">
class_name = #{record.className,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -261,7 +293,10 @@
socre_id = #{record.socreId,jdbcType=INTEGER},
teacher_comments = #{record.teacherComments,jdbcType=VARCHAR},
school_id = #{record.schoolId,jdbcType=VARCHAR},
status = #{record.status,jdbcType=INTEGER}
status = #{record.status,jdbcType=INTEGER},
student_id = #{record.studentId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
class_name = #{record.className,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -302,6 +337,15 @@
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="studentId != null">
student_id = #{studentId,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="className != null">
class_name = #{className,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
@ -317,7 +361,10 @@
socre_id = #{socreId,jdbcType=INTEGER},
teacher_comments = #{teacherComments,jdbcType=VARCHAR},
school_id = #{schoolId,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER}
status = #{status,jdbcType=INTEGER},
student_id = #{studentId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
class_name = #{className,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

@ -131,7 +131,7 @@
#{resultsOfPracticalCaseStudies,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.trade.entity.StuUser">
insert into stu_user
insert IGNORE into stu_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,

Loading…
Cancel
Save