@ -2,17 +2,67 @@
<!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" >
<resultMap id= "achievementMap" type= "com.msdw.tms.entity.ExperimentalReportEntity" >
<result property= "experimentalClassName" column= "experimental_class_name" > </result>
<!-- 通用查询映射结果 -->
<resultMap id= "BaseResultMap" type= "com.msdw.tms.entity.ExperimentalReportEntity" >
<id column= "reportId" property= "reportId" />
<result column= "projectId" property= "projectId" />
<result column= "principle" property= "principle" />
<result column= "content" property= "content" />
<result column= "data" property= "data" />
<result column= "analysis" property= "analysis" />
<result column= "conclusion" property= "conclusion" />
<result column= "summarize" property= "summarize" />
<result column= "purpose" property= "purpose" />
<result column= "improvement" property= "improvement" />
<result column= "comment" property= "comment" />
<result column= "studentId" property= "studentId" />
<result column= "teacherName" property= "teacherName" />
<result column= "period" property= "period" />
<result column= "laboratory" property= "laboratory" />
<result column= "equipment" property= "equipment" />
<result column= "score" property= "score" />
<result column= "timeConsuming" property= "timeConsuming" />
<result column= "startTime" property= "startTime" />
<result column= "creationTime" property= "creationTime" />
<result column= "className" property= "className" />
<result column= "steps1" property= "steps1" />
<result column= "steps2" property= "steps2" />
<result column= "steps3" property= "steps3" />
<result column= "steps4" property= "steps4" />
<result column= "steps5" property= "steps5" />
<result column= "steps6" property= "steps6" />
<result column= "steps7" property= "steps7" />
<result column= "steps8" property= "steps8" />
<result column= "steps9" property= "steps9" />
<result column= "steps10" property= "steps10" />
<result column= "projectName" property= "projectName" />
<result column= "workNumber" property= "workNumber" />
</resultMap>
<insert id= "addReport" >
INSERT INTO tms_experimental_report ( projectId, content, principle, step, analysis, summarize, improvement, commentId, studentId, teacherName, period, laboratory,eventId )
<select id= "getReport" resultMap= "BaseResultMap" parameterType= "com.msdw.tms.entity.ExperimentalReportEntity" >
SELECT her.*,pm.projectName,s.workNumber FROM
hr_experimental_report her,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 id= "getScore" resultType= "com.msdw.tms.entity.vo.UserScoreVO" parameterType= "com.msdw.tms.entity.vo.UserScoreVO" >
SELECT id,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"> -->
<!-- <result property="experimentalClassName" column="experimental_class_name"></result> -->
<!-- </resultMap> -->
<insert id= "addReport" useGeneratedKeys= "true" keyProperty= "reportId" >
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)
VALUES
(#{projectId},#{content}, #{principle}, #{step}, #{analysis}, #{summarize}, #{improvement}, #{commentId}, #{studentId}, #{teacherName}, #{period}, #{laboratory},#{eventId})
(#{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>
<update id= "deleteReport" >
UPDATE tms_project_record tpr,tms_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.recordI d = tcr.eventId AND tcr.reportId = #{reportId}
</update>
<update id= "updateComment" >
UPDATE tms_experimental_report SET `comment` = #{comment} WHERE reportId = #{reportId}
@ -21,7 +71,7 @@ VALUES
<update id= "updateSignatrue" >
UPDATE tms_experimental_report SET isSignature = #{isSignature} , signatureId = #{signatureId}, `comment` = #{comment} WHERE reportId = #{reportId}
</update>
<select id= "queryReport" resultType= "com.msdw.tms.entity.vo.AchievementManagementVo " >
<select id= "queryReport" resultType= "com.msdw.tms.entity.vo.AchievementManagementVO " >
SELECT
ter.reportId,
IFNULL( ter.`comment`, ( SELECT `comment` FROM tms_comment WHERE id = commentId ) ) AS comment,
@ -57,7 +107,7 @@ FROM
WHERE
reportId = #{reportId}
</select>
<select id= "queryEvaluationReport" resultType= "com.msdw.tms.entity.vo.AchievementManagementVo " >
<select id= "queryEvaluationReport" resultType= "com.msdw.tms.entity.vo.AchievementManagementVO " >
SELECT
u.userName,
sch.schoolName,
@ -125,7 +175,7 @@ WHERE
tcr.reportId
ORDER BY tpr.submitTime DESC
</select>
<select id= "queryFictitiousRecord" resultType= "com.msdw.tms.entity.vo.AchievementManagementVo " >
<select id= "queryFictitiousRecord" resultType= "com.msdw.tms.entity.vo.AchievementManagementVO " >
SELECT
hpm.projectName,
hpm.creationTime AS creationtime,
@ -157,7 +207,7 @@ WHERE
ORDER BY
creationtime DESC,tcr.reportId DESC
</select>
<select id= "queryEducationRecord" resultType= "com.msdw.tms.entity.vo.AchievementManagementVo " >
<select id= "queryEducationRecord" resultType= "com.msdw.tms.entity.vo.AchievementManagementVO " >
SELECT
hpm.projectName,
hpm.creationTime AS creationtime,
@ -191,7 +241,7 @@ WHERE
ORDER BY
creationtime DESC,tcr.reportId DESC
</select>
<select id= "queryFictitiousReport" resultType= "com.msdw.tms.entity.vo.AchievementManagementVo " >
<select id= "queryFictitiousReport" resultType= "com.msdw.tms.entity.vo.AchievementManagementVO " >
SELECT
u.userName,
sch.schoolName,
@ -251,7 +301,7 @@ GROUP BY
<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 id= "queryPythonTest" resultType= "com.msdw.tms.entity.vo.AchievementManagementVO " >
SELECT
hec.`code` AS userAnswer,
hec.codeId,
@ -275,4 +325,55 @@ GROUP BY
ORDER BY
hec.codeId ASC
</select>
<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
FROM hr_project_management hpm WHERE systemId = #{systemId}
AND hpm.isdel = 0
<if test= "projectPermissions!=null and projectPermissions!=''" > AND hpm.projectPermissions = #{projectPermissions} </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 ) < = date(hpm.creationTime)</if>
ORDER BY hpm.creationTime DESC
</select>
<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,
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
WHERE user_id = #{userId}
AND et.project_id = pm.projectId
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= "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 ) < = date(et.creation_time)</if>
ORDER BY et.creation_time DESC
</select>
<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
FROM hr_experimental_report her,hr_user_info hui,school s,student stu
WHERE her.projectId = #{projectId}
AND her.studentId = hui.userId
AND her.studentId = stu.userId
AND hui.schoolId = s.schoolId
AND her.isdel = 0
<if test= "searchContant!=null and searchContant!=''" > AND (hui.userName LIKE CONCAT('%',#{searchContant},'%') OR s.schoolName LIKE CONCAT('%',#{searchContant},'%') )</if>
ORDER BY her.creationTime desc
</select>
<select id= "getTeacher" resultType= "java.lang.String" >
SELECT hui.userName FROM hr_project_management pm,hr_user_info hui
WHERE pm.projectId = #{projectId} and pm.userId = hui.userId
</select>
<select id= "queryTradingJudgmentPointsId" resultType= "java.lang.Integer" >
SELECT tradingJudgmentPointsId FROM hr_user_score
WHERE reportId = #{reportId}
</select>
<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
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>