<?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.ots.project.exam.mapper.TExamPaperQuestionMapper">
|
|
<resultMap type="TExamPaperQuestion" id="TExamPaperQuestionResult">
|
<result property="paperId" column="paper_id" />
|
<result property="questionId" column="question_id" />
|
<result property="permanentId" column="permanent_id" />
|
</resultMap>
|
|
<sql id="selectTExamPaperQuestionVo">
|
select paper_id, question_id, permanent_id from t_exam_paper_question
|
</sql>
|
|
<select id="selectTExamPaperQuestionList" parameterType="TExamPaperQuestion" resultMap="TExamPaperQuestionResult">
|
<include refid="selectTExamPaperQuestionVo"/>
|
<where>
|
<if test="questionId != null "> and question_id = #{questionId}</if>
|
<if test="permanentId != null and permanentId != ''"> and permanent_id = #{permanentId}</if>
|
</where>
|
</select>
|
|
<select id="selectTExamPaperQuestionById" parameterType="Long" resultMap="TExamPaperQuestionResult">
|
<include refid="selectTExamPaperQuestionVo"/>
|
where paper_id = #{paperId}
|
</select>
|
|
<insert id="insertTExamPaperQuestion" parameterType="TExamPaperQuestion">
|
insert into t_exam_paper_question
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="paperId != null ">paper_id,</if>
|
<if test="questionId != null ">question_id,</if>
|
<if test="permanentId != null and permanentId != ''">permanent_id,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="paperId != null ">#{paperId},</if>
|
<if test="questionId != null ">#{questionId},</if>
|
<if test="permanentId != null and permanentId != ''">#{permanentId},</if>
|
</trim>
|
</insert>
|
|
<update id="updateTExamPaperQuestion" parameterType="TExamPaperQuestion">
|
update t_exam_paper_question
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="questionId != null ">question_id = #{questionId},</if>
|
<if test="permanentId != null and permanentId != ''">permanent_id = #{permanentId},</if>
|
</trim>
|
where paper_id = #{paperId}
|
</update>
|
|
<delete id="deleteTExamPaperQuestionById" parameterType="Long">
|
delete from t_exam_paper_question where paper_id = #{paperId}
|
</delete>
|
|
<delete id="deleteTExamPaperQuestionByIds" parameterType="String">
|
delete from t_exam_paper_question where paper_id in
|
<foreach item="paperId" collection="array" open="(" separator="," close=")">
|
#{paperId}
|
</foreach>
|
</delete>
|
|
</mapper>
|