73 lines
2.3 KiB
XML
73 lines
2.3 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="Sentence">
|
|
|
|
<insert id="insertSentence" parameterType="Sentence">
|
|
INSERT INTO Sentence ( sentenceId, lessonPartId, lessonRoleId, content, translate, origiVoice, orderId, status ) Values ( #{sentenceId}, #{lessonPartId}, #{lessonRoleId}, #{content}, #{translate}, #{origiVoice}, #{orderId}, #{status} )
|
|
|
|
</insert>
|
|
|
|
<update id="updateSentence" parameterType="Sentence">
|
|
|
|
|
|
UPDATE Sentence SET
|
|
|
|
sentenceId = #{sentenceId}, lessonPartId = #{lessonPartId}, lessonRoleId = #{lessonRoleId}, content = #{content}, translate = #{translate}, origiVoice = #{origiVoice}, orderId = #{orderId}, status = #{status}
|
|
where sentenceId=#{sentenceId}
|
|
|
|
</update>
|
|
|
|
<select id="getSentenceByKey" parameterType="java.lang.Integer" resultType="Sentence">
|
|
|
|
|
|
|
|
SELECT sentenceId , lessonPartId , lessonRoleId , content , translate , origiVoice , orderId , status
|
|
FROM Sentence WHERE sentenceId=#{sentenceId}
|
|
|
|
</select>
|
|
|
|
|
|
<select id="getSeqSentence" resultType="Integer" useCache="false" flushCache="true">
|
|
|
|
|
|
SELECT nextval('seq_sentenceId') ;
|
|
|
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertSentenceBatch" parameterType="java.util.List">
|
|
|
|
INSERT INTO Sentence ( sentenceId, lessonPartId, lessonRoleId, content, translate, origiVoice, orderId, status
|
|
,url
|
|
) Values
|
|
|
|
<foreach collection="list" index="index" item="item" separator=",">
|
|
|
|
( #{item.sentenceId}, #{item.lessonPartId}, #{item.lessonRoleId}, #{item.content}, #{item.translate}, #{item.origiVoice}, #{item.orderId}, #{item.status}, #{item.url}
|
|
|
|
)
|
|
|
|
</foreach>
|
|
</insert>
|
|
<select id="getSentencesByLessonPartId" parameterType="java.lang.Integer" resultType="Sentence">
|
|
|
|
|
|
SELECT sentenceId , lessonPartId , lessonRoleId , content , translate , origiVoice , orderId , status,url
|
|
FROM Sentence
|
|
|
|
WHERE lessonPartId=#{lessonPartId} and status = 1
|
|
ORDER BY orderId
|
|
|
|
</select>
|
|
|
|
|
|
<delete id="deleteSentenceByIds" parameterType="java.util.List">
|
|
delete from Sentence where sentenceId in
|
|
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
|
|
</delete>
|
|
</mapper> |