|
@ -5,14 +5,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
<mapper namespace="com.ruoyi.model.mapper.AppletAnswerTrainMapper"> |
|
|
<mapper namespace="com.ruoyi.model.mapper.AppletAnswerTrainMapper"> |
|
|
|
|
|
|
|
|
<resultMap type="AppletAnswerTrain" id="AppletAnswerTrainResult"> |
|
|
<resultMap type="AppletAnswerTrain" id="AppletAnswerTrainResult"> |
|
|
|
|
|
<result property="id" column="id" /> |
|
|
<result property="questionId" column="question_id" /> |
|
|
<result property="questionId" column="question_id" /> |
|
|
<result property="userId" column="user_id" /> |
|
|
<result property="userId" column="user_id" /> |
|
|
<result property="answer" column="answer" /> |
|
|
<result property="answer" column="answer" /> |
|
|
<result property="remark" column="remark" /> |
|
|
<result property="remark" column="remark" /> |
|
|
|
|
|
<result property="delFlag" column="del_flag" /> |
|
|
|
|
|
<result property="createBy" column="create_by" /> |
|
|
|
|
|
<result property="createTime" column="create_time" /> |
|
|
|
|
|
<result property="updateBy" column="update_by" /> |
|
|
|
|
|
<result property="updateTime" column="update_time" /> |
|
|
</resultMap> |
|
|
</resultMap> |
|
|
|
|
|
|
|
|
<sql id="selectAppletAnswerTrainVo"> |
|
|
<sql id="selectAppletAnswerTrainVo"> |
|
|
select question_id, user_id, answer, remark from applet_answer_train |
|
|
|
|
|
|
|
|
select id, question_id, user_id, answer, remark, del_flag, create_by, create_time, update_by, update_time from applet_answer_train |
|
|
</sql> |
|
|
</sql> |
|
|
|
|
|
|
|
|
<select id="selectAppletAnswerTrainList" parameterType="AppletAnswerTrain" resultMap="AppletAnswerTrainResult"> |
|
|
<select id="selectAppletAnswerTrainList" parameterType="AppletAnswerTrain" resultMap="AppletAnswerTrainResult"> |
|
@ -24,45 +30,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
</where> |
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="selectAppletAnswerTrainByQuestionId" parameterType="Long" resultMap="AppletAnswerTrainResult"> |
|
|
|
|
|
|
|
|
<select id="selectAppletAnswerTrainById" parameterType="Long" resultMap="AppletAnswerTrainResult"> |
|
|
<include refid="selectAppletAnswerTrainVo"/> |
|
|
<include refid="selectAppletAnswerTrainVo"/> |
|
|
where question_id = #{questionId} |
|
|
|
|
|
|
|
|
where id = #{id} |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<insert id="insertAppletAnswerTrain" parameterType="AppletAnswerTrain"> |
|
|
|
|
|
|
|
|
<insert id="insertAppletAnswerTrain" parameterType="AppletAnswerTrain" useGeneratedKeys="true" keyProperty="id"> |
|
|
insert into applet_answer_train |
|
|
insert into applet_answer_train |
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
<if test="questionId != null">question_id,</if> |
|
|
<if test="questionId != null">question_id,</if> |
|
|
<if test="userId != null">user_id,</if> |
|
|
<if test="userId != null">user_id,</if> |
|
|
<if test="answer != null and answer != ''">answer,</if> |
|
|
<if test="answer != null and answer != ''">answer,</if> |
|
|
<if test="remark != null">remark,</if> |
|
|
<if test="remark != null">remark,</if> |
|
|
|
|
|
<if test="delFlag != null">del_flag,</if> |
|
|
|
|
|
<if test="createBy != null">create_by,</if> |
|
|
|
|
|
<if test="createTime != null">create_time,</if> |
|
|
|
|
|
<if test="updateBy != null">update_by,</if> |
|
|
|
|
|
<if test="updateTime != null">update_time,</if> |
|
|
</trim> |
|
|
</trim> |
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
<if test="questionId != null">#{questionId},</if> |
|
|
<if test="questionId != null">#{questionId},</if> |
|
|
<if test="userId != null">#{userId},</if> |
|
|
<if test="userId != null">#{userId},</if> |
|
|
<if test="answer != null and answer != ''">#{answer},</if> |
|
|
<if test="answer != null and answer != ''">#{answer},</if> |
|
|
<if test="remark != null">#{remark},</if> |
|
|
<if test="remark != null">#{remark},</if> |
|
|
|
|
|
<if test="delFlag != null">#{delFlag},</if> |
|
|
|
|
|
<if test="createBy != null">#{createBy},</if> |
|
|
|
|
|
<if test="createTime != null">#{createTime},</if> |
|
|
|
|
|
<if test="updateBy != null">#{updateBy},</if> |
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if> |
|
|
</trim> |
|
|
</trim> |
|
|
</insert> |
|
|
</insert> |
|
|
|
|
|
|
|
|
<update id="updateAppletAnswerTrain" parameterType="AppletAnswerTrain"> |
|
|
<update id="updateAppletAnswerTrain" parameterType="AppletAnswerTrain"> |
|
|
update applet_answer_train |
|
|
update applet_answer_train |
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
|
|
|
<if test="questionId != null">question_id = #{questionId},</if> |
|
|
<if test="userId != null">user_id = #{userId},</if> |
|
|
<if test="userId != null">user_id = #{userId},</if> |
|
|
<if test="answer != null and answer != ''">answer = #{answer},</if> |
|
|
<if test="answer != null and answer != ''">answer = #{answer},</if> |
|
|
<if test="remark != null">remark = #{remark},</if> |
|
|
<if test="remark != null">remark = #{remark},</if> |
|
|
|
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if> |
|
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if> |
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if> |
|
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if> |
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if> |
|
|
</trim> |
|
|
</trim> |
|
|
where question_id = #{questionId} |
|
|
|
|
|
|
|
|
where id = #{id} |
|
|
</update> |
|
|
</update> |
|
|
|
|
|
|
|
|
<delete id="deleteAppletAnswerTrainByQuestionId" parameterType="Long"> |
|
|
|
|
|
delete from applet_answer_train where question_id = #{questionId} |
|
|
|
|
|
|
|
|
<delete id="deleteAppletAnswerTrainById" parameterType="Long"> |
|
|
|
|
|
delete from applet_answer_train where id = #{id} |
|
|
</delete> |
|
|
</delete> |
|
|
|
|
|
|
|
|
<delete id="deleteAppletAnswerTrainByQuestionIds" parameterType="String"> |
|
|
|
|
|
delete from applet_answer_train where question_id in |
|
|
|
|
|
<foreach item="questionId" collection="array" open="(" separator="," close=")"> |
|
|
|
|
|
#{questionId} |
|
|
|
|
|
|
|
|
<delete id="deleteAppletAnswerTrainByIds" parameterType="String"> |
|
|
|
|
|
delete from applet_answer_train where id in |
|
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|
|
|
|
|
#{id} |
|
|
</foreach> |
|
|
</foreach> |
|
|
</delete> |
|
|
</delete> |
|
|
</mapper> |
|
|
</mapper> |