rt-sim-training-service/src/main/resources/mybatis/mapper/RunPlanDraftDAO.xml

314 lines
11 KiB
XML
Raw Normal View History

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">
<mapper namespace="club.joylink.rtss.dao.RunPlanDraftDAO">
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.RunPlanDraft">
2020-11-19 10:07:10 +08:00
<id column="id" jdbcType="BIGINT" property="id" />
<result column="map_id" jdbcType="BIGINT" property="mapId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="creator_id" jdbcType="BIGINT" property="creatorId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="explanation" jdbcType="VARCHAR" property="explanation" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="club.joylink.rtss.entity.RunPlanDraft">
2020-11-19 10:07:10 +08:00
<result column="trips" jdbcType="LONGVARCHAR" property="trips" />
</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, map_id, `name`, creator_id, create_time, `status`, explanation
</sql>
<sql id="Blob_Column_List">
trips
</sql>
<select id="selectByExampleWithBLOBs" parameterType="club.joylink.rtss.entity.RunPlanDraftExample" resultMap="ResultMapWithBLOBs">
2020-11-19 10:07:10 +08:00
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from run_plan_draft
<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="selectByExample" parameterType="club.joylink.rtss.entity.RunPlanDraftExample" resultMap="BaseResultMap">
2020-11-19 10:07:10 +08:00
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from run_plan_draft
<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="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from run_plan_draft
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from run_plan_draft
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.RunPlanDraftExample">
2020-11-19 10:07:10 +08:00
delete from run_plan_draft
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.RunPlanDraft" useGeneratedKeys="true">
2020-11-19 10:07:10 +08:00
insert into run_plan_draft (map_id, `name`, creator_id,
create_time, `status`, explanation,
trips)
values (#{mapId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT},
#{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, #{explanation,jdbcType=VARCHAR},
#{trips,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.RunPlanDraft" useGeneratedKeys="true">
2020-11-19 10:07:10 +08:00
insert into run_plan_draft
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mapId != null">
map_id,
</if>
<if test="name != null">
`name`,
</if>
<if test="creatorId != null">
creator_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="status != null">
`status`,
</if>
<if test="explanation != null">
explanation,
</if>
<if test="trips != null">
trips,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mapId != null">
#{mapId,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="creatorId != null">
#{creatorId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="explanation != null">
#{explanation,jdbcType=VARCHAR},
</if>
<if test="trips != null">
#{trips,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="club.joylink.rtss.entity.RunPlanDraftExample" resultType="java.lang.Long">
2020-11-19 10:07:10 +08:00
select count(*) from run_plan_draft
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update run_plan_draft
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.mapId != null">
map_id = #{record.mapId,jdbcType=BIGINT},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.creatorId != null">
creator_id = #{record.creatorId,jdbcType=BIGINT},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.explanation != null">
explanation = #{record.explanation,jdbcType=VARCHAR},
</if>
<if test="record.trips != null">
trips = #{record.trips,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update run_plan_draft
set id = #{record.id,jdbcType=BIGINT},
map_id = #{record.mapId,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR},
creator_id = #{record.creatorId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
`status` = #{record.status,jdbcType=VARCHAR},
explanation = #{record.explanation,jdbcType=VARCHAR},
trips = #{record.trips,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update run_plan_draft
set id = #{record.id,jdbcType=BIGINT},
map_id = #{record.mapId,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR},
creator_id = #{record.creatorId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
`status` = #{record.status,jdbcType=VARCHAR},
explanation = #{record.explanation,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.RunPlanDraft">
2020-11-19 10:07:10 +08:00
update run_plan_draft
<set>
<if test="mapId != null">
map_id = #{mapId,jdbcType=BIGINT},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="creatorId != null">
creator_id = #{creatorId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="explanation != null">
explanation = #{explanation,jdbcType=VARCHAR},
</if>
<if test="trips != null">
trips = #{trips,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="club.joylink.rtss.entity.RunPlanDraft">
2020-11-19 10:07:10 +08:00
update run_plan_draft
set map_id = #{mapId,jdbcType=BIGINT},
`name` = #{name,jdbcType=VARCHAR},
creator_id = #{creatorId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
`status` = #{status,jdbcType=VARCHAR},
explanation = #{explanation,jdbcType=VARCHAR},
trips = #{trips,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.RunPlanDraft">
2020-11-19 10:07:10 +08:00
update run_plan_draft
set map_id = #{mapId,jdbcType=BIGINT},
`name` = #{name,jdbcType=VARCHAR},
creator_id = #{creatorId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
`status` = #{status,jdbcType=VARCHAR},
explanation = #{explanation,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>