修复学生端虚拟实验教学实验列表及实验报告

hehai
rong.liu 4 years ago
parent 782775acdb
commit 69589a20d6
  1. 13
      src/main/java/com/msdw/tms/controller/ClassTeachingController.java
  2. 2
      src/main/java/com/msdw/tms/controller/ProjectRecordController.java
  3. 5
      src/main/java/com/msdw/tms/dao/ProjectRecordDao.java
  4. 89
      src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java
  5. 4
      src/main/java/com/msdw/tms/service/ProjectRecordService.java
  6. 1
      src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java
  7. 8
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  8. 216
      src/main/resources/mapper/tms/AchievementManagementDao.xml
  9. 30
      src/main/resources/mapper/tms/ExperimentalReportDao.xml
  10. 106
      src/main/resources/mapper/tms/ProjectRecordDao.xml

@ -32,6 +32,7 @@ public class ClassTeachingController implements ClassTeachingApi {
/** /**
* 用户端查看班级实验列表 * 用户端查看班级实验列表
*
* @param page * @param page
* @param size * @param size
* @param month * @param month
@ -60,7 +61,8 @@ public class ClassTeachingController implements ClassTeachingApi {
recordVo.setMonth(null); recordVo.setMonth(null);
if (!StringUtils.isEmpty(startTime)) { if (!StringUtils.isEmpty(startTime)) {
recordVo.setStartTime(startTime); recordVo.setStartTime(startTime);
}if(!StringUtils.isEmpty(endTime)) { }
if (!StringUtils.isEmpty(endTime)) {
recordVo.setEndTime(endTime); recordVo.setEndTime(endTime);
} }
} }
@ -71,6 +73,7 @@ public class ClassTeachingController implements ClassTeachingApi {
/** /**
* 校验是否需要输入邀请码 * 校验是否需要输入邀请码
*
* @param userId * @param userId
* @param projectId * @param projectId
* @return * @return
@ -88,6 +91,7 @@ public class ClassTeachingController implements ClassTeachingApi {
/** /**
* 通过邀请码进入实验 * 通过邀请码进入实验
*
* @param * @param
* @return * @return
*/ */
@ -125,6 +129,7 @@ public class ClassTeachingController implements ClassTeachingApi {
/** /**
* 查看虚拟仿真课程列表信息 * 查看虚拟仿真课程列表信息
*
* @param page * @param page
* @param size * @param size
* @return * @return
@ -137,7 +142,8 @@ public class ClassTeachingController implements ClassTeachingApi {
} }
/** /**
* 学生查看实验报告 * 学生查看实验报告(教学)
*
* @param * @param
* @return * @return
*/ */
@ -151,7 +157,8 @@ public class ClassTeachingController implements ClassTeachingApi {
} }
/** /**
* 学生查看虚拟实验报告 * 学生查看虚拟实验报告(虚仿)
*
* @param * @param
* @return * @return
*/ */

@ -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,7 +23,7 @@ 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);

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

@ -11,15 +11,13 @@ 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);

@ -40,6 +40,7 @@ public class ExperimentalReportServiceImpl extends ServiceImpl<ExperimentalRepor
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);

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

