2026-03-10 14:30:24 +08:00

77 lines
3.0 KiB
XML

<?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="UnivAchivement">
<insert id="insertUnivAchivement" parameterType="UnivAchivement">
INSERT INTO UnivAchivement ( achivementId, uid, achiveType, pointCaseType,
objectId, score, accuracy, fluent, integrity, content,
created, uuid , areaid )
Values ( #{achivementId}, #{uid}, #{achiveType}, #{pointCaseType},
#{objectId}, #{score}, #{accuracy}, #{fluent}, #{integrity}, #{content},
#{created}, #{uuid} , #{areaid} )
</insert>
<update id="updateUnivAchivement" parameterType="UnivAchivement">
UPDATE UnivAchivement
SET achivementId = #{achivementId}, uid = #{uid}, achiveType = #{achiveType},
pointCaseType = #{pointCaseType}, objectId = #{objectId}, score = #{score},
accuracy = #{accuracy}, fluent = #{fluent}, integrity = #{integrity},
content = #{content}, created = #{created}, uuid = #{uuid} , areaid = #{areaid}
where achivementId=#{achivementId}
</update>
<select id="getUnivAchivementByKey" parameterType="java.lang.Integer" resultType="UnivAchivement">
SELECT achivementId , uid , achiveType , pointCaseType , objectId ,
score , accuracy , fluent , integrity , content , created , uuid ,
areaid
FROM UnivAchivement
WHERE achivementId=#{achivementId}
</select>
<select id="getSeqUnivAchivement" resultType="Integer" useCache="false" flushCache="true">
SELECT nextval('seq_univachivementId')
</select>
<select id="getUnivAchivementsCountByUid" parameterType="java.lang.Long" resultType="Integer">
SELECT count(*) as howmuch
FROM UnivAchivement
WHERE uid=#{uid}
</select>
<select id="getUnivAchivementsByUid" parameterType="java.util.Map" resultType="UnivAchivement">
SELECT achivementId , uid , achiveType , pointCaseType , objectId ,
score , accuracy , fluent , integrity , content , created ,
uuid , areaid
FROM UnivAchivement
WHERE uid=#{uid}
ORDER BY achivementId desc
LIMIT #{pageSize} OFFSET #{offset}
</select>
<update id="updateUnivUUID" parameterType="java.util.Map">
UPDATE UnivAchivement
SET uuid = #{uuid}
WHERE achivementId= #{achivementId}
</update>
<select id="univMaxAssignmentAchive" parameterType="java.util.HashMap" resultType="java.lang.Double">
SELECT n.score
FROM
( SELECT distinct a.lessonId , b.startTime , b.endTime
FROM univAssignDetail a
INNER JOIN univAssignment b
on a.assignmentId = #{assignmentId} and a.lessonId = #{lessonId}
and a.assignmentId = b.assignmentId ) m
INNER JOIN univAchivement n
on n.uid = #{uid} and m.lessonId = n.objectId
and n.achivetype = 'L' and pointcasetype in ( 5 , 6 , 7 , 8 )
and n.created &gt; m.startTime and n.created &lt; m.endTime
order by n.score desc , n.created asc
limit 1
</select>
</mapper>