2020-11-19 10:07:10 +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">
|
2020-11-19 18:28:54 +08:00
|
|
|
<mapper namespace="club.joylink.rtss.dao.UserExamQuestionsMapper">
|
|
|
|
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.UserExamQuestions">
|
2020-11-19 10:07:10 +08:00
|
|
|
<id column="id" jdbcType="BIGINT" property="id" />
|
|
|
|
<result column="user_exam_id" jdbcType="BIGINT" property="userExamId" />
|
|
|
|
<result column="rules_id" jdbcType="BIGINT" property="rulesId" />
|
|
|
|
<result column="training_id" jdbcType="BIGINT" property="trainingId" />
|
|
|
|
<result column="point" jdbcType="INTEGER" property="point" />
|
|
|
|
<result column="score" jdbcType="REAL" property="score" />
|
|
|
|
<result column="used_time" jdbcType="INTEGER" property="usedTime" />
|
|
|
|
<result column="cause" jdbcType="VARCHAR" property="cause" />
|
|
|
|
</resultMap>
|
|
|
|
<sql id="Example_Where_Clause">
|
|
|
|
<where>
|
|
|
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
|
|
|
<if test="criteria.valid">
|
|
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
|
<foreach collection="criteria.criteria" item="criterion">
|
|
|
|
<choose>
|
|
|
|
<when test="criterion.noValue">
|
|
|
|
and ${criterion.condition}
|
|
|
|
</when>
|
|
|
|
<when test="criterion.singleValue">
|
|
|
|
and ${criterion.condition} #{criterion.value}
|
|
|
|
</when>
|
|
|
|
<when test="criterion.betweenValue">
|
|
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
|
</when>
|
|
|
|
<when test="criterion.listValue">
|
|
|
|
and ${criterion.condition}
|
|
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
|
#{listItem}
|
|
|
|
</foreach>
|
|
|
|
</when>
|
|
|
|
</choose>
|
|
|
|
</foreach>
|
|
|
|
</trim>
|
|
|
|
</if>
|
|
|
|
</foreach>
|
|
|
|
</where>
|
|
|
|
</sql>
|
|
|
|
<sql id="Update_By_Example_Where_Clause">
|
|
|
|
<where>
|
|
|
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
|
|
<if test="criteria.valid">
|
|
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
|
<foreach collection="criteria.criteria" item="criterion">
|
|
|
|
<choose>
|
|
|
|
<when test="criterion.noValue">
|
|
|
|
and ${criterion.condition}
|
|
|
|
</when>
|
|
|
|
<when test="criterion.singleValue">
|
|
|
|
and ${criterion.condition} #{criterion.value}
|
|
|
|
</when>
|
|
|
|
<when test="criterion.betweenValue">
|
|
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
|
</when>
|
|
|
|
<when test="criterion.listValue">
|
|
|
|
and ${criterion.condition}
|
|
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
|
#{listItem}
|
|
|
|
</foreach>
|
|
|
|
</when>
|
|
|
|
</choose>
|
|
|
|
</foreach>
|
|
|
|
</trim>
|
|
|
|
</if>
|
|
|
|
</foreach>
|
|
|
|
</where>
|
|
|
|
</sql>
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
id, user_exam_id, rules_id, training_id, point, score, used_time, cause
|
|
|
|
</sql>
|
2020-11-19 18:28:54 +08:00
|
|
|
<select id="selectByExample" parameterType="club.joylink.rtss.entity.UserExamQuestionsExample" resultMap="BaseResultMap">
|
2020-11-19 10:07:10 +08:00
|
|
|
select
|
|
|
|
<if test="distinct">
|
|
|
|
distinct
|
|
|
|
</if>
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
from user_exam_questions
|
|
|
|
<if test="_parameter != null">
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
</if>
|
|
|
|
<if test="orderByClause != null">
|
|
|
|
order by ${orderByClause}
|
|
|
|
</if>
|
|
|
|
<if test="limit != null">
|
|
|
|
<if test="offset != null">
|
|
|
|
limit ${offset}, ${limit}
|
|
|
|
</if>
|
|
|
|
<if test="offset == null">
|
|
|
|
limit ${limit}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
|
select
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
from user_exam_questions
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
</select>
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
|
delete from user_exam_questions
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
</delete>
|
2020-11-19 18:28:54 +08:00
|
|
|
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.UserExamQuestionsExample">
|
2020-11-19 10:07:10 +08:00
|
|
|
delete from user_exam_questions
|
|
|
|
<if test="_parameter != null">
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
</if>
|
|
|
|
</delete>
|
2020-11-19 18:28:54 +08:00
|
|
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.UserExamQuestions" useGeneratedKeys="true">
|
2020-11-19 10:07:10 +08:00
|
|
|
insert into user_exam_questions (user_exam_id, rules_id, training_id,
|
|
|
|
point, score, used_time,
|
|
|
|
cause)
|
|
|
|
values (#{userExamId,jdbcType=BIGINT}, #{rulesId,jdbcType=BIGINT}, #{trainingId,jdbcType=BIGINT},
|
|
|
|
#{point,jdbcType=INTEGER}, #{score,jdbcType=REAL}, #{usedTime,jdbcType=INTEGER},
|
|
|
|
#{cause,jdbcType=VARCHAR})
|
|
|
|
</insert>
|
2020-11-19 18:28:54 +08:00
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.UserExamQuestions" useGeneratedKeys="true">
|
2020-11-19 10:07:10 +08:00
|
|
|
insert into user_exam_questions
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null">
|
|
|
|
id,
|
|
|
|
</if>
|
|
|
|
<if test="userExamId != null">
|
|
|
|
user_exam_id,
|
|
|
|
</if>
|
|
|
|
<if test="rulesId != null">
|
|
|
|
rules_id,
|
|
|
|
</if>
|
|
|
|
<if test="trainingId != null">
|
|
|
|
training_id,
|
|
|
|
</if>
|
|
|
|
<if test="point != null">
|
|
|
|
point,
|
|
|
|
</if>
|
|
|
|
<if test="score != null">
|
|
|
|
score,
|
|
|
|
</if>
|
|
|
|
<if test="usedTime != null">
|
|
|
|
used_time,
|
|
|
|
</if>
|
|
|
|
<if test="cause != null">
|
|
|
|
cause,
|
|
|
|
</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null">
|
|
|
|
#{id,jdbcType=BIGINT},
|
|
|
|
</if>
|
|
|
|
<if test="userExamId != null">
|
|
|
|
#{userExamId,jdbcType=BIGINT},
|
|
|
|
</if>
|
|
|
|
<if test="rulesId != null">
|
|
|
|
#{rulesId,jdbcType=BIGINT},
|
|
|
|
</if>
|
|
|
|
<if test="trainingId != null">
|
|
|
|
#{trainingId,jdbcType=BIGINT},
|
|
|
|
</if>
|
|
|
|
<if test="point != null">
|
|
|
|
#{point,jdbcType=INTEGER},
|
|
|
|
</if>
|
|
|
|
<if test="score != null">
|
|
|
|
#{score,jdbcType=REAL},
|
|
|
|
</if>
|
|
|
|
<if test="usedTime != null">
|
|
|
|
#{usedTime,jdbcType=INTEGER},
|
|
|
|
</if>
|
|
|
|
<if test="cause != null">
|
|
|
|
#{cause,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
2020-11-19 18:28:54 +08:00
|
|
|
<select id="countByExample" parameterType="club.joylink.rtss.entity.UserExamQuestionsExample" resultType="java.lang.Long">
|
2020-11-19 10:07:10 +08:00
|
|
|
select count(*) from user_exam_questions
|
|
|
|
<if test="_parameter != null">
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
|
|
update user_exam_questions
|
|
|
|
<set>
|
|
|
|
<if test="record.id != null">
|
|
|
|
id = #{record.id,jdbcType=BIGINT},
|
|
|
|
</if>
|
|
|
|
<if test="record.userExamId != null">
|
|
|
|
user_exam_id = #{record.userExamId,jdbcType=BIGINT},
|
|
|
|
</if>
|
|
|
|
<if test="record.rulesId != null">
|
|
|
|
rules_id = #{record.rulesId,jdbcType=BIGINT},
|
|
|
|
</if>
|
|
|
|
<if test="record.trainingId != null">
|
|
|
|
training_id = #{record.trainingId,jdbcType=BIGINT},
|
|
|
|
</if>
|
|
|
|
<if test="record.point != null">
|
|
|
|
point = #{record.point,jdbcType=INTEGER},
|
|
|
|
</if>
|
|
|
|
<if test="record.score != null">
|
|
|
|
score = #{record.score,jdbcType=REAL},
|
|
|
|
</if>
|
|
|
|
<if test="record.usedTime != null">
|
|
|
|
used_time = #{record.usedTime,jdbcType=INTEGER},
|
|
|
|
</if>
|
|
|
|
<if test="record.cause != null">
|
|
|
|
cause = #{record.cause,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
</set>
|
|
|
|
<if test="_parameter != null">
|
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
|
</if>
|
|
|
|
</update>
|
|
|
|
<update id="updateByExample" parameterType="map">
|
|
|
|
update user_exam_questions
|
|
|
|
set id = #{record.id,jdbcType=BIGINT},
|
|
|
|
user_exam_id = #{record.userExamId,jdbcType=BIGINT},
|
|
|
|
rules_id = #{record.rulesId,jdbcType=BIGINT},
|
|
|
|
training_id = #{record.trainingId,jdbcType=BIGINT},
|
|
|
|
point = #{record.point,jdbcType=INTEGER},
|
|
|
|
score = #{record.score,jdbcType=REAL},
|
|
|
|
used_time = #{record.usedTime,jdbcType=INTEGER},
|
|
|
|
cause = #{record.cause,jdbcType=VARCHAR}
|
|
|
|
<if test="_parameter != null">
|
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
|
</if>
|
|
|
|
</update>
|
2020-11-19 18:28:54 +08:00
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.UserExamQuestions">
|
2020-11-19 10:07:10 +08:00
|
|
|
update user_exam_questions
|
|
|
|
<set>
|
|
|
|
<if test="userExamId != null">
|
|
|
|
user_exam_id = #{userExamId,jdbcType=BIGINT},
|
|
|
|
</if>
|
|
|
|
<if test="rulesId != null">
|
|
|
|
rules_id = #{rulesId,jdbcType=BIGINT},
|
|
|
|
</if>
|
|
|
|
<if test="trainingId != null">
|
|
|
|
training_id = #{trainingId,jdbcType=BIGINT},
|
|
|
|
</if>
|
|
|
|
<if test="point != null">
|
|
|
|
point = #{point,jdbcType=INTEGER},
|
|
|
|
</if>
|
|
|
|
<if test="score != null">
|
|
|
|
score = #{score,jdbcType=REAL},
|
|
|
|
</if>
|
|
|
|
<if test="usedTime != null">
|
|
|
|
used_time = #{usedTime,jdbcType=INTEGER},
|
|
|
|
</if>
|
|
|
|
<if test="cause != null">
|
|
|
|
cause = #{cause,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
</set>
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
</update>
|
2020-11-19 18:28:54 +08:00
|
|
|
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.UserExamQuestions">
|
2020-11-19 10:07:10 +08:00
|
|
|
update user_exam_questions
|
|
|
|
set user_exam_id = #{userExamId,jdbcType=BIGINT},
|
|
|
|
rules_id = #{rulesId,jdbcType=BIGINT},
|
|
|
|
training_id = #{trainingId,jdbcType=BIGINT},
|
|
|
|
point = #{point,jdbcType=INTEGER},
|
|
|
|
score = #{score,jdbcType=REAL},
|
|
|
|
used_time = #{usedTime,jdbcType=INTEGER},
|
|
|
|
cause = #{cause,jdbcType=VARCHAR}
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
</update>
|
|
|
|
</mapper>
|