46 lines
1.5 KiB
XML
46 lines
1.5 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="com.univ3e.dao.UnivWordAchiveDao">
|
||
|
|
<select id= "getNextSeq" resultType="long">
|
||
|
|
SELECT NEXTVAL('seq_univwordachiveid')
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="doSave" parameterType="com.univ3e.entity.UnivWordAchive" >
|
||
|
|
INSERT INTO univwordachive(wordachiveid,uid,pointcasetype,wordsid,score,
|
||
|
|
accuracy,fluent,integrity,content,created,areaid)
|
||
|
|
VALUES (
|
||
|
|
<if test="wordachiveid == 0">
|
||
|
|
(SELECT NEXTVAL('seq_univwordachiveid')),
|
||
|
|
</if>
|
||
|
|
<if test="wordachiveid != 0">
|
||
|
|
#{wordachiveid},
|
||
|
|
</if>
|
||
|
|
#{uid},#{pointcasetype},#{wordsid},#{score},#{accuracy},
|
||
|
|
#{fluent},#{integrity},#{content},#{created},#{areaid})
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<select id= "findMyWordAchiveGradesByLessionids" parameterType="map" resultType="map" >
|
||
|
|
WITH temp AS (
|
||
|
|
SELECT wordsid,lessonid
|
||
|
|
FROM words
|
||
|
|
WHERE lessonId IN
|
||
|
|
<foreach item="item" index="index" collection="lessionidList"
|
||
|
|
open="(" separator="," close=")">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
),
|
||
|
|
temp2 AS (
|
||
|
|
SELECT wa.wordsid
|
||
|
|
FROM univwordAchive wa
|
||
|
|
RIGHT JOIN temp w ON wa.wordsId = w.wordsId AND wa.uid = #{uid}
|
||
|
|
WHERE wa.created >= #{startTime}
|
||
|
|
AND wa.created < #{endTime}
|
||
|
|
)
|
||
|
|
SELECT COUNT(DISTINCT(t2.wordsid))||'/'||COUNT(DISTINCT(t.wordsid)) AS finishCount
|
||
|
|
FROM temp t
|
||
|
|
LEFT JOIN temp2 t2 ON t.wordsId = t2.wordsId
|
||
|
|
</select>
|
||
|
|
</mapper>
|