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

244 lines
9.0 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="com.joylink.ms.dao.DraftMapParkingTimeDAO">
<resultMap id="BaseResultMap" type="com.joylink.ms.entity.DraftMapParkingTime">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="map_id" jdbcType="BIGINT" property="mapId" />
<result column="station_code" jdbcType="VARCHAR" property="stationCode" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.joylink.ms.entity.DraftMapParkingTime">
<result column="section_parking_time" jdbcType="LONGVARCHAR" property="sectionParkingTime" />
</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, station_code
</sql>
<sql id="Blob_Column_List">
section_parking_time
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.joylink.ms.entity.DraftMapParkingTimeExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from draft_map_parking_time
<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="com.joylink.ms.entity.DraftMapParkingTimeExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from draft_map_parking_time
<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 draft_map_parking_time
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from draft_map_parking_time
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.joylink.ms.entity.DraftMapParkingTimeExample">
delete from draft_map_parking_time
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.joylink.ms.entity.DraftMapParkingTime" useGeneratedKeys="true">
insert into draft_map_parking_time (map_id, station_code, section_parking_time
)
values (#{mapId,jdbcType=BIGINT}, #{stationCode,jdbcType=VARCHAR}, #{sectionParkingTime,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.joylink.ms.entity.DraftMapParkingTime" useGeneratedKeys="true">
insert into draft_map_parking_time
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mapId != null">
map_id,
</if>
<if test="stationCode != null">
station_code,
</if>
<if test="sectionParkingTime != null">
section_parking_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mapId != null">
#{mapId,jdbcType=BIGINT},
</if>
<if test="stationCode != null">
#{stationCode,jdbcType=VARCHAR},
</if>
<if test="sectionParkingTime != null">
#{sectionParkingTime,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.joylink.ms.entity.DraftMapParkingTimeExample" resultType="java.lang.Long">
select count(*) from draft_map_parking_time
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update draft_map_parking_time
<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.stationCode != null">
station_code = #{record.stationCode,jdbcType=VARCHAR},
</if>
<if test="record.sectionParkingTime != null">
section_parking_time = #{record.sectionParkingTime,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update draft_map_parking_time
set id = #{record.id,jdbcType=BIGINT},
map_id = #{record.mapId,jdbcType=BIGINT},
station_code = #{record.stationCode,jdbcType=VARCHAR},
section_parking_time = #{record.sectionParkingTime,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update draft_map_parking_time
set id = #{record.id,jdbcType=BIGINT},
map_id = #{record.mapId,jdbcType=BIGINT},
station_code = #{record.stationCode,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.joylink.ms.entity.DraftMapParkingTime">
update draft_map_parking_time
<set>
<if test="mapId != null">
map_id = #{mapId,jdbcType=BIGINT},
</if>
<if test="stationCode != null">
station_code = #{stationCode,jdbcType=VARCHAR},
</if>
<if test="sectionParkingTime != null">
section_parking_time = #{sectionParkingTime,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.joylink.ms.entity.DraftMapParkingTime">
update draft_map_parking_time
set map_id = #{mapId,jdbcType=BIGINT},
station_code = #{stationCode,jdbcType=VARCHAR},
section_parking_time = #{sectionParkingTime,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.joylink.ms.entity.DraftMapParkingTime">
update draft_map_parking_time
set map_id = #{mapId,jdbcType=BIGINT},
station_code = #{stationCode,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>