123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <?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.mxjb.mapper.MxjbPaperAnswersMapper">
-
- <resultMap type="MxjbPaperAnswers" id="MxjbPaperAnswersResult">
- <result property="answerId" column="answer_id" />
- <result property="examineeId" column="examinee_id" />
- <result property="examineeType" column="examinee_type" />
- <result property="paperType" column="paper_type" />
- <result property="questionId" column="question_id" />
- <result property="seq" column="seq" />
- <result property="knowledgeId" column="knowledge_id" />
- <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" />
- <result property="customerCode" column="customer_code" />
- <result property="customerName" column="customer_name" />
- <result property="questionType" column="qtpye" />
- <result property="knowledgeName" column="knowledge_name" />
- <result property="ranking" column="ranking" />
- </resultMap>
- <sql id="selectMxjbPaperAnswersVo">
- select answer_id, examinee_id, examinee_type, paper_type, question_id, seq, knowledge_id, answer, correct, duration, count, state, score_level, score, score_rate from mxjb_paper_answers
- </sql>
- <select id="selectMxjbAnswersByPaperExamineeId" parameterType="Long" resultMap="MxjbPaperAnswersResult">
- SELECT a.answer_id, a.question_id, a.seq, q.qtpye, a.knowledge_id, IF(k.name IS NULL, q.knowledges, k.name) knowledge_name, a.answer, a.correct, a.state, a.score_level, a.duration, a.score, a.score_rate
- FROM mxjb_paper_examinee e
- JOIN mxjb_paper_answers a ON a.examinee_type = 'ie' AND a.examinee_id = e.examinee_id
- LEFT JOIN knowledge_tree k ON k.id = a.knowledge_id
- JOIN questions q ON q.id = a.question_id
- WHERE e.examinee_id = #{examineeId}
- ORDER BY a.seq
- </select>
- <select id="selectMxjbPaperAnswersList" parameterType="MxjbPaperAnswers" resultMap="MxjbPaperAnswersResult">
- <include refid="selectMxjbPaperAnswersVo"/>
- <where>
- <if test="examineeId != null "> and examinee_id = #{examineeId}</if>
- <if test="examineeType != null and examineeType != ''"> and examinee_type = #{examineeType}</if>
- <if test="paperType != null and paperType != ''"> and paper_type = #{paperType}</if>
- <if test="questionId != null "> and question_id = #{questionId}</if>
- <if test="seq != null "> and seq = #{seq}</if>
- <if test="knowledgeId != null "> and knowledge_id = #{knowledgeId}</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="selectMxjbPaperAnswersById" parameterType="Long" resultMap="MxjbPaperAnswersResult">
- <include refid="selectMxjbPaperAnswersVo"/>
- where answer_id = #{answerId}
- </select>
-
- <insert id="insertMxjbPaperAnswers" parameterType="MxjbPaperAnswers" useGeneratedKeys="true" keyProperty="answerId">
- insert into mxjb_paper_answers
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="examineeId != null">examinee_id,</if>
- <if test="examineeType != null">examinee_type,</if>
- <if test="paperType != null">paper_type,</if>
- <if test="questionId != null">question_id,</if>
- <if test="seq != null">seq,</if>
- <if test="knowledgeId != null">knowledge_id,</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="paperType != null">#{paperType},</if>
- <if test="questionId != null">#{questionId},</if>
- <if test="seq != null">#{seq},</if>
- <if test="knowledgeId != null">#{knowledgeId},</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="updateMxjbPaperAnswers" parameterType="MxjbPaperAnswers">
- update mxjb_paper_answers
- <trim prefix="SET" suffixOverrides=",">
- <if test="examineeId != null">examinee_id = #{examineeId},</if>
- <if test="examineeType != null">examinee_type = #{examineeType},</if>
- <if test="paperType != null">paper_type = #{paperType},</if>
- <if test="questionId != null">question_id = #{questionId},</if>
- <if test="seq != null">seq = #{seq},</if>
- <if test="knowledgeId != null">knowledge_id = #{knowledgeId},</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="deleteMxjbPaperAnswersById" parameterType="Long">
- delete from mxjb_paper_answers where answer_id = #{answerId}
- </delete>
- <delete id="deleteMxjbPaperAnswersByIds" parameterType="String">
- delete from mxjb_paper_answers where answer_id in
- <foreach item="answerId" collection="array" open="(" separator="," close=")">
- #{answerId}
- </foreach>
- </delete>
- </mapper>
|