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.
39 lines
1.4 KiB
39 lines
1.4 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.hc.business.mapper.UserTestHistoryMapper">
|
|
|
|
<resultMap type="userTestHistory" id="UserTestHistoryMap">
|
|
<result property="testId" column="test_id" jdbcType="INTEGER"/>
|
|
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
|
<result property="paperId" column="paper_id" jdbcType="INTEGER"/>
|
|
<result property="classId" column="class_id" jdbcType="INTEGER"/>
|
|
<result property="score" column="score" jdbcType="INTEGER"/>
|
|
<result property="answer" column="answer" jdbcType="VARCHAR"/>
|
|
<result property="createTime" column="create_time" jdbcType="INTEGER"/>
|
|
<result property="totalScore" column="total_score" jdbcType="INTEGER"/>
|
|
<result property="testTime" column="test_time" jdbcType="VARCHAR"/>
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
|
test_id,
|
|
user_id,
|
|
paper_id,
|
|
class_id,
|
|
score,
|
|
answer,
|
|
create_time,
|
|
total_score,
|
|
test_time
|
|
</sql>
|
|
|
|
<select id="queryMaxScore" resultMap="UserTestHistoryMap">
|
|
SELECT
|
|
<include refid="Base_Column_List"/>
|
|
FROM user_test_history
|
|
WHERE user_id = #{param1}
|
|
AND class_id = #{param2}
|
|
ORDER BY score DESC
|
|
LIMIT 1
|
|
</select>
|
|
|
|
</mapper> |