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.
208 lines
8.5 KiB
208 lines
8.5 KiB
5 years ago
|
<?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.blockchain.server.yyyf.mapper.AssessUserMapper">
|
||
|
<resultMap id="YfServerAssessUserResultMap" type="com.blockchain.server.yyyf.entity.AssessUser">
|
||
|
<id column="id" jdbcType="VARCHAR" property="id"/>
|
||
|
<result column="train_id" jdbcType="VARCHAR" property="trainId"/>
|
||
|
<result column="issue_id" jdbcType="VARCHAR" property="issueId"/>
|
||
|
<result column="ss_practise_id" jdbcType="VARCHAR" property="ssPractiseId"/>
|
||
|
<result column="user_id" jdbcType="INTEGER" property="userId"/>
|
||
|
<result column="total_score" jdbcType="NUMERIC" property="totalScore"/>
|
||
|
<result column="duration" jdbcType="INTEGER" property="duration"/>
|
||
|
<result column="duration_unit" jdbcType="VARCHAR" property="durationUnit"/>
|
||
|
<result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
|
||
|
<result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
|
||
|
<result column="case_id" jdbcType="VARCHAR" property="caseId"/>
|
||
|
<result column="achieve_ment_type" jdbcType="INTEGER" property="achieveMentType"/>
|
||
|
<result column="class_id" jdbcType="VARCHAR" property="classId"/>
|
||
|
<result column="course_id" jdbcType="VARCHAR" property="courseId"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<resultMap id="PractiseProVoResultMap" type="com.blockchain.server.yyyf.dto.PractiseProDto">
|
||
|
<id column="id" property="id" />
|
||
|
<result column="project_name" property="proName" />
|
||
|
<result column="project_score" property="projectScore" />
|
||
|
<result column="project_case_desc" property="projectCaseDesc" />
|
||
|
<collection property="taskList" ofType="com.blockchain.server.yyyf.dto.PractiseTaskDto">
|
||
|
<id column="userTaskid" property="id"/>
|
||
|
<result column="task_name" property="taskName"/>
|
||
|
<result column="task_score" property="taskScore"/>
|
||
|
<result column="answer" property="answer"/>
|
||
|
<result column="right_answer" property="rightAnswer"/>
|
||
|
<result column="stu_answer" property="stuAnswer"/>
|
||
|
</collection>
|
||
|
</resultMap>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<sql id="YfServerAssessUser_Where_Clause">
|
||
|
<if test="id != null ">
|
||
|
and t.id=#{id,jdbcType=VARCHAR}
|
||
|
</if>
|
||
|
<if test="trainId != null and trainId != ''">
|
||
|
and t.train_id=#{trainId,jdbcType=VARCHAR}
|
||
|
</if>
|
||
|
<if test="issueId != null and issueId != ''">
|
||
|
and t.issue_id=#{issueId,jdbcType=VARCHAR}
|
||
|
</if>
|
||
|
<if test="ssPractiseId != null and ssPractiseId != ''">
|
||
|
and t.ss_practise_id=#{ssPractiseId,jdbcType=VARCHAR}
|
||
|
</if>
|
||
|
<if test="userId != null and userId != ''">
|
||
|
and t.user_id=#{userId,jdbcType=INTEGER}
|
||
|
</if>
|
||
|
<if test="totalScore != null and totalScore != ''">
|
||
|
and t.total_score=#{totalScore,jdbcType=NUMERIC}
|
||
|
</if>
|
||
|
<if test="customerStory != null and customerStory != ''">
|
||
|
and t.customer_story=#{customerStory,jdbcType=VARCHAR}
|
||
|
</if>
|
||
|
<if test="duration != null and duration != ''">
|
||
|
and t.duration=#{duration,jdbcType=INTEGER}
|
||
|
</if>
|
||
|
<if test="durationUnit != null and durationUnit != ''">
|
||
|
and t.duration_unit=#{durationUnit,jdbcType=VARCHAR}
|
||
|
</if>
|
||
|
<if test="startTime != null and startTime != ''">
|
||
|
and t.start_time=#{startTime,jdbcType=TIMESTAMP}
|
||
|
</if>
|
||
|
<if test="endTime != null and endTime != ''">
|
||
|
and t.end_time=#{endTime,jdbcType=TIMESTAMP}
|
||
|
</if>
|
||
|
<if test="caseId != null and caseId != ''">
|
||
|
and t.case_id=#{caseId,jdbcType=VARCHAR}
|
||
|
</if>
|
||
|
<if test="achieveMentType != null and achieveMentType != ''">
|
||
|
and t.achieve_ment_type=#{achieveMentType,jdbcType=INTEGER}
|
||
|
</if>
|
||
|
<if test="classId != null and classId != ''">
|
||
|
and t.class_id=#{classId,jdbcType=VARCHAR}
|
||
|
</if>
|
||
|
<if test="courseId != null and courseId != ''">
|
||
|
and t.course_id=#{courseId,jdbcType=VARCHAR}
|
||
|
</if>
|
||
|
<if test="groupId != null and groupId != ''">
|
||
|
and t.group_id=#{groupId,jdbcType=INTEGER}
|
||
|
</if>
|
||
|
</sql>
|
||
|
|
||
|
<sql id="YfServerAssessUser_Column_List">
|
||
|
t.id,
|
||
|
t.train_id,
|
||
|
t.issue_id,
|
||
|
t.ss_practise_id,
|
||
|
t.user_id,
|
||
|
t.total_score,
|
||
|
t.duration,
|
||
|
t.duration_unit,
|
||
|
t.start_time,
|
||
|
t.end_time,
|
||
|
t.case_id,
|
||
|
t.achieve_ment_type,
|
||
|
t.class_id,
|
||
|
t.course_id,
|
||
|
</sql>
|
||
|
|
||
|
<insert id="insert" parameterType="com.blockchain.server.yyyf.entity.AssessUser">
|
||
|
insert into yyyf_server_assess_user ( id, train_id, issue_id, ss_practise_id, user_id, total_score, duration, duration_unit, start_time, end_time, case_id, achieve_ment_type, class_id, course_id)
|
||
|
values(
|
||
|
#{id},
|
||
|
#{trainId},
|
||
|
#{issueId},
|
||
|
#{ssPractiseId},
|
||
|
#{userId},
|
||
|
#{totalScore},
|
||
|
#{duration},
|
||
|
#{durationUnit},
|
||
|
#{startTime},
|
||
|
#{endTime},
|
||
|
#{caseId},
|
||
|
#{achieveMentType},
|
||
|
#{classId},
|
||
|
#{courseId}
|
||
|
)
|
||
|
</insert>
|
||
|
|
||
|
<insert id="batchInsert" parameterType="java.util.List">
|
||
|
insert into yyyf_server_assess_user
|
||
|
values
|
||
|
|
||
|
<foreach collection ="list" item="item" index= "index" separator =",">
|
||
|
(
|
||
|
#{item.id},
|
||
|
#{item.trainId},
|
||
|
#{item.issueId},
|
||
|
#{item.ssPractiseId},
|
||
|
#{item.userId},
|
||
|
#{item.totalScore},
|
||
|
#{item.duration},
|
||
|
#{item.durationUnit},
|
||
|
#{item.startTime},
|
||
|
#{item.endTime},
|
||
|
#{item.caseId},
|
||
|
#{item.achieveMentType},
|
||
|
#{item.classId},
|
||
|
#{item.courseId},
|
||
|
)
|
||
|
</foreach >
|
||
|
</insert>
|
||
|
|
||
|
<delete id="delAssessUserByIssueId">
|
||
|
delete from yyyf_server_assess_user where issue_id=#{issueId}
|
||
|
</delete>
|
||
|
|
||
|
<select id="selectScore" resultMap="YfServerAssessUserResultMap">
|
||
|
SELECT * from yyyf_server_assess_user where issue_id=#{assessmentId} and user_id=#{userId} and achieve_ment_type = 1
|
||
|
</select>
|
||
|
|
||
|
<select id="selectUserGradeCase" resultType="java.util.Map" >
|
||
|
select AVG(t.TOTAL_SCORE) as avg,
|
||
|
MAX(t.TOTAL_SCORE) as max,
|
||
|
MIN(t.TOTAL_SCORE) as min
|
||
|
from yyyf_server_assess_user t
|
||
|
where t.class_id= #{classId} and t.issue_id= #{issueId}
|
||
|
</select>
|
||
|
<select id="selectUserGradeListByClassIdAndIssueId" resultType="java.util.Map">
|
||
|
SELECT t.user_id as userAId,t.TOTAL_SCORE AS totalScore from yyyf_server_assess_user t
|
||
|
where t.issue_id= #{issueId}
|
||
|
</select>
|
||
|
|
||
|
|
||
|
<select id="selectPractiseProList" resultMap="PractiseProVoResultMap">
|
||
|
SELECT
|
||
|
p.id,
|
||
|
p.project_name,
|
||
|
p.project_score,
|
||
|
p.project_case_desc,
|
||
|
t.id AS userTaskid,
|
||
|
t.task_name,
|
||
|
t.task_score,
|
||
|
t.answer,
|
||
|
t.right_answer,
|
||
|
t.stu_answer
|
||
|
FROM
|
||
|
yyyf_server_assess_user u
|
||
|
LEFT JOIN yyyf_server_assess_user_project p ON u.id = p.assess_user_id
|
||
|
LEFT JOIN yyyf_server_assess_user_task t ON p.id = t.assess_project_id
|
||
|
WHERE
|
||
|
u.id=#{assessUserId}
|
||
|
ORDER BY CONVERT(p.project_id,SIGNED), t.serial_number,CONVERT(t.task_id,SIGNED)
|
||
|
</select>
|
||
|
<select id="selectAssessUserListByIssuerIdAndUserId" resultMap="YfServerAssessUserResultMap">
|
||
|
select * from yyyf_server_assess_user
|
||
|
where achieve_ment_type=0 and issue_id=#{issueId} and user_id=#{userId}
|
||
|
ORDER BY start_time desc
|
||
|
</select>
|
||
|
<select id="selectAssessUserById" resultMap="YfServerAssessUserResultMap">
|
||
|
select * from yyyf_server_assess_user where id=#{assessUserId}
|
||
|
</select>
|
||
|
|
||
|
<select id="selectAssessUserListByIssueId" resultMap="YfServerAssessUserResultMap">
|
||
|
select * from yyyf_server_assess_user where issue_id=#{issueId} and achieve_ment_type = 1
|
||
|
</select>
|
||
|
<!-- <select id="getAssessUserByIssueId" resultMap="YfServerAssessUserResultMap">
|
||
|
SELECT * from yyyf_server_assess_user
|
||
|
</select>-->
|
||
|
</mapper>
|