You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
3.3 KiB

<?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">
<mapper namespace="com.msdw.tms.dao.ExperimentalReportDao">
<resultMap id="reportMap" type="com.msdw.tms.entity.vo.ExperimentalReportVo">
<result property="experimentalClassName" column="experimental_class_name"></result>
<result property="startTime" column="start_time"></result>
<result property="experimentGoal" column="experiment_goal"></result>
<result property="projectName" column="project_name"></result>
</resultMap>
<select id="queryReport" resultType="com.msdw.tms.entity.vo.ExperimentalReportVo">
SELECT u.userId,
u.userName,
stu.workNumber,
ter.proName,
tet.id AS experimentId,
tet.experimental_class_name,
hpm.experimentalGoal AS experiment_goal,
tpr.submitTime,
tpr.score,
ter.period,
ter.laboratory,
ter.principle,
ter.content,
ter.step,
ter.`data`,
ter.analysis,
ter.conclusion,
ter.summarize,
ter.improvement,
IFNULL(ter.`comment`, (SELECT `comment` FROM tms_comment WHERE id = commentId)) AS comment,
ter.instructor,
ter.purpose,
tet.experimental_class_name as experimentalClassName
FROM hr_user_info u,
student stu,
tms_experimental_report ter,
hr_project_management hpm,
tms_experimental_teaching tet,
tms_project_record tpr
WHERE u.userId = stu.userId
AND stu.studentId = ter.studentId
AND hpm.projectId = tet.project_id
AND ter.projectId = tet.id
AND stu.userId = tpr.userId
AND ter.studentId = #{studentId}
AND ter.isdel = 0
AND tpr.isdel = 0
AND tpr.recordId = #{recordId}
AND ter.projectId = #{projectId}
</select>
<select id="queryVirtualReport" resultType="com.msdw.tms.entity.vo.ExperimentalReportVo">
SELECT
tpr.recordId,
u.userId,
u.userName,
stu.workNumber,
ter.proName,
ter.purpose,
hpm.experimentalGoal AS experiment_goal,
tpr.submitTime,
tpr.score,
ter.instructor,
ter.period,
ter.summarize
FROM
tms_experimental_report ter
INNER JOIN student stu ON ter.studentId = stu.studentId
INNER JOIN hr_user_info u ON u.userId = stu.userId
INNER JOIN tms_project_record tpr ON tpr.recordId = ter.eventId
INNER JOIN hr_project_management hpm ON hpm.projectId = tpr.projectId
WHERE
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>
</mapper>