Merge remote-tracking branch 'origin/master'

hehai
shijie 4 years ago
commit 75ad52f100
  1. 118
      .mvn/wrapper/MavenWrapperDownloader.java
  2. BIN
      .mvn/wrapper/maven-wrapper.jar
  3. 2
      .mvn/wrapper/maven-wrapper.properties
  4. 3
      README.md
  5. 4
      src/main/java/com/msdw/tms/api/ExperimentalTeachingControllerApi.java
  6. 102
      src/main/java/com/msdw/tms/controller/ClassTeachingController.java
  7. 12
      src/main/java/com/msdw/tms/controller/ExperimentalProjectController.java
  8. 25
      src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java
  9. 2
      src/main/java/com/msdw/tms/controller/ProjectRecordController.java
  10. 11
      src/main/java/com/msdw/tms/dao/ProjectRecordDao.java
  11. 2
      src/main/java/com/msdw/tms/entity/ExperimentalTeachingEntity.java
  12. 89
      src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java
  13. 2
      src/main/java/com/msdw/tms/entity/vo/ExperimentalTeachingVO.java
  14. 12
      src/main/java/com/msdw/tms/service/ProjectRecordService.java
  15. 38
      src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java
  16. 11
      src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java
  17. 22
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  18. 12
      src/main/resources/application.yml
  19. 774
      src/main/resources/mapper/tms/AchievementManagementDao.xml
  20. 2
      src/main/resources/mapper/tms/ClassTeachingDao.xml
  21. 146
      src/main/resources/mapper/tms/ExperimentalReportDao.xml
  22. 188
      src/main/resources/mapper/tms/ProjectRecordDao.xml

@ -1,118 +0,0 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}

Binary file not shown.

@ -1,2 +0,0 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

@ -1,3 +0,0 @@
# msdw_tms
测评管理系统

@ -2,12 +2,9 @@ package com.msdw.tms.api;
import com.msdw.tms.common.utils.R; import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.ExperimentalTeachingEntity;
import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import java.text.ParseException; import java.text.ParseException;
@ -20,6 +17,7 @@ public interface ExperimentalTeachingControllerApi {
@ApiParam(name = "month", value = "月份:1、近一个月内 3、近三个月内 6、近六个月内", required = false) Integer month, @ApiParam(name = "month", value = "月份:1、近一个月内 3、近三个月内 6、近六个月内", required = false) Integer month,
@ApiParam(name = "type", value = "类型:1、手动发布 2、定时发布", required = false) Integer type, @ApiParam(name = "type", value = "类型:1、手动发布 2、定时发布", required = false) Integer type,
@ApiParam(name = "status", value = "状态:1、待开始 2、进行中 3、已结束", required = false) Integer status, @ApiParam(name = "status", value = "状态:1、待开始 2、进行中 3、已结束", required = false) Integer status,
@ApiParam(name = "systemId", value = "系统id", required = false) Integer systemId,
@ApiParam(name = "startTime", value = "开始时间", required = false) String startTime, @ApiParam(name = "startTime", value = "开始时间", required = false) String startTime,
@ApiParam(name = "stopTime", value = "结束时间", required = false) String stopTime, @ApiParam(name = "stopTime", value = "结束时间", required = false) String stopTime,
@ApiParam(name = "searchContent", value = "搜索内容", required = false) String searchContent, @ApiParam(name = "searchContent", value = "搜索内容", required = false) String searchContent,

@ -43,58 +43,61 @@ public class ClassTeachingController implements ClassTeachingApi {
*/ */
@Override @Override
@GetMapping("userRecord") @GetMapping("userRecord")
public R queryTestRecord(@RequestParam Integer page, @RequestParam Integer size, Integer month,String startTime,String endTime, public R queryTestRecord(@RequestParam Integer page, @RequestParam Integer size, Integer month, String startTime, String endTime,
String condition, @RequestParam Integer status,@RequestParam Integer schoolId){ String condition, @RequestParam Integer status, @RequestParam Integer schoolId) {
ProjectRecordVo recordVo = new ProjectRecordVo(); ProjectRecordVo recordVo = new ProjectRecordVo();
if (status==1||status==2||status==3) {//限定实验状态 if (status == 1 || status == 2 || status == 3) {//限定实验状态
recordVo.setStatus(status); recordVo.setStatus(status);
}else{//不限定实验状态 } else {//不限定实验状态
recordVo.setStatus(null); recordVo.setStatus(null);
} }
if(!StringUtils.isEmpty(condition)){ if (!StringUtils.isEmpty(condition)) {
recordVo.setCondition(condition); recordVo.setCondition(condition);
}
if (!StringUtils.isEmpty(month)) {
recordVo.setMonth(month);
} else {
recordVo.setMonth(null);
if (!StringUtils.isEmpty(startTime)) {
recordVo.setStartTime(startTime);
} }
if(!StringUtils.isEmpty(month)) { if (!StringUtils.isEmpty(endTime)) {
recordVo.setMonth(month); recordVo.setEndTime(endTime);
}else {
recordVo.setMonth(null);
if(!StringUtils.isEmpty(startTime)) {
recordVo.setStartTime(startTime);
}if(!StringUtils.isEmpty(endTime)) {
recordVo.setEndTime(endTime);
}
} }
recordVo.setSchoolId(schoolId); }
PageUtils page1 = classTeachingService.queryClassRecord(page,size,recordVo); recordVo.setSchoolId(schoolId);
return R.ok().put("page", page1); PageUtils page1 = classTeachingService.queryClassRecord(page, size, recordVo);
return R.ok().put("page", page1);
} }
/** /**
* 校验是否需要输入邀请码 * 校验是否需要输入邀请码
*
* @param userId * @param userId
* @param projectId * @param projectId
* @return * @return
*/ */
@Override @Override
@GetMapping("/checkInvitationCode") @GetMapping("/checkInvitationCode")
public R check(@RequestParam Integer userId,@RequestParam("id") Integer projectId){ public R check(@RequestParam Integer userId, @RequestParam("id") Integer projectId) {
List o = experimentalStudentService.queryIsCode(userId,projectId); List o = experimentalStudentService.queryIsCode(userId, projectId);
if (o.size()>0){ if (o.size() > 0) {
return R.ok(); return R.ok();
}else{ } else {
return R.error(200,"false"); return R.error(200, "false");
} }
} }
/** /**
* 通过邀请码进入实验 * 通过邀请码进入实验
*
* @param * @param
* @return * @return
*/ */
@Override @Override
@Transactional @Transactional
@PostMapping("/joinPractice") @PostMapping("/joinPractice")
public R joinPractice(@RequestBody ExperimentalTeachingEntity entity1){ public R joinPractice(@RequestBody ExperimentalTeachingEntity entity1) {
//获取参数 //获取参数
Integer projectId = entity1.getProjectId(); Integer projectId = entity1.getProjectId();
Integer id = entity1.getId(); Integer id = entity1.getId();
@ -106,58 +109,61 @@ public class ClassTeachingController implements ClassTeachingApi {
// Integer ICode = experimentalStudentService.queryIsCode(userId);//获取iscode信息, // Integer ICode = experimentalStudentService.queryIsCode(userId);//获取iscode信息,
//if (isCode==0) //if (isCode==0)
if (invitationCode!=null){ if (invitationCode != null) {
entity.setId(id); entity.setId(id);
// entity.setProjectId(projectId); // entity.setProjectId(projectId);
ExperimentalTeachingEntity result= classTeachingService.queryInvitationcode(entity);//邀请码唯一 ExperimentalTeachingEntity result = classTeachingService.queryInvitationcode(entity);//邀请码唯一
Integer code = result.getInvitationCode(); Integer code = result.getInvitationCode();
if (invitationCode.equals(code)==true){ if (invitationCode.equals(code) == true) {
ExperimentalStudentEntity student = studentEntity.setUserId(userId).setProjectId(id); ExperimentalStudentEntity student = studentEntity.setUserId(userId).setProjectId(id);
experimentalStudentService.saveCode(student); experimentalStudentService.saveCode(student);
return R.ok(); return R.ok();
}else{ } else {
return R.error("邀请码错误,验证失败!!!"); return R.error("邀请码错误,验证失败!!!");
}
}else{
return R.error(400,"邀请码格式错误!!!");
} }
} else {
return R.error(400, "邀请码格式错误!!!");
} }
}
/** /**
* 查看虚拟仿真课程列表信息 * 查看虚拟仿真课程列表信息
*
* @param page * @param page
* @param size * @param size
* @return * @return
*/ */
@Override @Override
@GetMapping("/simulationPlayList") @GetMapping("/simulationPlayList")
public R querySimulationPlayList(@RequestParam Integer page,@RequestParam Integer size){ public R querySimulationPlayList(@RequestParam Integer page, @RequestParam Integer size) {
PageUtils page1 = classTeachingService.querySimulationPlayList(page,size); PageUtils page1 = classTeachingService.querySimulationPlayList(page, size);
return R.ok().put("data",page1); return R.ok().put("data", page1);
} }
/** /**
* 学生查看实验报告 * 学生查看实验报告(教学)
*
* @param * @param
* @return * @return
*/ */
@Override @Override
@GetMapping("/queryExperimentalReport") @GetMapping("/queryExperimentalReport")
public R queryExperimentalReport(@RequestParam Integer studentId,@RequestParam Integer projectId,@RequestParam Integer recordId,@RequestParam Integer reportId){ public R queryExperimentalReport(@RequestParam Integer studentId, @RequestParam Integer projectId, @RequestParam Integer recordId, @RequestParam Integer reportId) {
ExperimentalReportVo entity = new ExperimentalReportVo(); ExperimentalReportVo entity = new ExperimentalReportVo();
R result = experimentalReportService.queryReport(studentId,projectId,recordId,reportId); R result = experimentalReportService.queryReport(studentId, projectId, recordId, reportId);
return result; return result;
} }
/** /**
* 学生查看虚拟实验报告 * 学生查看虚拟实验报告(虚仿)
*
* @param * @param
* @return * @return
*/ */
@Override @Override
@GetMapping("/queryVirtualReport") @GetMapping("/queryVirtualReport")
public R queryVirtualReport(@RequestParam Integer recordId){ public R queryVirtualReport(@RequestParam Integer recordId) {
R result = experimentalReportService.queryVirtualReport(recordId); R result = experimentalReportService.queryVirtualReport(recordId);
return result; return result;
} }

@ -2,26 +2,16 @@ package com.msdw.tms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.msdw.tms.api.ExperimentalProjectControllerApi; import com.msdw.tms.api.ExperimentalProjectControllerApi;
import com.msdw.tms.api.ExperimentalTeachingControllerApi;
import com.msdw.tms.api.UserControllerApi;
import com.msdw.tms.common.utils.Constant; import com.msdw.tms.common.utils.Constant;
import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.common.utils.R; import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.ExperimentalProjectEntity; import com.msdw.tms.entity.ExperimentalProjectEntity;
import com.msdw.tms.entity.ExperimentalTeachingEntity;
import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.ExperimentalProjectEntityVO; import com.msdw.tms.entity.vo.ExperimentalProjectEntityVO;
import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO;
import com.msdw.tms.entity.vo.UserEntityVo;
import com.msdw.tms.service.ExperimentalProjectService; import com.msdw.tms.service.ExperimentalProjectService;
import com.msdw.tms.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping("tms/project") @RequestMapping("tms/project")
@ -40,7 +30,7 @@ public class ExperimentalProjectController implements ExperimentalProjectControl
return R.ok().put("experimental_project_name", one); return R.ok().put("experimental_project_name", one);
} }
/** /**nm
* 根据id查询实验班级详情 * 根据id查询实验班级详情
*/ */
@GetMapping("/getById/{id}") @GetMapping("/getById/{id}")

