228 lines
8.6 KiB
XML
228 lines
8.6 KiB
XML
<?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="club.joylink.rtss.dao.RaceQuestionProgressDAO">
|
|
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.RaceQuestionProgress">
|
|
<id column="id" jdbcType="BIGINT" property="id" />
|
|
<result column="user_id" jdbcType="BIGINT" property="userId" />
|
|
<result column="question_index" jdbcType="BIGINT" property="questionIndex" />
|
|
<result column="project_code" jdbcType="VARCHAR" property="projectCode" />
|
|
<result column="incorrect" jdbcType="VARCHAR" property="incorrect" />
|
|
<result column="company_id" jdbcType="INTEGER" property="companyId" />
|
|
</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_id, question_index, project_code, incorrect, company_id
|
|
</sql>
|
|
<select id="selectByExample" parameterType="club.joylink.rtss.entity.RaceQuestionProgressExample" resultMap="BaseResultMap">
|
|
select
|
|
<if test="distinct">
|
|
distinct
|
|
</if>
|
|
<include refid="Base_Column_List" />
|
|
from race_question_progress
|
|
<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 race_question_progress
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
delete from race_question_progress
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</delete>
|
|
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.RaceQuestionProgressExample">
|
|
delete from race_question_progress
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</delete>
|
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.RaceQuestionProgress" useGeneratedKeys="true">
|
|
insert into race_question_progress (user_id, question_index, project_code,
|
|
incorrect, company_id)
|
|
values (#{userId,jdbcType=BIGINT}, #{questionIndex,jdbcType=BIGINT}, #{projectCode,jdbcType=VARCHAR},
|
|
#{incorrect,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER})
|
|
</insert>
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.RaceQuestionProgress" useGeneratedKeys="true">
|
|
insert into race_question_progress
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="userId != null">
|
|
user_id,
|
|
</if>
|
|
<if test="questionIndex != null">
|
|
question_index,
|
|
</if>
|
|
<if test="projectCode != null">
|
|
project_code,
|
|
</if>
|
|
<if test="incorrect != null">
|
|
incorrect,
|
|
</if>
|
|
<if test="companyId != null">
|
|
company_id,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="userId != null">
|
|
#{userId,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="questionIndex != null">
|
|
#{questionIndex,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="projectCode != null">
|
|
#{projectCode,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="incorrect != null">
|
|
#{incorrect,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="companyId != null">
|
|
#{companyId,jdbcType=INTEGER},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<select id="countByExample" parameterType="club.joylink.rtss.entity.RaceQuestionProgressExample" resultType="java.lang.Long">
|
|
select count(*) from race_question_progress
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</select>
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
update race_question_progress
|
|
<set>
|
|
<if test="record.id != null">
|
|
id = #{record.id,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="record.userId != null">
|
|
user_id = #{record.userId,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="record.questionIndex != null">
|
|
question_index = #{record.questionIndex,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="record.projectCode != null">
|
|
project_code = #{record.projectCode,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.incorrect != null">
|
|
incorrect = #{record.incorrect,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.companyId != null">
|
|
company_id = #{record.companyId,jdbcType=INTEGER},
|
|
</if>
|
|
</set>
|
|
<if test="_parameter != null">
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
</if>
|
|
</update>
|
|
<update id="updateByExample" parameterType="map">
|
|
update race_question_progress
|
|
set id = #{record.id,jdbcType=BIGINT},
|
|
user_id = #{record.userId,jdbcType=BIGINT},
|
|
question_index = #{record.questionIndex,jdbcType=BIGINT},
|
|
project_code = #{record.projectCode,jdbcType=VARCHAR},
|
|
incorrect = #{record.incorrect,jdbcType=VARCHAR},
|
|
company_id = #{record.companyId,jdbcType=INTEGER}
|
|
<if test="_parameter != null">
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
</if>
|
|
</update>
|
|
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.RaceQuestionProgress">
|
|
update race_question_progress
|
|
<set>
|
|
<if test="userId != null">
|
|
user_id = #{userId,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="questionIndex != null">
|
|
question_index = #{questionIndex,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="projectCode != null">
|
|
project_code = #{projectCode,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="incorrect != null">
|
|
incorrect = #{incorrect,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="companyId != null">
|
|
company_id = #{companyId,jdbcType=INTEGER},
|
|
</if>
|
|
</set>
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</update>
|
|
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.RaceQuestionProgress">
|
|
update race_question_progress
|
|
set user_id = #{userId,jdbcType=BIGINT},
|
|
question_index = #{questionIndex,jdbcType=BIGINT},
|
|
project_code = #{projectCode,jdbcType=VARCHAR},
|
|
incorrect = #{incorrect,jdbcType=VARCHAR},
|
|
company_id = #{companyId,jdbcType=INTEGER}
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</update>
|
|
</mapper> |