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

67 lines
2.4 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="WordAchive">
<insert id="insertWordAchive" parameterType="WordAchive">
INSERT INTO WordAchive ( wordAchiveId, uid, pointCaseType, wordsId, score, accuracy, fluent, integrity, content, created , areaid )
Values ( #{wordAchiveId}, #{uid}, #{pointCaseType}, #{wordsId}, #{score}, #{accuracy}, #{fluent}, #{integrity}, #{content},current_timestamp ,#{areaid} )
</insert>
<insert id="insertWordAchiveForMysql" useGeneratedKeys="true" keyProperty="wordAchiveId" parameterType="WordAchive">
INSERT INTO WordAchive ( uid, pointCaseType, wordsId, score, accuracy, fluent, integrity, content, created , areaid )
Values ( #{uid}, #{pointCaseType}, #{wordsId}, #{score}, #{accuracy}, #{fluent}, #{integrity}, #{content},#{created} ,#{areaid} )
</insert>
<update id="updateWordAchive" parameterType="WordAchive">
UPDATE WordAchive SET
wordAchiveId = #{wordAchiveId}, uid = #{uid}, pointCaseType = #{pointCaseType}, wordsId = #{wordsId}, score = #{score}, accuracy = #{accuracy}, fluent = #{fluent}, integrity = #{integrity}, content = #{content}, created = #{created} , areaid = #{areaid}
where wordAchiveId=#{wordAchiveId}
</update>
<select id="getWordAchiveByKey" parameterType="java.lang.Long" resultType="WordAchive">
SELECT wordAchiveId , uid , pointCaseType , wordsId , score , accuracy , fluent , integrity , content , created , areaid
FROM WordAchive WHERE wordAchiveId=#{wordAchiveId}
</select>
<select id="getSeqWordAchive" resultType="Long" useCache="false" flushCache="true">
SELECT nextval('seq_wordAchiveId') ;
</select>
<select id="getWordAchivesByUid" parameterType="java.util.Map" resultType="WordAchive">
SELECT wordAchiveId , uid , pointCaseType , wordsId , score , accuracy , fluent , integrity ,
content , created , areaid
FROM WordAchive
WHERE uid=#{uid} and areaid = #{areaid}
</select>
<select id="getWordAchivesByYesterday" resultType="WordAchive">
SELECT wordAchiveId , uid , pointCaseType , wordsId , score , accuracy , fluent , integrity ,
content , created , areaid
FROM WordAchive
where created &lt; current_date and created &gt; current_date - interval '1 day'
</select>
</mapper>