72 lines
3.2 KiB
XML
Raw Permalink Normal View History

2026-03-10 14:30:24 +08:00
<?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="UnivExamPaper">
<insert id="insertUnivExamPaper" parameterType="UnivExamPaper">
INSERT INTO UnivExamPaper ( examPaperId, authorType, teacherId, examLevel, title, isRecommend, part1Text, part1Voice, part1OrigiScore, part2Text, part2Voice, part2Question, part2EachOrigiScore, totalScore, status, areaId ) Values ( #{examPaperId}, #{authorType}, #{teacherId}, #{examLevel}, #{title}, #{isRecommend}, #{part1Text}, #{part1Voice}, #{part1OrigiScore}, #{part2Text}, #{part2Voice}, #{part2Question}, #{part2EachOrigiScore}, #{totalScore}, #{status}, #{areaId} )
</insert>
<update id="updateUnivExamPaper" parameterType="UnivExamPaper">
UPDATE UnivExamPaper SET
examPaperId = #{examPaperId}, authorType = #{authorType}, teacherId = #{teacherId}, examLevel = #{examLevel}, title = #{title}, isRecommend = #{isRecommend}, part1Text = #{part1Text}, part1Voice = #{part1Voice}, part1OrigiScore = #{part1OrigiScore}, part2Text = #{part2Text}, part2Voice = #{part2Voice}, part2Question = #{part2Question}, part2EachOrigiScore = #{part2EachOrigiScore}, totalScore = #{totalScore}, status = #{status}, areaId = #{areaId}
where examPaperId=#{examPaperId}
</update>
<select id="getUnivExamPaperByKey" parameterType="java.lang.Integer" resultType="UnivExamPaper">
SELECT examPaperId , authorType , teacherId , examLevel , title , isRecommend , part1Text , part1Voice , part1OrigiScore , part2Text , part2Voice , part2Question , part2EachOrigiScore , totalScore , status , areaId
FROM UnivExamPaper WHERE examPaperId=#{examPaperId}
</select>
<select id="getSeqUnivExamPaper" resultType="Integer" useCache="false" flushCache="true">
SELECT nextval('seq_univExamPaperId') ;
</select>
<select id="getUnivExamPapersCountByTeacherId" parameterType="java.lang.Long" resultType="Integer">
SELECT count(*) as howmuch from UnivExamPaper
WHERE teacherId=#{teacherId}and status = 1
</select>
<select id="getUnivExamPapersByTeacherId" parameterType="java.util.Map" resultType="UnivExamPaper">
SELECT examPaperId , authorType , teacherId , examLevel , title , isRecommend , part1Text , part1Voice , part1OrigiScore , part2Text , part2Voice , part2Question , part2EachOrigiScore , totalScore , status , areaId
FROM UnivExamPaper
WHERE teacherId=#{teacherId} and status = 1
ORDER BY examPaperId desc
<if test="pageSize!=null">
LIMIT #{pageSize}
</if>
<if test="offset!=null">
OFFSET #{offset}
</if>
</select>
<update id="univExamPaperBatchUpdateByExamPaperId">
UPDATE UnivExamPaper SET status = 0
WHERE examPaperId in
<foreach collection="list" index="index" item="item" separator="," close=")" open="(">
#{item}
</foreach>
</update>
</mapper>