123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <?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.ruoyi.sy.mapper.SyTestAnswersMapper">
-
- <resultMap type="SyTestAnswers" id="SyTestAnswersResult">
- <result property="answerId" column="answer_id" />
- <result property="examineeId" column="examinee_id" />
- <result property="examineeType" column="examinee_type" />
- <result property="questionId" column="question_id" />
- <result property="seq" column="seq" />
- <result property="answer" column="answer" />
- <result property="correct" column="correct" />
- <result property="duration" column="duration" />
- <result property="count" column="count" />
- <result property="state" column="state" />
- <result property="scoreLevel" column="score_level" />
- <result property="score" column="score" />
- <result property="scoreRate" column="score_rate" />
- </resultMap>
- <sql id="selectSyTestAnswersVo">
- select answer_id, examinee_id, examinee_type, question_id, seq, answer, correct, duration, count, state, score_level, score, score_rate from sy_test_answers
- </sql>
- <select id="selectSyTestAnswersList" parameterType="SyTestAnswers" resultMap="SyTestAnswersResult">
- <include refid="selectSyTestAnswersVo"/>
- <where>
- <if test="examineeId != null "> and examinee_id = #{examineeId}</if>
- <if test="examineeType != null and examineeType != ''"> and examinee_type = #{examineeType}</if>
- <if test="questionId != null "> and question_id = #{questionId}</if>
- <if test="seq != null "> and seq = #{seq}</if>
- <if test="answer != null and answer != ''"> and answer = #{answer}</if>
- <if test="correct != null and correct != ''"> and correct = #{correct}</if>
- <if test="duration != null "> and duration = #{duration}</if>
- <if test="count != null "> and count = #{count}</if>
- <if test="state != null "> and state = #{state}</if>
- <if test="scoreLevel != null and scoreLevel != ''"> and score_level = #{scoreLevel}</if>
- <if test="score != null "> and score = #{score}</if>
- <if test="scoreRate != null "> and score_rate = #{scoreRate}</if>
- </where>
- </select>
-
- <select id="selectSyTestAnswersById" parameterType="Long" resultMap="SyTestAnswersResult">
- <include refid="selectSyTestAnswersVo"/>
- where answer_id = #{answerId}
- </select>
-
- <insert id="insertSyTestAnswers" parameterType="SyTestAnswers" useGeneratedKeys="true" keyProperty="answerId">
- insert into sy_test_answers
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="examineeId != null">examinee_id,</if>
- <if test="examineeType != null">examinee_type,</if>
- <if test="questionId != null">question_id,</if>
- <if test="seq != null">seq,</if>
- <if test="answer != null">answer,</if>
- <if test="correct != null">correct,</if>
- <if test="duration != null">duration,</if>
- <if test="count != null">count,</if>
- <if test="state != null">state,</if>
- <if test="scoreLevel != null">score_level,</if>
- <if test="score != null">score,</if>
- <if test="scoreRate != null">score_rate,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="examineeId != null">#{examineeId},</if>
- <if test="examineeType != null">#{examineeType},</if>
- <if test="questionId != null">#{questionId},</if>
- <if test="seq != null">#{seq},</if>
- <if test="answer != null">#{answer},</if>
- <if test="correct != null">#{correct},</if>
- <if test="duration != null">#{duration},</if>
- <if test="count != null">#{count},</if>
- <if test="state != null">#{state},</if>
- <if test="scoreLevel != null">#{scoreLevel},</if>
- <if test="score != null">#{score},</if>
- <if test="scoreRate != null">#{scoreRate},</if>
- </trim>
- </insert>
- <update id="updateSyTestAnswers" parameterType="SyTestAnswers">
- update sy_test_answers
- <trim prefix="SET" suffixOverrides=",">
- <if test="examineeId != null">examinee_id = #{examineeId},</if>
- <if test="examineeType != null">examinee_type = #{examineeType},</if>
- <if test="questionId != null">question_id = #{questionId},</if>
- <if test="seq != null">seq = #{seq},</if>
- <if test="answer != null">answer = #{answer},</if>
- <if test="correct != null">correct = #{correct},</if>
- <if test="duration != null">duration = #{duration},</if>
- <if test="count != null">count = #{count},</if>
- <if test="state != null">state = #{state},</if>
- <if test="scoreLevel != null">score_level = #{scoreLevel},</if>
- <if test="score != null">score = #{score},</if>
- <if test="scoreRate != null">score_rate = #{scoreRate},</if>
- </trim>
- where answer_id = #{answerId}
- </update>
- <delete id="deleteSyTestAnswersById" parameterType="Long">
- delete from sy_test_answers where answer_id = #{answerId}
- </delete>
- <delete id="deleteSyTestAnswersByIds" parameterType="String">
- delete from sy_test_answers where answer_id in
- <foreach item="answerId" collection="array" open="(" separator="," close=")">
- #{answerId}
- </foreach>
- </delete>
- </mapper>
|