@ -40,14 +40,30 @@
</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,
score,
tradingJudgmentPointsId,
projectId,
systemId,
userId,
isCorrect,
reportId,
userAnswers
FROM hr_user_score
WHERE reportId = #{reportId}
and userId = #{userId}
</select> </select>
<!-- <resultMap id="achievementMap" type="com.msdw.tms.entity.ExperimentalReportEntity">--> <!-- <resultMap id="achievementMap" type="com.msdw.tms.entity.ExperimentalReportEntity">-->
@ -55,25 +71,36 @@
<!-- </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>
<update id="updateComment"> <update id="updateComment">
UPDATE tms_experimental_report SET `comment` = #{comment} WHERE reportId = #{reportId} UPDATE tms_experimental_report
SET `comment` = #{comment}
WHERE reportId = #{reportId}
</update> </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
SET isSignature = #{isSignature},
signatureId = #{signatureId},
`comment` = #{comment}
WHERE reportId = #{reportId}
</update> </update>
<select id="queryReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVO"> <select id="queryReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT SELECT ter.reportId,
ter.reportId,
IFNULL(ter.`comment`, (SELECT `comment` FROM tms_comment WHERE id = commentId)) AS comment, IFNULL(ter.`comment`, (SELECT `comment` FROM tms_comment WHERE id = commentId)) AS comment,
ter.projectId, ter.projectId,
ter.principle, ter.principle,
@ -98,14 +125,12 @@ SELECT
ts.signature_name AS signatureName, ts.signature_name AS signatureName,
ts.signature_url AS signatureUrl, ts.signature_url AS signatureUrl,
tc.`level` tc.`level`
FROM FROM tms_experimental_report ter
tms_experimental_report ter
LEFT JOIN tms_signature ts ON signatureId = ts.id LEFT JOIN tms_signature ts ON signatureId = ts.id
LEFT JOIN tms_comment tc ON commentId = tc.id LEFT JOIN tms_comment tc ON commentId = tc.id
LEFT JOIN tms_project_record AS tpr ON tpr.recordId = ter.eventId LEFT JOIN tms_project_record AS tpr ON tpr.recordId = ter.eventId
LEFT JOIN hr_project_management AS hpm ON hpm.projectId = tpr.projectId LEFT JOIN hr_project_management AS hpm ON hpm.projectId = tpr.projectId
WHERE WHERE reportId = #{reportId}
reportId = #{reportId}
</select> </select>
<select id="queryEvaluationReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVO"> <select id="queryEvaluationReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT SELECT
@ -133,7 +158,9 @@ WHERE
AND tcr.isdel = 0 AND tcr.isdel = 0
AND u.isdel = 0 AND u.isdel = 0
AND tpr.projectId = #{projectId} AND tpr.projectId = #{projectId}
<if test="searchContant!=null and searchContant!=''"> AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%') OR u.userName LIKE CONCAT('%',#{searchContant},'%') )</if> <if test="searchContant!=null and searchContant!=''">AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%')
OR u.userName LIKE CONCAT('%',#{searchContant},'%') )
</if>
GROUP BY GROUP BY
tcr.reportId tcr.reportId
ORDER BY tpr.submitTime DESC ORDER BY tpr.submitTime DESC
@ -193,15 +220,21 @@ WHERE
AND tcr.isdel = 0 AND tcr.isdel = 0
AND hpm.projectPermissions = 0 AND hpm.projectPermissions = 0
<if test="systemId!=null and systemId!=''">AND hpm.systemId = #{systemId}</if> <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="searchContant!=null and searchContant!=''">and hpm.projectName like concat('%',#{searchContant},'%')
<if test="startingtime!=null and startingtime!='' and endtime!=null and endtime != ''"> and hpm.creationTime between #{endtime} and #{startingtime}</if> </if>
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;= date(hpm.creationTime)</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"> <if test="projectIds.size!=null">
AND tpr.projectId IN ( AND tpr.projectId IN (
<foreach collection="projectIds" separator="," item="projectId"> <foreach collection="projectIds" separator="," item="projectId">
#{projectId} #{projectId}
</foreach> </foreach>
) </if> )
</if>
GROUP BY GROUP BY
tcr.reportId tcr.reportId
ORDER BY ORDER BY
@ -227,15 +260,22 @@ WHERE
AND hpm.projectPermissions = 1 AND hpm.projectPermissions = 1
AND tcr.isdel = 0 AND tcr.isdel = 0
<if test="systemId!=null and systemId!=''">AND hpm.systemId = #{systemId}</if> <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="searchContant!=null and searchContant!=''">and (hpm.projectName like concat('%',#{searchContant},'%')
<if test="startingtime!=null and startingtime!='' and endtime!=null and endtime != ''"> and hpm.creationTime between #{endtime} and #{startingtime}</if> OR tet.experimental_class_name like concat('%',#{searchContant},'%') )
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;= date(creation_time)</if> </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"> <if test="projectIds.size!=null">
AND tet.id IN ( AND tet.id IN (
<foreach collection="projectIds" separator="," item="projectId"> <foreach collection="projectIds" separator="," item="projectId">
#{projectId} #{projectId}
</foreach> </foreach>
) </if> )
</if>
GROUP BY GROUP BY
tcr.reportId tcr.reportId
ORDER BY ORDER BY
@ -267,113 +307,137 @@ WHERE
AND tcr.isdel = 0 AND tcr.isdel = 0
AND u.isdel = 0 AND u.isdel = 0
AND tpr.projectId = #{projectId} AND tpr.projectId = #{projectId}
<if test="searchContant!=null and searchContant!=''"> AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%') OR u.userName LIKE CONCAT('%',#{searchContant},'%') )</if> <if test="searchContant!=null and searchContant!=''">AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%')
OR u.userName LIKE CONCAT('%',#{searchContant},'%') )
</if>
GROUP BY GROUP BY
tcr.reportId tcr.reportId
ORDER BY tpr.submitTime DESC ORDER BY tpr.submitTime DESC
</select> </select>
<select id="countEducationProjectId" resultType="java.lang.Integer"> <select id="countEducationProjectId" resultType="java.lang.Integer">
SELECT SELECT ter.projectId
ter.projectId FROM tms_experimental_report ter
FROM
tms_experimental_report ter
LEFT JOIN tms_experimental_teaching tet ON tet.id = ter.projectId LEFT JOIN tms_experimental_teaching tet ON tet.id = ter.projectId
LEFT JOIN hr_project_management hpm ON tet.project_id = hpm.projectId LEFT JOIN hr_project_management hpm ON tet.project_id = hpm.projectId
WHERE WHERE ter.isdel = 0
ter.isdel = 0
AND hpm.projectPermissions = 1 AND hpm.projectPermissions = 1
AND ter.projectId IS NOT NULL AND ter.projectId IS NOT NULL
GROUP BY GROUP BY ter.projectId
ter.projectId
</select> </select>
<select id="countFictitiousProjectId" resultType="java.lang.Integer"> <select id="countFictitiousProjectId" resultType="java.lang.Integer">
SELECT SELECT tpr.projectId
tpr.projectId FROM tms_project_record tpr
FROM
tms_project_record tpr
LEFT JOIN hr_project_management hpm ON tpr.projectId = hpm.projectId LEFT JOIN hr_project_management hpm ON tpr.projectId = hpm.projectId
WHERE WHERE tpr.isdel = 0
tpr.isdel = 0
AND hpm.projectPermissions = 0 AND hpm.projectPermissions = 0
GROUP BY GROUP BY tpr.projectId
tpr.projectId
</select> </select>
<select id="queryEvaluationName" resultType="java.lang.String"> <select id="queryEvaluationName" resultType="java.lang.String">
SELECT project_name AS evaluationName FROM tms_experimental_teaching WHERE project_id = #{projectId} SELECT project_name AS evaluationName
FROM tms_experimental_teaching
WHERE project_id = #{projectId}
</select> </select>
<select id="queryPythonTest" resultType="com.msdw.tms.entity.vo.AchievementManagementVO"> <select id="queryPythonTest" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT SELECT hec.`code` AS userAnswer,
hec.`code` AS userAnswer,
hec.codeId, hec.codeId,
if(p.rightAndWrong=0,hsi.score,0) AS codeScore, IF
(p.rightAndWrong = 0, hsi.score, 0) AS codeScore,
hjp.judgmentPointsName, hjp.judgmentPointsName,
hjp.experimentcode AS answer hjp.experimentcode AS answer
FROM FROM hr_experiment_code AS hec,
hr_experiment_code AS hec,
hr_score_index AS hsi, hr_score_index AS hsi,
hr_judgment_points AS hjp, hr_judgment_points AS hjp,
pointrecord p pointrecord p
WHERE WHERE hjp.judgmentPointsId = hsi.judgmentPointsId
hjp.judgmentPointsId = hsi.judgmentPointsId
AND hjp.judgmentPointsId = hec.judgmentPointsId AND hjp.judgmentPointsId = hec.judgmentPointsId
AND p.codeId = hec.codeId AND p.codeId = hec.codeId
AND hsi.isdel = 0
AND hjp.isdel = 0 AND hjp.isdel = 0
AND hec.recordId = #{recordId} AND hec.recordId = #{recordId}
GROUP BY GROUP BY hec.codeId
hec.codeId
ORDER BY
hec.codeId ASC
</select> </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
hr_experimental_report her where hpm.projectId = her.projectId ) as number
FROM hr_project_management hpm WHERE systemId = #{systemId} FROM hr_project_management hpm WHERE systemId = #{systemId}
AND hpm.isdel = 0 AND hpm.isdel = 0
<if test="projectPermissions!=null and projectPermissions!=''"> AND hpm.projectPermissions = #{projectPermissions} </if> <if test="projectPermissions!=null and projectPermissions!=''">AND hpm.projectPermissions =
<if test="searchContant!=null and searchContant!=''"> and hpm.projectName like concat('%',#{searchContant},'%')</if> #{projectPermissions}
<if test="startTime!=null and startTime!='' and endTime!=null and endTime != ''"> and hpm.creationTime between #{endTime} and #{startTime}</if> </if>
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;= date(hpm.creationTime)</if> <if test="searchContant!=null and searchContant!=''">and hpm.projectName like concat('%',#{searchContant},'%')
</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 ORDER BY hpm.creationTime DESC
</select> </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,
pm.projectName,pm.projectPermissions,et.creation_time as creationTime,(SELECT count(*) FROM
hr_experimental_report her where et.project_id = her.projectId ) as number
FROM tms_experimental_teaching et,hr_project_management pm FROM tms_experimental_teaching et,hr_project_management pm
WHERE user_id = #{userId} WHERE user_id = #{userId}
AND et.project_id = pm.projectId AND et.project_id = pm.projectId
AND pm.isdel = 0 AND pm.isdel = 0
<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> <if test="searchContant!=null and searchContant!=''">and et.experimental_class_name like
<if test="startTime!=null and startTime!='' and endTime!=null and endTime != ''"> and et.creation_time between #{endTime} and #{startTime}</if> concat('%',#{searchContant},'%') or et.experimental_name like concat('%',#{searchContant},'%') or
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;= date(et.creation_time)</if> 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 ORDER BY et.creation_time DESC
</select> </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
studentName,s.schoolName,stu.workNumber,her.score,her.creationTime
FROM hr_experimental_report her,hr_user_info hui,school s,student stu FROM hr_experimental_report her,hr_user_info hui,school s,student stu
WHERE her.projectId = #{projectId} WHERE her.projectId = #{projectId}
AND her.studentId = hui.userId AND her.studentId = hui.userId
AND her.studentId = stu.userId AND her.studentId = stu.userId
AND hui.schoolId = s.schoolId AND hui.schoolId = s.schoolId
AND her.isdel = 0 AND her.isdel = 0
<if test="searchContant!=null and searchContant!=''"> AND (hui.userName LIKE CONCAT('%',#{searchContant},'%') OR s.schoolName LIKE CONCAT('%',#{searchContant},'%') )</if> <if test="searchContant!=null and searchContant!=''">AND (hui.userName LIKE CONCAT('%',#{searchContant},'%') OR
s.schoolName LIKE CONCAT('%',#{searchContant},'%') )
</if>
ORDER BY her.creationTime desc ORDER BY her.creationTime desc
</select> </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,
hr_user_info hui
WHERE pm.projectId = #{projectId}
and pm.userId = hui.userId
</select> </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,
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> </select>
</mapper> </mapper>

@ -9,8 +9,7 @@
</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,
@ -19,7 +18,6 @@ SELECT
hpm.experimentalGoal AS experiment_goal, hpm.experimentalGoal AS experiment_goal,
tpr.submitTime, tpr.submitTime,
tpr.score, tpr.score,
ter.teacherName,
ter.period, ter.period,
ter.laboratory, ter.laboratory,
ter.principle, ter.principle,
@ -31,15 +29,13 @@ SELECT
ter.summarize, ter.summarize,
ter.improvement, ter.improvement,
IFNULL(ter.`comment`, (SELECT `comment` FROM tms_comment WHERE id = commentId)) AS comment IFNULL(ter.`comment`, (SELECT `comment` FROM tms_comment WHERE id = commentId)) AS comment
FROM FROM hr_user_info u,
hr_user_info u,
student stu, student stu,
tms_experimental_report ter, tms_experimental_report ter,
hr_project_management hpm, hr_project_management hpm,
tms_experimental_teaching tet, tms_experimental_teaching tet,
tms_project_record tpr tms_project_record tpr
WHERE WHERE u.userId = stu.userId
u.userId = stu.userId
AND stu.studentId = ter.studentId AND stu.studentId = ter.studentId
AND hpm.projectId = tet.project_id AND hpm.projectId = tet.project_id
AND ter.projectId = tet.id AND ter.projectId = tet.id
@ -51,8 +47,7 @@ WHERE
AND ter.projectId = #{projectId} AND ter.projectId = #{projectId}
</select> </select>
<select id="queryVirtualReport" resultType="com.msdw.tms.entity.vo.ExperimentalReportVo"> <select id="queryVirtualReport" resultType="com.msdw.tms.entity.vo.ExperimentalReportVo">
SELECT SELECT tpr.recordId,
tpr.recordId,
u.userId, u.userId,
u.userName, u.userName,
stu.workNumber, stu.workNumber,
@ -60,26 +55,21 @@ SELECT
hpm.experimentalGoal AS experiment_goal, hpm.experimentalGoal AS experiment_goal,
tpr.submitTime, tpr.submitTime,
tpr.score tpr.score
FROM FROM hr_user_info u,
hr_user_info u,
student stu, student stu,
hr_project_management hpm, hr_project_management hpm,
tms_project_record tpr tms_project_record tpr
WHERE WHERE u.userId = stu.userId
u.userId = stu.userId
AND stu.userId = tpr.userId AND stu.userId = tpr.userId
AND hpm.projectId = tpr.projectId AND hpm.projectId = tpr.projectId
AND tpr.recordId = #{recordId}
AND tpr.isdel = 0 AND tpr.isdel = 0
AND tpr.recordId = #{recordId}
</select> </select>
<select id="querySystemId" resultType="java.lang.Integer"> <select id="querySystemId" resultType="java.lang.Integer">
SELECT SELECT systemId
systemId FROM hr_project_management hpm,
FROM
hr_project_management hpm,
tms_project_record tpr tms_project_record tpr
WHERE WHERE tpr.projectId = hpm.projectId
tpr.projectId = hpm.projectId
AND tpr.recordId = #{recordId} AND tpr.recordId = #{recordId}
</select> </select>
</mapper> </mapper>

@ -18,11 +18,11 @@
</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,
@ -42,12 +42,28 @@ 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,
@ -58,17 +74,13 @@ VALUES
endTime, endTime,
recordState, recordState,
tet.experimental_class_name as experimentalClassName tet.experimental_class_name as experimentalClassName
FROM FROM tms_project_record tpr
tms_project_record tpr
LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId
LEFT JOIN tms_experimental_teaching tet ON tet.project_id = tpr.projectId LEFT JOIN tms_experimental_teaching tet ON tet.project_id = tpr.projectId
LEFT JOIN tms_experimental_report ter ON ter.projectId = tet.id LEFT JOIN tms_experimental_report ter ON ter.projectId = tet.id
WHERE WHERE tpr.userId = #{pro.userid}
tpr.userId = #{pro.userid} AND tpr.isdel = #{pro.isdel}
AND AND tp.projectPermissions !=0
tpr.isdel = #{pro.isdel}
AND
tp.projectPermissions !=0
AND AND
ter.eventId = tpr.recordId ter.eventId = tpr.recordId
ORDER BY ORDER BY
@ -76,8 +88,7 @@ VALUES
</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,
@ -85,42 +96,34 @@ VALUES
endTime, endTime,
recordState, recordState,
tet.experimental_class_name tet.experimental_class_name
FROM FROM tms_project_record tpr
tms_project_record tpr
LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId
LEFT JOIN tms_experimental_teaching tet ON tpr.projectId = tet.project_id LEFT JOIN tms_experimental_teaching tet ON tpr.projectId = tet.project_id
WHERE WHERE tpr.userId = #{userid}
tpr.userId = #{userid} AND tpr.isdel = #{isdel}
AND AND tpr.projectId = tet.project_id
tpr.isdel = #{isdel} AND tp.projectPermissions != 0
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 FROM tms_project_record pr
tms_project_record pr
LEFT JOIN hr_user_info u ON pr.userId = u.userId LEFT JOIN hr_user_info u ON pr.userId = u.userId
WHERE WHERE pr.userId = #{userid}
pr.userId = #{userid} and pr.isdel = #{isdel}
and and u.isdel = #{isdel}
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,31 +152,32 @@ 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 FROM tms_project_record tpr
tms_project_record tpr
LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId
WHERE WHERE tpr.userId = #{userid}
tpr.userId = #{userid} AND tpr.isdel = #{isdel}
AND AND tp.projectPermissions = 0
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">
@ -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