@ -2,24 +2,20 @@ package com.msdw.tms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.msdw.tms.api.ExperimentalTeachingControllerApi; import com.msdw.tms.api.ExperimentalTeachingControllerApi;
import com.msdw.tms.api.UserControllerApi;
import com.msdw.tms.common.utils.Constant; import com.msdw.tms.common.utils.Constant;
import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.common.utils.R; import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.ExperimentalTeachingEntity;
import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO;
import com.msdw.tms.entity.vo.ExperimentalTeachingVO; import com.msdw.tms.entity.vo.ExperimentalTeachingVO;
import com.msdw.tms.entity.vo.UserEntityVo;
import com.msdw.tms.service.ExperimentalTeachingService; import com.msdw.tms.service.ExperimentalTeachingService;
import com.msdw.tms.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
@RestController @RestController
@RequestMapping("tms/exp") @RequestMapping("tms/exp")
@ -32,6 +28,7 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr
/** /**
* 根据id查询实验班级详情 * 根据id查询实验班级详情
*/ */
@Override
@GetMapping("/getById/{id}") @GetMapping("/getById/{id}")
public R getById(@PathVariable("id") Integer id){ public R getById(@PathVariable("id") Integer id){
ExperimentalTeachingEntity et = experimentalTeachingService.getById(id); ExperimentalTeachingEntity et = experimentalTeachingService.getById(id);
@ -40,6 +37,7 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr
/** /**
* 根据邀请码查询 * 根据邀请码查询
*/ */
@Override
@GetMapping("/getInvitationCode") @GetMapping("/getInvitationCode")
public R getInvitationCode(@RequestParam Integer invitationCode) { public R getInvitationCode(@RequestParam Integer invitationCode) {
ExperimentalTeachingEntity one = experimentalTeachingService.getOne(new QueryWrapper<ExperimentalTeachingEntity>().eq("invitation_code", invitationCode) ExperimentalTeachingEntity one = experimentalTeachingService.getOne(new QueryWrapper<ExperimentalTeachingEntity>().eq("invitation_code", invitationCode)
@ -49,15 +47,19 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr
/** /**
* 查询 * 查询
*/ */
@Override
@GetMapping("/list") @GetMapping("/list")
public R list(@RequestParam Integer page, public R list(@RequestParam Integer page, @RequestParam Integer size,
@RequestParam Integer size, Integer month, Integer type, Integer status,Integer systemId, String startTime,
Integer month, Integer type, Integer status, String startTime, String stopTime, String searchContent,@RequestParam Integer schoolId){ String stopTime, String searchContent,@RequestParam Integer schoolId){
ExperimentalTeachingVO vo = new ExperimentalTeachingVO(); ExperimentalTeachingVO vo = new ExperimentalTeachingVO();
vo.setSchoolId(schoolId); vo.setSchoolId(schoolId);
if (month!=null){ if (month!=null){
vo.setMonth(month); vo.setMonth(month);
} }
if (systemId!=null){
vo.setSystemId(systemId);
}
if (type!=null){ if (type!=null){
vo.setType(type); vo.setType(type);
} }
@ -80,6 +82,7 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr
/** /**
* 保存 * 保存
*/ */
@Override
@PostMapping("/save") @PostMapping("/save")
public R save(@RequestBody ExperimentalTeachingEntity experimentalTeachingEntity){ public R save(@RequestBody ExperimentalTeachingEntity experimentalTeachingEntity){
experimentalTeachingService.save(experimentalTeachingEntity); experimentalTeachingService.save(experimentalTeachingEntity);
@ -89,6 +92,7 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr
/** /**
* 修改 * 修改
*/ */
@Override
@PostMapping("/update") @PostMapping("/update")
public R update(@RequestBody ExperimentalTeachingEntity experimentalTeachingEntity) throws ParseException { public R update(@RequestBody ExperimentalTeachingEntity experimentalTeachingEntity) throws ParseException {
//添加实验结束时间 //添加实验结束时间
@ -117,6 +121,7 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr
/** /**
* 删除 * 删除
*/ */
@Override
@PostMapping("/delete") @PostMapping("/delete")
public R delete(@RequestBody Integer[] ids){ public R delete(@RequestBody Integer[] ids){
experimentalTeachingService.removeByIds(Arrays.asList(ids)); experimentalTeachingService.removeByIds(Arrays.asList(ids));

@ -64,7 +64,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
@Override @Override
@GetMapping("/user/record") @GetMapping("/user/record")
public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userId,@RequestParam Integer projectPermissions){ public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userId,@RequestParam Integer projectPermissions){
PageUtils page1 = projectRecordService.queryPage(page,size,userId,projectPermissions); PageUtils page1 = projectRecordService.queryPage(page,size,userId);
return R.ok().put("data", page1); return R.ok().put("data", page1);
} }

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.msdw.tms.entity.ExperimentalProjectEntity; import com.msdw.tms.entity.ExperimentalProjectEntity;
import com.msdw.tms.entity.ExperimentalReportEntity; import com.msdw.tms.entity.ExperimentalReportEntity;
import com.msdw.tms.entity.ProjectRecordEntity; import com.msdw.tms.entity.ProjectRecordEntity;
import com.msdw.tms.entity.resp.GetByUserRecordResp;
import com.msdw.tms.entity.vo.ProjectRecordExportVo; import com.msdw.tms.entity.vo.ProjectRecordExportVo;
import com.msdw.tms.entity.vo.ProjectRecordVo; import com.msdw.tms.entity.vo.ProjectRecordVo;
import com.msdw.tms.entity.vo.RecordVo; import com.msdw.tms.entity.vo.RecordVo;
@ -15,8 +16,6 @@ import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
/** /**
*
*
* @author * @author
* @email * @email
* @date 2020-08-19 16:07:02 * @date 2020-08-19 16:07:02
@ -24,17 +23,17 @@ import java.util.List;
@Mapper @Mapper
public interface ProjectRecordDao extends BaseMapper<ProjectRecordEntity> { public interface ProjectRecordDao extends BaseMapper<ProjectRecordEntity> {
IPage<ProjectRecordVo> getByUserRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity,Integer projectPermissions); IPage<GetByUserRecordResp> getByUserRecord(Page page, @Param("userId") Integer userId);
IPage<ProjectRecordVo> getByUserExperimentRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity); IPage<ProjectRecordVo> getByUserExperimentRecord(Page page, @Param("pro") ProjectRecordEntity projectRecordEntity);
List<ProjectRecordExportVo> getByUserRecordImport(ProjectRecordEntity projectRecordEntity); List<ProjectRecordExportVo> getByUserRecordImport(ProjectRecordEntity projectRecordEntity);
ProjectRecordVo getByUserScore(@Param("userid") Integer userId,@Param("isdel") Integer isdel); ProjectRecordVo getByUserScore(@Param("userid") Integer userId, @Param("isdel") Integer isdel);
ProjectRecordVo queryScore(@Param("userId") Integer userId); ProjectRecordVo queryScore(@Param("userId") Integer userId);
IPage<ProjectRecordVo> getBySchoolRecord(Page page,@Param("pro") ProjectRecordVo projectRecord); IPage<ProjectRecordVo> getBySchoolRecord(Page page, @Param("pro") ProjectRecordVo projectRecord);
boolean updateUserRecord(ProjectRecordEntity projectRecord); boolean updateUserRecord(ProjectRecordEntity projectRecord);

@ -45,6 +45,8 @@ public class ExperimentalTeachingEntity {
private Integer isCode; private Integer isCode;
//绑定用户Id //绑定用户Id
private Integer userId; private Integer userId;
//绑定系统Id
private Integer systemId;
//创建时间 //创建时间
private String creationTime; private String creationTime;
//实验倒计时 //实验倒计时

@ -0,0 +1,89 @@
package com.msdw.tms.entity.resp;
import lombok.Data;
/**
* @ProjectName: tms
* @Package: com.msdw.tms.entity.resp
* @ClassName: GetByUserRecordResp
* @Description: java类作用描述
* @Author: Maureen.Rong
* @CreateDate: 2021/2/25 15:26
* @UpdateDate: 2021/2/25 15:26
* @Version: 1.0
*/
public class GetByUserRecordResp {
private String projectName;
private Integer recordId;
private Integer score;
private Integer codeId;
private String startingTime;
private String submitTime;
private Integer timeSum;
private Integer userId;
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public Integer getRecordId() {
return recordId;
}
public void setRecordId(Integer recordId) {
this.recordId = recordId;
}
public Integer getScore() {
return score;
}
public void setScore(Integer score) {
this.score = score;
}
public Integer getCodeId() {
return codeId;
}
public void setCodeId(Integer codeId) {
this.codeId = codeId;
}
public String getStartingTime() {
return startingTime;
}
public void setStartingTime(String startingTime) {
this.startingTime = startingTime;
}
public String getSubmitTime() {
return submitTime;
}
public void setSubmitTime(String submitTime) {
this.submitTime = submitTime;
}
public Integer getTimeSum() {
return timeSum;
}
public void setTimeSum(Integer timeSum) {
this.timeSum = timeSum;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
}

@ -18,4 +18,6 @@ public class ExperimentalTeachingVO {
private Integer status; private Integer status;
//学校id //学校id
private Integer schoolId; private Integer schoolId;
//绑定系统Id
private Integer systemId;
} }

@ -11,27 +11,25 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
*
*
* @author * @author
* @email * @email
* @date 2020-08-19 16:07:02 * @date 2020-08-19 16:07:02
*/ */
public interface ProjectRecordService extends IService<ProjectRecordEntity> { public interface ProjectRecordService extends IService<ProjectRecordEntity> {
PageUtils queryPage(Integer page,Integer size,Integer userId,Integer projectPermissions); PageUtils queryPage(Integer page, Integer size, Integer userId);
PageUtils queryExperimentPage(Integer page,Integer size,Integer userid); PageUtils queryExperimentPage(Integer page, Integer size, Integer userid);
ProjectRecordVo queryUserScore(Integer userId); ProjectRecordVo queryUserScore(Integer userId);
ProjectRecordVo queryScore(Integer userId); ProjectRecordVo queryScore(Integer userId);
void exportProjectRecord(HttpServletResponse response, Integer userId)throws Exception; void exportProjectRecord(HttpServletResponse response, Integer userId) throws Exception;
void exportExperimentProjectRecord(HttpServletResponse response, Integer userId)throws Exception; void exportExperimentProjectRecord(HttpServletResponse response, Integer userId) throws Exception;
PageUtils querySchoolRecord(Integer page,Integer size,ProjectRecordVo projectRecord); PageUtils querySchoolRecord(Integer page, Integer size, ProjectRecordVo projectRecord);
boolean updateUserRecord(ProjectRecordEntity projectRecord); boolean updateUserRecord(ProjectRecordEntity projectRecord);

@ -15,7 +15,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
@Service @Service
public class ExperimentalReportServiceImpl extends ServiceImpl<ExperimentalReportDao,ExperimentalReportEntity> implements ExperimentalReportService { public class ExperimentalReportServiceImpl extends ServiceImpl<ExperimentalReportDao, ExperimentalReportEntity> implements ExperimentalReportService {
@Autowired @Autowired
private ExperimentalReportDao reportDao; private ExperimentalReportDao reportDao;
@ -23,37 +23,47 @@ public class ExperimentalReportServiceImpl extends ServiceImpl<ExperimentalRepor
@Autowired @Autowired
private AchievementManagementDao achievementManagementDao; private AchievementManagementDao achievementManagementDao;
/**
* 学生查看实验报告(教学)
*
* @param studentId
* @param projectId
* @param recordId
* @param reportId
* @return
*/
@Override @Override
public R queryReport(Integer studentId,Integer projectId,Integer recordId,Integer reportId) { public R queryReport(Integer studentId, Integer projectId, Integer recordId, Integer reportId) {
Integer systemId =reportDao.querySystemId(recordId); Integer systemId = reportDao.querySystemId(recordId);
ExperimentalReportVo entity = new ExperimentalReportVo(); ExperimentalReportVo entity = new ExperimentalReportVo();
entity.setRecordId(recordId).setStudentId(studentId).setProjectId(projectId).setReportId(reportId); entity.setRecordId(recordId).setStudentId(studentId).setProjectId(projectId).setReportId(reportId);
ExperimentalReportVo result = reportDao.queryReport(entity); ExperimentalReportVo result = reportDao.queryReport(entity);
//python实验 //python实验
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("report",result); map.put("report", result);
if(systemId==1|systemId==4|systemId==5){ if (systemId == 1 | systemId == 4 | systemId == 5) {
List<AchievementManagementVO> data = achievementManagementDao.queryPythonTest(recordId); List<AchievementManagementVO> data = achievementManagementDao.queryPythonTest(recordId);
map.put("data",data); map.put("data", data);
return R.ok().put("data",map); return R.ok().put("data", map);
} }
return R.ok().put("data",map); return R.ok().put("data", map);
} }
//虚拟实验
@Override @Override
public R queryVirtualReport(Integer recordId) { public R queryVirtualReport(Integer recordId) {
ExperimentalReportVo result = reportDao.queryVirtualReport(recordId); ExperimentalReportVo result = reportDao.queryVirtualReport(recordId);
Integer systemId =reportDao.querySystemId(recordId); Integer systemId = reportDao.querySystemId(recordId);
//python实验 //python实验
if(systemId==1|systemId==4|systemId==5){ if (systemId == 1 | systemId == 4 | systemId == 5) {
List<AchievementManagementVO> data = achievementManagementDao.queryPythonTest(recordId); List<AchievementManagementVO> data = achievementManagementDao.queryPythonTest(recordId);
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("data",data); map.put("data", data);
map.put("report",result); map.put("report", result);
return R.ok().put("data",map); return R.ok().put("data", map);
} }
return R.ok().put("data",result); return R.ok().put("data", result);
} }
} }

@ -1,31 +1,20 @@
package com.msdw.tms.service.impl; package com.msdw.tms.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.msdw.tms.common.utils.Constant;
import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.common.utils.Query;
import com.msdw.tms.dao.ClassTeachingDao; import com.msdw.tms.dao.ClassTeachingDao;
import com.msdw.tms.dao.ExperimentalTeachingDao; import com.msdw.tms.dao.ExperimentalTeachingDao;
import com.msdw.tms.dao.UserDao;
import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.ExperimentalTeachingEntity;
import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO;
import com.msdw.tms.entity.vo.ExperimentalTeachingVO; import com.msdw.tms.entity.vo.ExperimentalTeachingVO;
import com.msdw.tms.entity.vo.ProjectRecordVo; import com.msdw.tms.entity.vo.ProjectRecordVo;
import com.msdw.tms.entity.vo.UserEntityVo;
import com.msdw.tms.service.ExperimentalTeachingService; import com.msdw.tms.service.ExperimentalTeachingService;
import com.msdw.tms.service.UserService;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@Service("experimentalTeachingService") @Service("experimentalTeachingService")
public class ExperimentalTeachingServiceImpl extends ServiceImpl<ExperimentalTeachingDao, ExperimentalTeachingEntity> implements ExperimentalTeachingService { public class ExperimentalTeachingServiceImpl extends ServiceImpl<ExperimentalTeachingDao, ExperimentalTeachingEntity> implements ExperimentalTeachingService {

@ -12,6 +12,7 @@ import com.msdw.tms.entity.ExperimentalReportEntity;
import com.msdw.tms.entity.ProjectRecordEntity; import com.msdw.tms.entity.ProjectRecordEntity;
import com.msdw.tms.entity.request.ExperimentProjectRecordImportRequest; import com.msdw.tms.entity.request.ExperimentProjectRecordImportRequest;
import com.msdw.tms.entity.request.ProjectRecordImportRequest; import com.msdw.tms.entity.request.ProjectRecordImportRequest;
import com.msdw.tms.entity.resp.GetByUserRecordResp;
import com.msdw.tms.entity.vo.ProjectRecordExportVo; import com.msdw.tms.entity.vo.ProjectRecordExportVo;
import com.msdw.tms.entity.vo.ProjectRecordVo; import com.msdw.tms.entity.vo.ProjectRecordVo;
import com.msdw.tms.service.ProjectRecordService; import com.msdw.tms.service.ProjectRecordService;
@ -37,14 +38,15 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
@Override @Override
public PageUtils queryPage(Integer page,Integer size,Integer userId,Integer projectPermissions) { public PageUtils queryPage(Integer page, Integer size, Integer userId) {
ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userId); /*GetByUserRecordResp projectRecord = new GetByUserRecordResp();
projectRecord.setUserId(userId);*/
//分页对象 //分页对象
Page<T> page1 = new Page<>(page, size); Page<T> page1 = new Page<>(page, size);
IPage<ProjectRecordVo> projectRecordVos = this.baseMapper.getByUserRecord(page1,projectRecord,projectPermissions); IPage<GetByUserRecordResp> projectRecordVos = this.baseMapper.getByUserRecord(page1, userId);
PageUtils questionsPage = new PageUtils(projectRecordVos); PageUtils questionsPage = new PageUtils(projectRecordVos);
@ -59,7 +61,7 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
//分页对象 //分页对象
Page<T> page1 = new Page<>(page, size); Page<T> page1 = new Page<>(page, size);
IPage<ProjectRecordVo> projectRecordVos = this.baseMapper.getByUserExperimentRecord(page1,projectRecord); IPage<ProjectRecordVo> projectRecordVos = this.baseMapper.getByUserExperimentRecord(page1, projectRecord);
PageUtils questionsPage = new PageUtils(projectRecordVos); PageUtils questionsPage = new PageUtils(projectRecordVos);
@ -70,9 +72,9 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
public ProjectRecordVo queryUserScore(Integer userId) { public ProjectRecordVo queryUserScore(Integer userId) {
Integer isdel = Constant.IsDel.NOT_DEL.getType(); Integer isdel = Constant.IsDel.NOT_DEL.getType();
ProjectRecordVo projectRecordVo = this.baseMapper.getByUserScore(userId ,isdel); ProjectRecordVo projectRecordVo = this.baseMapper.getByUserScore(userId, isdel);
Double totalTime = projectRecordVo.getTotalTime(); Double totalTime = projectRecordVo.getTotalTime();
if (totalTime!=null) { if (totalTime != null) {
DecimalFormat df = new DecimalFormat("0.00"); DecimalFormat df = new DecimalFormat("0.00");
double time = totalTime / 60; double time = totalTime / 60;
String format = df.format(time); String format = df.format(time);
@ -80,17 +82,17 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
} }
return projectRecordVo; return projectRecordVo;
} }
@Override @Override
public ProjectRecordVo queryScore(Integer userId) { public ProjectRecordVo queryScore(Integer userId) {
ProjectRecordVo projectRecordVo = this.baseMapper.queryScore(userId); ProjectRecordVo projectRecordVo = this.baseMapper.queryScore(userId);
return projectRecordVo; return projectRecordVo;
} }
@Override @Override
public void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception{ public void exportProjectRecord(HttpServletResponse response, Integer userId) throws Exception {
//获取数据 //获取数据
ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userId).setIsdel(Constant.IsDel.NOT_DEL.getType()); ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userId).setIsdel(Constant.IsDel.NOT_DEL.getType());
@ -122,7 +124,7 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
* 导出个人教学试验记录 * 导出个人教学试验记录
*/ */
@Override @Override
public void exportExperimentProjectRecord(HttpServletResponse response,Integer userId)throws Exception{ public void exportExperimentProjectRecord(HttpServletResponse response, Integer userId) throws Exception {
//获取数据 //获取数据
ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userId).setIsdel(Constant.IsDel.NOT_DEL.getType()); ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userId).setIsdel(Constant.IsDel.NOT_DEL.getType());

@ -5,12 +5,12 @@ spring:
# url: jdbc:mysql://www.liuwanr.cn:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai # url: jdbc:mysql://www.liuwanr.cn:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
# username: super # username: super
# password: huoran888 # password: huoran888
# url: jdbc:mysql://rm-wz9y13wf7u8q8610fwo.mysql.rds.aliyuncs.com:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai url: jdbc:mysql://rm-wz9y13wf7u8q8610fwo.mysql.rds.aliyuncs.com:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
# username: super username: super
# password: huoran888 password: huoran888
url: jdbc:mysql://localhost:3306/msdw_tms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai # url: jdbc:mysql://localhost:3306/msdw_tms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: root # username: root
password: root # password: root
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
# redis: # redis:
# host: www.liuwanr.cn # host: www.liuwanr.cn

@ -2,378 +2,442 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.msdw.tms.dao.AchievementManagementDao"> <mapper namespace="com.msdw.tms.dao.AchievementManagementDao">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.msdw.tms.entity.ExperimentalReportEntity"> <resultMap id="BaseResultMap" type="com.msdw.tms.entity.ExperimentalReportEntity">
<id column="reportId" property="reportId"/> <id column="reportId" property="reportId"/>
<result column="projectId" property="projectId"/> <result column="projectId" property="projectId"/>
<result column="principle" property="principle"/> <result column="principle" property="principle"/>
<result column="content" property="content"/> <result column="content" property="content"/>
<result column="data" property="data"/> <result column="data" property="data"/>
<result column="analysis" property="analysis"/> <result column="analysis" property="analysis"/>
<result column="conclusion" property="conclusion"/> <result column="conclusion" property="conclusion"/>
<result column="summarize" property="summarize"/> <result column="summarize" property="summarize"/>
<result column="purpose" property="purpose"/> <result column="purpose" property="purpose"/>
<result column="improvement" property="improvement"/> <result column="improvement" property="improvement"/>
<result column="comment" property="comment"/> <result column="comment" property="comment"/>
<result column="studentId" property="studentId"/> <result column="studentId" property="studentId"/>
<result column="teacherName" property="teacherName"/> <result column="teacherName" property="teacherName"/>
<result column="period" property="period"/> <result column="period" property="period"/>
<result column="laboratory" property="laboratory"/> <result column="laboratory" property="laboratory"/>
<result column="equipment" property="equipment"/> <result column="equipment" property="equipment"/>
<result column="score" property="score"/> <result column="score" property="score"/>
<result column="timeConsuming" property="timeConsuming"/> <result column="timeConsuming" property="timeConsuming"/>
<result column="startTime" property="startTime"/> <result column="startTime" property="startTime"/>
<result column="creationTime" property="creationTime"/> <result column="creationTime" property="creationTime"/>
<result column="className" property="className"/> <result column="className" property="className"/>
<result column="steps1" property="steps1"/> <result column="steps1" property="steps1"/>
<result column="steps2" property="steps2"/> <result column="steps2" property="steps2"/>
<result column="steps3" property="steps3"/> <result column="steps3" property="steps3"/>
<result column="steps4" property="steps4"/> <result column="steps4" property="steps4"/>
<result column="steps5" property="steps5"/> <result column="steps5" property="steps5"/>
<result column="steps6" property="steps6"/> <result column="steps6" property="steps6"/>
<result column="steps7" property="steps7"/> <result column="steps7" property="steps7"/>
<result column="steps8" property="steps8"/> <result column="steps8" property="steps8"/>
<result column="steps9" property="steps9"/> <result column="steps9" property="steps9"/>
<result column="steps10" property="steps10"/> <result column="steps10" property="steps10"/>
<result column="projectName" property="projectName"/> <result column="projectName" property="projectName"/>
<result column="workNumber" property="workNumber"/> <result column="workNumber" property="workNumber"/>
</resultMap> </resultMap>
<select id="getReport" resultMap="BaseResultMap" parameterType="com.msdw.tms.entity.ExperimentalReportEntity"> <select id="getReport" resultMap="BaseResultMap" parameterType="com.msdw.tms.entity.ExperimentalReportEntity">
SELECT her.*,pm.projectName,s.workNumber FROM SELECT her.*, pm.projectName, s.workNumber
hr_experimental_report her,hr_project_management pm,student s FROM hr_experimental_report her,
WHERE her.reportId = #{reportId} and her.studentId = #{studentId} and her.projectId = pm.projectId and her.studentId = s.userId hr_project_management pm,
student s
WHERE her.reportId = #{reportId}
and her.studentId = #{studentId}
and her.projectId = pm.projectId
and her.studentId = s.userId
</select> </select>
<select id="getScore" resultType="com.msdw.tms.entity.vo.UserScoreVO" parameterType="com.msdw.tms.entity.vo.UserScoreVO"> <select id="getScore" resultType="com.msdw.tms.entity.vo.UserScoreVO"
SELECT id,score,tradingJudgmentPointsId,projectId,systemId,userId,isCorrect,reportId,userAnswers parameterType="com.msdw.tms.entity.vo.UserScoreVO">
FROM hr_user_score WHERE reportId = #{reportId} and userId = #{userId} SELECT id,
</select> score,
tradingJudgmentPointsId,
projectId,
systemId,
userId,
isCorrect,
reportId,
userAnswers
FROM hr_user_score
WHERE reportId = #{reportId}
and userId = #{userId}
</select>
<!-- <resultMap id="achievementMap" type="com.msdw.tms.entity.ExperimentalReportEntity">--> <!-- <resultMap id="achievementMap" type="com.msdw.tms.entity.ExperimentalReportEntity">-->
<!-- <result property="experimentalClassName" column="experimental_class_name"></result>--> <!-- <result property="experimentalClassName" column="experimental_class_name"></result>-->
<!-- </resultMap>--> <!-- </resultMap>-->
<insert id="addReport" useGeneratedKeys="true" keyProperty="reportId"> <insert id="addReport" useGeneratedKeys="true" keyProperty="reportId">
INSERT INTO hr_experimental_report( projectId, content, principle, step, analysis, summarize, improvement, INSERT INTO hr_experimental_report(projectId, content, principle, step, analysis, summarize, improvement,
commentId, studentId, period,laboratory,className,steps1,steps2,steps3,steps4,steps5,steps6,steps7,steps8,steps9,steps10,timeConsuming,startTime,creationTime,purpose,teacherName) commentId, studentId, period, laboratory, className, steps1, steps2, steps3,
VALUES steps4, steps5, steps6, steps7, steps8, steps9, steps10, timeConsuming,
(#{projectId},#{content}, #{principle}, #{step}, #{analysis}, #{summarize}, #{improvement}, #{commentId}, #{studentId}, startTime, creationTime, purpose, teacherName)
#{period}, #{laboratory},#{className},#{steps1},#{steps2},#{steps3},#{steps4},#{steps5},#{steps6},#{steps7},#{steps8},#{steps9},#{steps10},#{timeConsuming},#{startTime},#{creationTime},#{purpose},#{teacherName}) VALUES (#{projectId}, #{content}, #{principle}, #{step}, #{analysis}, #{summarize}, #{improvement},
#{commentId}, #{studentId},
#{period}, #{laboratory}, #{className}, #{steps1}, #{steps2}, #{steps3}, #{steps4}, #{steps5},
#{steps6}, #{steps7}, #{steps8}, #{steps9}, #{steps10}, #{timeConsuming}, #{startTime}, #{creationTime},
#{purpose}, #{teacherName})
</insert> </insert>
<update id="deleteReport"> <update id="deleteReport">
UPDATE tms_project_record tpr,hr_experimental_report tcr SET tpr.isdel = 1 , tcr.isdel = 1 WHERE tpr.recordId = tcr.eventId AND tcr.reportId = #{reportId} UPDATE tms_project_record tpr,hr_experimental_report tcr
SET tpr.isdel = 1, tcr.isdel = 1
WHERE tpr.recordId = tcr.eventId AND tcr.reportId = #{reportId}
</update>
<update id="updateComment">
UPDATE tms_experimental_report
SET `comment` = #{comment}
WHERE reportId = #{reportId}
</update> </update>
<update id="updateComment">
UPDATE tms_experimental_report SET `comment` = #{comment} WHERE reportId = #{reportId}
</update>
<update id="updateSignatrue"> <update id="updateSignatrue">
UPDATE tms_experimental_report SET isSignature = #{isSignature} , signatureId = #{signatureId}, `comment` = #{comment} WHERE reportId = #{reportId} UPDATE tms_experimental_report
</update> SET isSignature = #{isSignature},
<select id="queryReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVO"> signatureId = #{signatureId},
SELECT `comment` = #{comment}
ter.reportId, WHERE reportId = #{reportId}
IFNULL( ter.`comment`, ( SELECT `comment` FROM tms_comment WHERE id = commentId ) ) AS comment, </update>
ter.projectId, <select id="queryReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
ter.principle, SELECT ter.reportId,
ter.content, IFNULL(ter.`comment`, (SELECT `comment` FROM tms_comment WHERE id = commentId)) AS comment,
ter.step, ter.projectId,
ter.`data`, ter.principle,
ter.analysis, ter.content,
ter.conclusion, ter.step,
ter.summarize, ter.`data`,
ter.improvement, ter.analysis,
ter.commentId, ter.conclusion,
ter.studentId, ter.summarize,
ter.teacherName, ter.improvement,
ter.period, ter.commentId,
ter.laboratory, ter.studentId,
ter.eventId, ter.teacherName,
ter.isSignature, ter.period,
ter.signatureId, ter.laboratory,
ter.isdel , ter.eventId,
hpm.projectName, ter.isSignature,
hpm.systemId, ter.signatureId,
ts.signature_name AS signatureName, ter.isdel,
ts.signature_url AS signatureUrl, hpm.projectName,
tc.`level` hpm.systemId,
FROM ts.signature_name AS signatureName,
tms_experimental_report ter ts.signature_url AS signatureUrl,
LEFT JOIN tms_signature ts ON signatureId = ts.id tc.`level`
LEFT JOIN tms_comment tc ON commentId = tc.id FROM tms_experimental_report ter
LEFT JOIN tms_project_record AS tpr ON tpr.recordId = ter.eventId LEFT JOIN tms_signature ts ON signatureId = ts.id
LEFT JOIN hr_project_management AS hpm ON hpm.projectId = tpr.projectId LEFT JOIN tms_comment tc ON commentId = tc.id
WHERE LEFT JOIN tms_project_record AS tpr ON tpr.recordId = ter.eventId
reportId = #{reportId} LEFT JOIN hr_project_management AS hpm ON hpm.projectId = tpr.projectId
WHERE reportId = #{reportId}
</select>
<select id="queryEvaluationReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT
u.userName,
sch.schoolName,
s.workNumber,
tpr.score,
tpr.submitTime,
tpr.recordId,
tcr.reportId
FROM
hr_project_management hpm,
hr_user_info u,
student s,
tms_project_record tpr,
tms_experimental_report tcr,
school sch
WHERE
hpm.projectId = tpr.projectId
AND tpr.userId = u.userId
AND u.userId = s.userId
AND sch.schoolId = u.schoolId
AND tcr.eventId = tpr.recordId
AND tpr.isdel = 0
AND tcr.isdel = 0
AND u.isdel = 0
AND tpr.projectId = #{projectId}
<if test="searchContant!=null and searchContant!=''">AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%')
OR u.userName LIKE CONCAT('%',#{searchContant},'%') )
</if>
GROUP BY
tcr.reportId
ORDER BY tpr.submitTime DESC
</select>
<select id="queryAchievement" resultType="com.msdw.tms.entity.request.AchievementImportRequest">
SELECT
u.userName,
sch.schoolName,
s.workNumber,
tpr.score,
tpr.submitTime,
tpr.recordId,
tcr.reportId
FROM
hr_project_management hpm,
hr_user_info u,
student s,
tms_project_record tpr,
tms_experimental_report tcr,
school sch
WHERE
hpm.projectId = tpr.projectId
AND tpr.userId = u.userId
AND u.userId = s.userId
AND sch.schoolId = u.schoolId
AND tcr.eventId = tpr.recordId
AND tpr.isdel = 0
AND tcr.isdel = 0
AND u.isdel = 0
<if test="ids.size()>0">
AND recordId IN (
<foreach collection="ids" separator="," item="recordId">
#{recordId}
</foreach>
)
</if>
GROUP BY
tcr.reportId
ORDER BY tpr.submitTime DESC
</select>
<select id="queryFictitiousRecord" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT
hpm.projectName,
hpm.creationTime AS creationtime,
hpm.projectPermissions,
count( tcr.reportId ) AS reportNumber,
tcr.projectId,
tcr.reportId,
tpr.recordId
FROM
hr_project_management hpm
LEFT JOIN tms_project_record tpr ON hpm.projectId = tpr.projectId
LEFT JOIN tms_experimental_report tcr ON tpr.recordId = tcr.eventId
WHERE
tpr.isdel = 0
AND tcr.isdel = 0
AND hpm.projectPermissions = 0
<if test="systemId!=null and systemId!=''">AND hpm.systemId = #{systemId}</if>
<if test="searchContant!=null and searchContant!=''">and hpm.projectName like concat('%',#{searchContant},'%')
</if>
<if test="startingtime!=null and startingtime!='' and endtime!=null and endtime != ''">and hpm.creationTime
between #{endtime} and #{startingtime}
</if>
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;=
date(hpm.creationTime)
</if>
<if test="projectIds.size!=null">
AND tpr.projectId IN (
<foreach collection="projectIds" separator="," item="projectId">
#{projectId}
</foreach>
)
</if>
GROUP BY
tcr.reportId
ORDER BY
creationtime DESC,tcr.reportId DESC
</select> </select>
<select id="queryEvaluationReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVO"> <select id="queryEducationRecord" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT SELECT
u.userName, hpm.projectName,
sch.schoolName, hpm.creationTime AS creationtime,
s.workNumber, tet.experimental_class_name,
tpr.score, hpm.projectPermissions,
tpr.submitTime, tcr.projectId,
tpr.recordId, tcr.reportId,
tcr.reportId tpr.recordId,
FROM count( tcr.reportId ) AS reportNumber
hr_project_management hpm, FROM
hr_user_info u, hr_project_management hpm
student s, LEFT JOIN tms_experimental_teaching tet ON tet.project_id = hpm.projectId
tms_project_record tpr, LEFT JOIN tms_project_record tpr ON tet.project_id = tpr.projectId
tms_experimental_report tcr, LEFT JOIN tms_experimental_report tcr ON tcr.projectId = tet.id
school sch WHERE
WHERE tpr.isdel = 0
hpm.projectId = tpr.projectId AND hpm.projectPermissions = 1
AND tpr.userId = u.userId AND tcr.isdel = 0
AND u.userId = s.userId <if test="systemId!=null and systemId!=''">AND hpm.systemId = #{systemId}</if>
AND sch.schoolId = u.schoolId <if test="searchContant!=null and searchContant!=''">and (hpm.projectName like concat('%',#{searchContant},'%')
AND tcr.eventId = tpr.recordId OR tet.experimental_class_name like concat('%',#{searchContant},'%') )
AND tpr.isdel = 0 </if>
AND tcr.isdel = 0 <if test="startingtime!=null and startingtime!='' and endtime!=null and endtime != ''">and hpm.creationTime
AND u.isdel = 0 between #{endtime} and #{startingtime}
AND tpr.projectId = #{projectId} </if>
<if test="searchContant!=null and searchContant!=''"> AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%') OR u.userName LIKE CONCAT('%',#{searchContant},'%') )</if> <if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;=
GROUP BY date(creation_time)
tcr.reportId </if>
ORDER BY tpr.submitTime DESC <if test="projectIds.size!=null">
</select> AND tet.id IN (
<foreach collection="projectIds" separator="," item="projectId">
#{projectId}
</foreach>
)
</if>
GROUP BY
tcr.reportId
ORDER BY
creationtime DESC,tcr.reportId DESC
</select>
<select id="queryFictitiousReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT
u.userName,
sch.schoolName,
s.workNumber,
tpr.score,
tpr.submitTime,
tpr.recordId,
tcr.reportId
FROM
hr_project_management hpm,
hr_user_info u,
student s,
tms_project_record tpr,
tms_experimental_report tcr,
school sch
WHERE
hpm.projectId = tpr.projectId
AND tpr.userId = u.userId
AND u.userId = s.userId
AND sch.schoolId = u.schoolId
AND tcr.eventId = tpr.recordId
AND tpr.isdel = 0
AND tcr.isdel = 0
AND u.isdel = 0
AND tpr.projectId = #{projectId}
<if test="searchContant!=null and searchContant!=''">AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%')
OR u.userName LIKE CONCAT('%',#{searchContant},'%') )
</if>
GROUP BY
tcr.reportId
ORDER BY tpr.submitTime DESC
</select>
<select id="countEducationProjectId" resultType="java.lang.Integer">
SELECT ter.projectId
FROM tms_experimental_report ter
LEFT JOIN tms_experimental_teaching tet ON tet.id = ter.projectId
LEFT JOIN hr_project_management hpm ON tet.project_id = hpm.projectId
WHERE ter.isdel = 0
AND hpm.projectPermissions = 1
AND ter.projectId IS NOT NULL
GROUP BY ter.projectId
</select>
<select id="countFictitiousProjectId" resultType="java.lang.Integer">
SELECT tpr.projectId
FROM tms_project_record tpr
LEFT JOIN hr_project_management hpm ON tpr.projectId = hpm.projectId
WHERE tpr.isdel = 0
AND hpm.projectPermissions = 0
GROUP BY tpr.projectId
</select>
<select id="queryEvaluationName" resultType="java.lang.String">
SELECT project_name AS evaluationName
FROM tms_experimental_teaching
WHERE project_id = #{projectId}
</select>
<select id="queryPythonTest" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT hec.`code` AS userAnswer,
hec.codeId,
IF
(p.rightAndWrong = 0, hsi.score, 0) AS codeScore,
hjp.judgmentPointsName,
hjp.experimentcode AS answer
FROM hr_experiment_code AS hec,
hr_score_index AS hsi,
hr_judgment_points AS hjp,
pointrecord p
WHERE hjp.judgmentPointsId = hsi.judgmentPointsId
AND hjp.judgmentPointsId = hec.judgmentPointsId
AND p.codeId = hec.codeId
<select id="queryAchievement" resultType="com.msdw.tms.entity.request.AchievementImportRequest"> AND hjp.isdel = 0
SELECT AND hec.recordId = #{recordId}
u.userName, GROUP BY hec.codeId
sch.schoolName, </select>
s.workNumber,
tpr.score,
tpr.submitTime,
tpr.recordId,
tcr.reportId
FROM
hr_project_management hpm,
hr_user_info u,
student s,
tms_project_record tpr,
tms_experimental_report tcr,
school sch
WHERE
hpm.projectId = tpr.projectId
AND tpr.userId = u.userId
AND u.userId = s.userId
AND sch.schoolId = u.schoolId
AND tcr.eventId = tpr.recordId
AND tpr.isdel = 0
AND tcr.isdel = 0
AND u.isdel = 0
<if test="ids.size()>0">
AND recordId IN (
<foreach collection="ids" separator="," item="recordId">
#{recordId}
</foreach>
)
</if>
GROUP BY
tcr.reportId
ORDER BY tpr.submitTime DESC
</select>
<select id="queryFictitiousRecord" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT
hpm.projectName,
hpm.creationTime AS creationtime,
hpm.projectPermissions,
count( tcr.reportId ) AS reportNumber,
tcr.projectId,
tcr.reportId,
tpr.recordId
FROM
hr_project_management hpm
LEFT JOIN tms_project_record tpr ON hpm.projectId = tpr.projectId
LEFT JOIN tms_experimental_report tcr ON tpr.recordId = tcr.eventId
WHERE
tpr.isdel = 0
AND tcr.isdel = 0
AND hpm.projectPermissions = 0
<if test="systemId!=null and systemId!=''"> AND hpm.systemId = #{systemId} </if>
<if test="searchContant!=null and searchContant!=''"> and hpm.projectName like concat('%',#{searchContant},'%')</if>
<if test="startingtime!=null and startingtime!='' and endtime!=null and endtime != ''"> and hpm.creationTime between #{endtime} and #{startingtime}</if>
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;= date(hpm.creationTime)</if>
<if test="projectIds.size!=null">
AND tpr.projectId IN (
<foreach collection="projectIds" separator="," item="projectId">
#{projectId}
</foreach>
) </if>
GROUP BY
tcr.reportId
ORDER BY
creationtime DESC,tcr.reportId DESC
</select>
<select id="queryEducationRecord" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT
hpm.projectName,
hpm.creationTime AS creationtime,
tet.experimental_class_name,
hpm.projectPermissions,
tcr.projectId,
tcr.reportId,
tpr.recordId,
count( tcr.reportId ) AS reportNumber
FROM
hr_project_management hpm
LEFT JOIN tms_experimental_teaching tet ON tet.project_id = hpm.projectId
LEFT JOIN tms_project_record tpr ON tet.project_id = tpr.projectId
LEFT JOIN tms_experimental_report tcr ON tcr.projectId = tet.id
WHERE
tpr.isdel = 0
AND hpm.projectPermissions = 1
AND tcr.isdel = 0
<if test="systemId!=null and systemId!=''"> AND hpm.systemId = #{systemId} </if>
<if test="searchContant!=null and searchContant!=''"> and (hpm.projectName like concat('%',#{searchContant},'%') OR tet.experimental_class_name like concat('%',#{searchContant},'%') )</if>
<if test="startingtime!=null and startingtime!='' and endtime!=null and endtime != ''"> and hpm.creationTime between #{endtime} and #{startingtime}</if>
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;= date(creation_time)</if>
<if test="projectIds.size!=null">
AND tet.id IN (
<foreach collection="projectIds" separator="," item="projectId">
#{projectId}
</foreach>
) </if>
GROUP BY
tcr.reportId
ORDER BY
creationtime DESC,tcr.reportId DESC
</select>
<select id="queryFictitiousReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT
u.userName,
sch.schoolName,
s.workNumber,
tpr.score,
tpr.submitTime,
tpr.recordId,
tcr.reportId
FROM
hr_project_management hpm,
hr_user_info u,
student s,
tms_project_record tpr,
tms_experimental_report tcr,
school sch
WHERE
hpm.projectId = tpr.projectId
AND tpr.userId = u.userId
AND u.userId = s.userId
AND sch.schoolId = u.schoolId
AND tcr.eventId = tpr.recordId
AND tpr.isdel = 0
AND tcr.isdel = 0
AND u.isdel = 0
AND tpr.projectId = #{projectId}
<if test="searchContant!=null and searchContant!=''"> AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%') OR u.userName LIKE CONCAT('%',#{searchContant},'%') )</if>
GROUP BY
tcr.reportId
ORDER BY tpr.submitTime DESC
</select>
<select id="countEducationProjectId" resultType="java.lang.Integer">
SELECT
ter.projectId
FROM
tms_experimental_report ter
LEFT JOIN tms_experimental_teaching tet ON tet.id = ter.projectId
LEFT JOIN hr_project_management hpm ON tet.project_id = hpm.projectId
WHERE
ter.isdel = 0
AND hpm.projectPermissions = 1
AND ter.projectId IS NOT NULL
GROUP BY
ter.projectId
</select>
<select id="countFictitiousProjectId" resultType="java.lang.Integer">
SELECT
tpr.projectId
FROM
tms_project_record tpr
LEFT JOIN hr_project_management hpm ON tpr.projectId = hpm.projectId
WHERE
tpr.isdel = 0
AND hpm.projectPermissions = 0
GROUP BY
tpr.projectId
</select>
<select id="queryEvaluationName" resultType="java.lang.String">
SELECT project_name AS evaluationName FROM tms_experimental_teaching WHERE project_id = #{projectId}
</select>
<select id="queryPythonTest" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT
hec.`code` AS userAnswer,
hec.codeId,
if(p.rightAndWrong=0,hsi.score,0) AS codeScore,
hjp.judgmentPointsName,
hjp.experimentcode AS answer
FROM
hr_experiment_code AS hec,
hr_score_index AS hsi,
hr_judgment_points AS hjp,
pointrecord p
WHERE
hjp.judgmentPointsId = hsi.judgmentPointsId
AND hjp.judgmentPointsId = hec.judgmentPointsId
AND p.codeId = hec.codeId
AND hsi.isdel = 0
AND hjp.isdel = 0
AND hec.recordId = #{recordId}
GROUP BY
hec.codeId
ORDER BY
hec.codeId ASC
</select>
<select id="list" resultType="com.msdw.tms.entity.ResultsEntity"> <select id="list" resultType="com.msdw.tms.entity.ResultsEntity">
SELECT hpm.creationTime,hpm.projectId,hpm.projectName,hpm.projectPermissions,hpm.systemId,(SELECT count(*) FROM hr_experimental_report her where hpm.projectId = her.projectId ) as number SELECT hpm.creationTime,hpm.projectId,hpm.projectName,hpm.projectPermissions,hpm.systemId,(SELECT count(*) FROM
FROM hr_project_management hpm WHERE systemId = #{systemId} hr_experimental_report her where hpm.projectId = her.projectId ) as number
AND hpm.isdel = 0 FROM hr_project_management hpm WHERE systemId = #{systemId}
<if test="projectPermissions!=null and projectPermissions!=''"> AND hpm.projectPermissions = #{projectPermissions} </if> AND hpm.isdel = 0
<if test="searchContant!=null and searchContant!=''"> and hpm.projectName like concat('%',#{searchContant},'%')</if> <if test="projectPermissions!=null and projectPermissions!=''">AND hpm.projectPermissions =
<if test="startTime!=null and startTime!='' and endTime!=null and endTime != ''"> and hpm.creationTime between #{endTime} and #{startTime}</if> #{projectPermissions}
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;= date(hpm.creationTime)</if> </if>
ORDER BY hpm.creationTime DESC <if test="searchContant!=null and searchContant!=''">and hpm.projectName like concat('%',#{searchContant},'%')
</select> </if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime != ''">and hpm.creationTime between
#{endTime} and #{startTime}
</if>
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;=
date(hpm.creationTime)
</if>
ORDER BY hpm.creationTime DESC
</select>
<select id="newList" resultType="com.msdw.tms.entity.ResultsEntity"> <select id="newList" resultType="com.msdw.tms.entity.ResultsEntity">
SELECT et.id,et.experimental_class_name as experimentalClassName,et.experimental_name as experimentalName,et.project_id as projectId, SELECT et.id,et.experimental_class_name as experimentalClassName,et.experimental_name as
pm.projectName,pm.projectPermissions,et.creation_time as creationTime,(SELECT count(*) FROM hr_experimental_report her where et.project_id = her.projectId ) as number experimentalName,et.project_id as projectId,
FROM tms_experimental_teaching et,hr_project_management pm pm.projectName,pm.projectPermissions,et.creation_time as creationTime,(SELECT count(*) FROM
WHERE user_id = #{userId} hr_experimental_report her where et.project_id = her.projectId ) as number
AND et.project_id = pm.projectId FROM tms_experimental_teaching et,hr_project_management pm
AND pm.isdel = 0 WHERE user_id = #{userId}
<if test="searchContant!=null and searchContant!=''"> and et.experimental_class_name like concat('%',#{searchContant},'%') or et.experimental_name like concat('%',#{searchContant},'%') or pm.projectName like concat('%',#{searchContant},'%') </if> AND et.project_id = pm.projectId
<if test="startTime!=null and startTime!='' and endTime!=null and endTime != ''"> and et.creation_time between #{endTime} and #{startTime}</if> AND pm.isdel = 0
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;= date(et.creation_time)</if> <if test="searchContant!=null and searchContant!=''">and et.experimental_class_name like
ORDER BY et.creation_time DESC concat('%',#{searchContant},'%') or et.experimental_name like concat('%',#{searchContant},'%') or
</select> pm.projectName like concat('%',#{searchContant},'%')
</if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime != ''">and et.creation_time between
#{endTime} and #{startTime}
</if>
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;=
date(et.creation_time)
</if>
ORDER BY et.creation_time DESC
</select>
<select id="reportList" resultType="com.msdw.tms.entity.ReportEntity"> <select id="reportList" resultType="com.msdw.tms.entity.ReportEntity">
SELECT hui.userId,her.reportId,hui.userName as studentName,s.schoolName,stu.workNumber,her.score,her.creationTime SELECT hui.userId,her.reportId,hui.userName as
FROM hr_experimental_report her,hr_user_info hui,school s,student stu studentName,s.schoolName,stu.workNumber,her.score,her.creationTime
WHERE her.projectId = #{projectId} FROM hr_experimental_report her,hr_user_info hui,school s,student stu
AND her.studentId = hui.userId WHERE her.projectId = #{projectId}
AND her.studentId = stu.userId AND her.studentId = hui.userId
AND hui.schoolId = s.schoolId AND her.studentId = stu.userId
AND her.isdel = 0 AND hui.schoolId = s.schoolId
<if test="searchContant!=null and searchContant!=''"> AND (hui.userName LIKE CONCAT('%',#{searchContant},'%') OR s.schoolName LIKE CONCAT('%',#{searchContant},'%') )</if> AND her.isdel = 0
ORDER BY her.creationTime desc <if test="searchContant!=null and searchContant!=''">AND (hui.userName LIKE CONCAT('%',#{searchContant},'%') OR
</select> s.schoolName LIKE CONCAT('%',#{searchContant},'%') )
</if>
ORDER BY her.creationTime desc
</select>
<select id="getTeacher" resultType="java.lang.String"> <select id="getTeacher" resultType="java.lang.String">
SELECT hui.userName FROM hr_project_management pm,hr_user_info hui SELECT hui.userName
WHERE pm.projectId = #{projectId} and pm.userId = hui.userId FROM hr_project_management pm,
</select> hr_user_info hui
WHERE pm.projectId = #{projectId}
and pm.userId = hui.userId
</select>
<select id="queryTradingJudgmentPointsId" resultType="java.lang.Integer"> <select id="queryTradingJudgmentPointsId" resultType="java.lang.Integer">
SELECT tradingJudgmentPointsId FROM hr_user_score SELECT tradingJudgmentPointsId
FROM hr_user_score
WHERE reportId = #{reportId} WHERE reportId = #{reportId}
</select> </select>
<select id="getUserAnswers" resultType="com.msdw.tms.entity.vo.JudgmentPointsRuleVO"> <select id="getUserAnswers" resultType="com.msdw.tms.entity.vo.JudgmentPointsRuleVO">
SELECT tjp.judgment_points_name as judgmentPointsName,ru.type,ru.id,ru.level_one as levelOne,ru.level_two as levelTwo,ru.level_three as levelThree,ru.level_four as levelFour,ru.trading_judgment_points_id as tradingJudgmentPointsId SELECT tjp.judgment_points_name as judgmentPointsName,
FROM hr_trading_judgment_points_rule ru,hr_trading_judgment_points tjp ru.type,
WHERE ru.trading_judgment_points_id = #{tradingJudgmentPointsId} and ru.trading_judgment_points_id = tjp.id ru.id,
</select> ru.level_one as levelOne,
ru.level_two as levelTwo,
ru.level_three as levelThree,
ru.level_four as levelFour,
ru.trading_judgment_points_id as tradingJudgmentPointsId
FROM hr_trading_judgment_points_rule ru,
hr_trading_judgment_points tjp
WHERE ru.trading_judgment_points_id = #{tradingJudgmentPointsId}
and ru.trading_judgment_points_id = tjp.id
</select>
</mapper> </mapper>

@ -27,7 +27,7 @@
AND (user_id in (select userId FROM staff WHERE schoolId = #{cla.schoolId} AND isdel = 0 AND FIND_IN_SET(roleId,'1,2,3') ) AND (user_id in (select userId FROM staff WHERE schoolId = #{cla.schoolId} AND isdel = 0 AND FIND_IN_SET(roleId,'1,2,3') )
OR user_id IN ( SELECT userId FROM hr_user_info WHERE disableAccount = 0 AND isdel = 0 AND FIND_IN_SET( roleId, '1' ) ) ) OR user_id IN ( SELECT userId FROM hr_user_info WHERE disableAccount = 0 AND isdel = 0 AND FIND_IN_SET( roleId, '1' ) ) )
<if test="cla.status!=null">and `status` = #{cla.status}</if> <if test="cla.status!=null">and `status` = #{cla.status}</if>
<if test="cla.condition!=null">and ( project_name like concat('%',#{cla.condition},'%') or experimental_class_name like concat('%',#{cla.condition},'%') )</if> <if test="cla.condition!=null">and ( experimental_name like concat('%',#{cla.condition},'%') or experimental_class_name like concat('%',#{cla.condition},'%') )</if>
<if test="cla.startTime!=null and cla.endTime!=null">and stop_time between #{cla.endTime} and #{cla.startTime}</if> <if test="cla.startTime!=null and cla.endTime!=null">and stop_time between #{cla.endTime} and #{cla.startTime}</if>
<if test="cla.month!=null">and DATE_SUB(CURDATE(), INTERVAL #{cla.month} month ) &lt;= date(creation_time)</if> <if test="cla.month!=null">and DATE_SUB(CURDATE(), INTERVAL #{cla.month} month ) &lt;= date(creation_time)</if>
ORDER BY creation_time DESC ORDER BY creation_time DESC

@ -1,85 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.msdw.tms.dao.ExperimentalReportDao"> <mapper namespace="com.msdw.tms.dao.ExperimentalReportDao">
<resultMap id="reportMap" type="com.msdw.tms.entity.vo.ExperimentalReportVo"> <resultMap id="reportMap" type="com.msdw.tms.entity.vo.ExperimentalReportVo">
<result property="experimentalClassName" column="experimental_class_name"></result> <result property="experimentalClassName" column="experimental_class_name"></result>
<result property="startTime" column="start_time"></result> <result property="startTime" column="start_time"></result>
<result property="experimentGoal" column="experiment_goal"></result> <result property="experimentGoal" column="experiment_goal"></result>
<result property="projectName" column="project_name"></result> <result property="projectName" column="project_name"></result>
</resultMap> </resultMap>
<select id="queryReport" resultType="com.msdw.tms.entity.vo.ExperimentalReportVo"> <select id="queryReport" resultType="com.msdw.tms.entity.vo.ExperimentalReportVo">
SELECT SELECT u.userId,
u.userId, u.userName,
u.userName, stu.workNumber,
stu.workNumber, tet.project_name,
tet.project_name, tet.id AS experimentId,
tet.id AS experimentId, tet.experimental_class_name,
tet.experimental_class_name, hpm.experimentalGoal AS experiment_goal,
hpm.experimentalGoal AS experiment_goal, tpr.submitTime,
tpr.submitTime, tpr.score,
tpr.score, ter.period,
ter.teacherName, ter.laboratory,
ter.period, ter.principle,
ter.laboratory, ter.content,
ter.principle, ter.step,
ter.content, ter.`data`,
ter.step, ter.analysis,
ter.`data`, ter.conclusion,
ter.analysis, ter.summarize,
ter.conclusion, ter.improvement,
ter.summarize, IFNULL(ter.`comment`, (SELECT `comment` FROM tms_comment WHERE id = commentId)) AS comment
ter.improvement, FROM hr_user_info u,
IFNULL( ter.`comment`, ( SELECT `comment` FROM tms_comment WHERE id = commentId ) ) AS comment student stu,
FROM tms_experimental_report ter,
hr_user_info u, hr_project_management hpm,
student stu, tms_experimental_teaching tet,
tms_experimental_report ter, tms_project_record tpr
hr_project_management hpm, WHERE u.userId = stu.userId
tms_experimental_teaching tet, AND stu.studentId = ter.studentId
tms_project_record tpr AND hpm.projectId = tet.project_id
WHERE AND ter.projectId = tet.id
u.userId = stu.userId AND stu.userId = tpr.userId
AND stu.studentId = ter.studentId AND ter.studentId = #{studentId}
AND hpm.projectId = tet.project_id AND ter.isdel = 0
AND ter.projectId = tet.id AND tpr.isdel = 0
AND stu.userId = tpr.userId AND tpr.recordId = #{recordId}
AND ter.studentId = #{studentId} AND ter.projectId = #{projectId}
AND ter.isdel = 0 </select>
AND tpr.isdel = 0 <select id="queryVirtualReport" resultType="com.msdw.tms.entity.vo.ExperimentalReportVo">
AND tpr.recordId = #{recordId} SELECT tpr.recordId,
AND ter.projectId = #{projectId} u.userId,
u.userName,
stu.workNumber,
hpm.projectName,
hpm.experimentalGoal AS experiment_goal,
tpr.submitTime,
tpr.score
FROM hr_user_info u,
student stu,
hr_project_management hpm,
tms_project_record tpr
WHERE u.userId = stu.userId
AND stu.userId = tpr.userId
AND hpm.projectId = tpr.projectId
AND tpr.isdel = 0
AND tpr.recordId = #{recordId}
</select>
<select id="querySystemId" resultType="java.lang.Integer">
SELECT systemId
FROM hr_project_management hpm,
tms_project_record tpr
WHERE tpr.projectId = hpm.projectId
AND tpr.recordId = #{recordId}
</select> </select>
<select id="queryVirtualReport" resultType="com.msdw.tms.entity.vo.ExperimentalReportVo">
SELECT
tpr.recordId,
u.userId,
u.userName,
stu.workNumber,
hpm.projectName,
hpm.experimentalGoal AS experiment_goal,
tpr.submitTime,
tpr.score
FROM
hr_user_info u,
student stu,
hr_project_management hpm,
tms_project_record tpr
WHERE
u.userId = stu.userId
AND stu.userId = tpr.userId
AND hpm.projectId = tpr.projectId
AND tpr.recordId = #{recordId}
AND tpr.isdel = 0
</select>
<select id="querySystemId" resultType="java.lang.Integer">
SELECT
systemId
FROM
hr_project_management hpm,
tms_project_record tpr
WHERE
tpr.projectId = hpm.projectId
AND tpr.recordId = #{recordId}
</select>
</mapper> </mapper>

@ -14,16 +14,16 @@
<result property="endtime" column="endTime"/> <result property="endtime" column="endTime"/>
<result property="submitTime" column="submitTime"/> <result property="submitTime" column="submitTime"/>
<result property="isdel" column="isdel"/> <result property="isdel" column="isdel"/>
<!-- <result property="experimental_class_name" column="experimentalClassName"/>--> <!-- <result property="experimental_class_name" column="experimentalClassName"/>-->
</resultMap> </resultMap>
<insert id="addReport" useGeneratedKeys="true" keyProperty="eventId" keyColumn="recordId"> <insert id="addReport" useGeneratedKeys="true" keyProperty="eventId" keyColumn="recordId">
INSERT INTO tms_project_record ( userId, projectId, score, startingTime, endTime, timeSum, submitTime ) INSERT INTO tms_project_record (userId, projectId, score, startingTime, endTime, timeSum, submitTime)
VALUES VALUES (#{userid}, #{projectid}, #{score}, #{startingtime}, now(), #{timeSum}, now())
(#{userid}, #{projectid}, #{score}, #{startingtime}, now(), #{timeSum}, now())
</insert> </insert>
<select id="getByUserRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT <!--
SELECT
her.reportId as reportId, her.reportId as reportId,
her.projectId, her.projectId,
projectName, projectName,
@ -42,85 +42,88 @@ VALUES
AND AND
tp.projectPermissions = #{projectPermissions} tp.projectPermissions = #{projectPermissions}
order by her.creationTime desc order by her.creationTime desc
-->
<select id="getByUserRecord" resultType="com.msdw.tms.entity.resp.GetByUserRecordResp"
parameterType="java.lang.Integer">
SELECT projectName,
c.recordId,
r.score,
c.codeId,
r.startingTime,
r.submitTime,
r.timeSum,
c.userId
FROM hr_experiment_code c
INNER JOIN hr_project_management t ON t.projectId = c.projectId
INNER JOIN tms_project_record r ON r.recordId = c.recordId
WHERE c.userId = #{userId}
and r.isdel = 0
ORDER BY c.codeId DESC
</select> </select>
<!-- --> <!-- -->
<select id="getByUserExperimentRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo"> <select id="getByUserExperimentRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT SELECT tet.id,
tet.id, ter.reportId,
ter.reportId, tpr.recordId,
tpr.recordId, tpr.projectId,
tpr.projectId, projectName,
projectName, score,
score, timeSum,
timeSum, startingTime as startTime,
startingTime as startTime, endTime,
endTime, recordState,
recordState, tet.experimental_class_name as experimentalClassName
tet.experimental_class_name as experimentalClassName FROM tms_project_record tpr
FROM LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId
tms_project_record tpr LEFT JOIN tms_experimental_teaching tet ON tet.project_id = tpr.projectId
LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId LEFT JOIN tms_experimental_report ter ON ter.projectId = tet.id
LEFT JOIN tms_experimental_teaching tet ON tet.project_id = tpr.projectId WHERE tpr.userId = #{pro.userid}
LEFT JOIN tms_experimental_report ter ON ter.projectId = tet.id AND tpr.isdel = #{pro.isdel}
WHERE AND tp.projectPermissions !=0
tpr.userId = #{pro.userid}
AND
tpr.isdel = #{pro.isdel}
AND
tp.projectPermissions !=0
AND AND
ter.eventId = tpr.recordId ter.eventId = tpr.recordId
ORDER BY ORDER BY
tpr.submitTime DESC tpr.recordId DESC
</select> </select>
<select id="getByUserRecordImport" resultType="com.msdw.tms.entity.vo.ProjectRecordExportVo"> <select id="getByUserRecordImport" resultType="com.msdw.tms.entity.vo.ProjectRecordExportVo">
SELECT SELECT tpr.projectId,
tpr.projectId, projectName,
projectName, score,
score, timeSum,
timeSum, startingTime as startTime,
startingTime as startTime, endTime,
endTime, recordState,
recordState, tet.experimental_class_name
tet.experimental_class_name FROM tms_project_record tpr
FROM LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId
tms_project_record tpr LEFT JOIN tms_experimental_teaching tet ON tpr.projectId = tet.project_id
LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId WHERE tpr.userId = #{userid}
LEFT JOIN tms_experimental_teaching tet ON tpr.projectId = tet.project_id AND tpr.isdel = #{isdel}
WHERE AND tpr.projectId = tet.project_id
tpr.userId = #{userid} AND tp.projectPermissions != 0
AND
tpr.isdel = #{isdel}
AND
tpr.projectId = tet.project_id
AND
tp.projectPermissions != 0
ORDER BY ORDER BY
tpr.submitTime DESC tpr.submitTime DESC
</select> </select>
<!-- 个人实验预览--> <!-- 个人实验预览-->
<select id="getByUserScore" resultType="com.msdw.tms.entity.vo.ProjectRecordVo"> <select id="getByUserScore" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT SELECT userName,
userName, count(*) AS experimentNumber,
count( * ) AS experimentNumber, sum(timeSum) AS totalTime,
sum( timeSum ) AS totalTime, avg(score) avgScore
avg( score ) avgScore FROM tms_project_record pr
FROM LEFT JOIN hr_user_info u ON pr.userId = u.userId
tms_project_record pr WHERE pr.userId = #{userid}
LEFT JOIN hr_user_info u ON pr.userId = u.userId and pr.isdel = #{isdel}
WHERE and u.isdel = #{isdel}
pr.userId = #{userid}
and
pr.isdel = #{isdel}
and
u.isdel = #{isdel}
</select> </select>
<!-- 个人实验预览--> <!-- 个人实验预览-->
<select id="queryScore" resultType="com.msdw.tms.entity.vo.ProjectRecordVo"> <select id="queryScore" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT count(*) as experimentNumber,sum(timeConsuming) as totalTime, avg(score) as avgScore FROM hr_experimental_report where studentId = 547 SELECT count(*) as experimentNumber, sum(timeConsuming) as totalTime, avg(score) as avgScore
FROM hr_experimental_report
where studentId = 547
</select> </select>
<select id="getBySchoolRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo"> <select id="getBySchoolRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
@ -149,34 +152,35 @@ VALUES
and and
sc.isdel = #{pro.isdel} sc.isdel = #{pro.isdel}
<if test="pro.month!=null">and DATE_SUB(CURDATE(), INTERVAL #{pro.month} month ) &lt;= date(submitTime)</if> <if test="pro.month!=null">and DATE_SUB(CURDATE(), INTERVAL #{pro.month} month ) &lt;= date(submitTime)</if>
<if test="pro.startTime!=null and pro.endTime!=null">and submitTime between #{pro.startTime} and #{pro.endTime}</if> <if test="pro.startTime!=null and pro.endTime!=null">and submitTime between #{pro.startTime} and
#{pro.endTime}
</if>
<if test="pro.recordState!=null">and recordState=#{pro.recordState}</if> <if test="pro.recordState!=null">and recordState=#{pro.recordState}</if>
<if test="pro.condition!=null">and ( projectName like concat('%',#{pro.condition},'%') or schoolName like concat('%',#{pro.condition},'%') or userName like concat('%',#{pro.condition},'%') )</if> <if test="pro.condition!=null">and ( projectName like concat('%',#{pro.condition},'%') or schoolName like
concat('%',#{pro.condition},'%') or userName like concat('%',#{pro.condition},'%') )
</if>
</select> </select>
<select id="getByRecordImport" resultType="com.msdw.tms.entity.vo.ProjectRecordExportVo"> <select id="getByRecordImport" resultType="com.msdw.tms.entity.vo.ProjectRecordExportVo">
SELECT SELECT tpr.projectId,
tpr.projectId, projectName,
projectName, score,
score, timeSum,
timeSum, startingTime as startTime,
startingTime as startTime, endTime,
endTime, recordState
recordState FROM tms_project_record tpr
FROM LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId
tms_project_record tpr WHERE tpr.userId = #{userid}
LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId AND tpr.isdel = #{isdel}
WHERE AND tp.projectPermissions = 0
tpr.userId = #{userid}
AND
tpr.isdel = #{isdel}
AND
tp.projectPermissions =0
</select> </select>
<select id="queryReport" resultType="com.msdw.tms.entity.ProjectRecordEntity"> <select id="queryReport" resultType="com.msdw.tms.entity.ProjectRecordEntity">
SELECT * FROM tms_project_record WHERE recordId = #{recordId} SELECT *
FROM tms_project_record
WHERE recordId = #{recordId}
</select> </select>
<update id="updateUserRecord" parameterType="com.msdw.tms.entity.ProjectRecordEntity" > <update id="updateUserRecord" parameterType="com.msdw.tms.entity.ProjectRecordEntity">
update tms_project_record update tms_project_record
set isdel = #{isdel} set isdel = #{isdel}
<if test="recordstate!=null">,recordstate = #{recordstate}</if> <if test="recordstate!=null">,recordstate = #{recordstate}</if>
@ -184,6 +188,8 @@ VALUES
</update> </update>
<update id="updateScore"> <update id="updateScore">
UPDATE tms_project_record SET score = #{score} WHERE recordId = #{recordid} UPDATE tms_project_record
SET score = #{score}
WHERE recordId = #{recordid}
</update> </update>
</mapper> </mapper>
Loading…
Cancel
Save