<?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.topsail.influxdb.mapper.DeviceInfoMapper">
|
|
<resultMap id="BaseResultMap" type="com.topsail.influxdb.pojo.DeviceInfo">
|
|
<result column="id" jdbcType="INTEGER" property="id" />
|
|
<result column="verifyCode" jdbcType="VARCHAR" property="verifycode" />
|
|
<result column="deviceType" jdbcType="VARCHAR" property="devicetype" />
|
|
<result column="userName" jdbcType="VARCHAR" property="username" />
|
|
<result column="latitude" jdbcType="VARCHAR" property="latitude" />
|
|
<result column="longitude" jdbcType="VARCHAR" property="longitude" />
|
|
<result column="version" jdbcType="VARCHAR" property="version" />
|
|
<result column="fk_pid" jdbcType="INTEGER" property="fkPid" />
|
|
</resultMap>
|
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.topsail.influxdb.pojo.DeviceInfo">
|
|
<result column="deviceId" jdbcType="LONGVARCHAR" property="deviceid" />
|
|
</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, verifyCode, deviceType, userName, latitude, longitude, version, fk_pid
|
|
</sql>
|
|
<sql id="Blob_Column_List">
|
|
deviceId
|
|
</sql>
|
|
<select id="selectByExampleWithBLOBs" parameterType="com.topsail.influxdb.pojo.DeviceInfoExample" resultMap="ResultMapWithBLOBs">
|
|
select
|
|
<if test="distinct">
|
|
distinct
|
|
</if>
|
|
<include refid="Base_Column_List" />
|
|
,
|
|
<include refid="Blob_Column_List" />
|
|
from device_info
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
<if test="orderByClause != null">
|
|
order by ${orderByClause}
|
|
</if>
|
|
</select>
|
|
<select id="selectByExample" parameterType="com.topsail.influxdb.pojo.DeviceInfoExample" resultMap="BaseResultMap">
|
|
select
|
|
<if test="distinct">
|
|
distinct
|
|
</if>
|
|
<include refid="Base_Column_List" />
|
|
from device_info
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
<if test="orderByClause != null">
|
|
order by ${orderByClause}
|
|
</if>
|
|
</select>
|
|
<delete id="deleteByExample" parameterType="com.topsail.influxdb.pojo.DeviceInfoExample">
|
|
delete from device_info
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</delete>
|
|
<insert id="insert" parameterType="com.topsail.influxdb.pojo.DeviceInfo">
|
|
insert into device_info (id, verifyCode, deviceType,
|
|
userName, latitude, longitude,
|
|
version, fk_pid, deviceId
|
|
)
|
|
values (#{id,jdbcType=INTEGER}, #{verifycode,jdbcType=VARCHAR}, #{devicetype,jdbcType=VARCHAR},
|
|
#{username,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR},
|
|
#{version,jdbcType=VARCHAR}, #{fkPid,jdbcType=INTEGER}, #{deviceid,jdbcType=LONGVARCHAR}
|
|
)
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="com.topsail.influxdb.pojo.DeviceInfo">
|
|
insert into device_info
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
id,
|
|
</if>
|
|
<if test="verifycode != null">
|
|
verifyCode,
|
|
</if>
|
|
<if test="devicetype != null">
|
|
deviceType,
|
|
</if>
|
|
<if test="username != null">
|
|
userName,
|
|
</if>
|
|
<if test="latitude != null">
|
|
latitude,
|
|
</if>
|
|
<if test="longitude != null">
|
|
longitude,
|
|
</if>
|
|
<if test="version != null">
|
|
version,
|
|
</if>
|
|
<if test="fkPid != null">
|
|
fk_pid,
|
|
</if>
|
|
<if test="deviceid != null">
|
|
deviceId,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
#{id,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="verifycode != null">
|
|
#{verifycode,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="devicetype != null">
|
|
#{devicetype,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="username != null">
|
|
#{username,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="latitude != null">
|
|
#{latitude,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="longitude != null">
|
|
#{longitude,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="version != null">
|
|
#{version,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="fkPid != null">
|
|
#{fkPid,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="deviceid != null">
|
|
#{deviceid,jdbcType=LONGVARCHAR},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<select id="countByExample" parameterType="com.topsail.influxdb.pojo.DeviceInfoExample" resultType="java.lang.Long">
|
|
select count(*) from device_info
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</select>
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
update device_info
|
|
<set>
|
|
<if test="record.id != null">
|
|
id = #{record.id,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="record.verifycode != null">
|
|
verifyCode = #{record.verifycode,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.devicetype != null">
|
|
deviceType = #{record.devicetype,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.username != null">
|
|
userName = #{record.username,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.latitude != null">
|
|
latitude = #{record.latitude,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.longitude != null">
|
|
longitude = #{record.longitude,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.version != null">
|
|
version = #{record.version,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.fkPid != null">
|
|
fk_pid = #{record.fkPid,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="record.deviceid != null">
|
|
deviceId = #{record.deviceid,jdbcType=LONGVARCHAR},
|
|
</if>
|
|
</set>
|
|
<if test="_parameter != null">
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
</if>
|
|
</update>
|
|
<update id="updateByExampleWithBLOBs" parameterType="map">
|
|
update device_info
|
|
set id = #{record.id,jdbcType=INTEGER},
|
|
verifyCode = #{record.verifycode,jdbcType=VARCHAR},
|
|
deviceType = #{record.devicetype,jdbcType=VARCHAR},
|
|
userName = #{record.username,jdbcType=VARCHAR},
|
|
latitude = #{record.latitude,jdbcType=VARCHAR},
|
|
longitude = #{record.longitude,jdbcType=VARCHAR},
|
|
version = #{record.version,jdbcType=VARCHAR},
|
|
fk_pid = #{record.fkPid,jdbcType=INTEGER},
|
|
deviceId = #{record.deviceid,jdbcType=LONGVARCHAR}
|
|
<if test="_parameter != null">
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
</if>
|
|
</update>
|
|
<update id="updateByExample" parameterType="map">
|
|
update device_info
|
|
set id = #{record.id,jdbcType=INTEGER},
|
|
verifyCode = #{record.verifycode,jdbcType=VARCHAR},
|
|
deviceType = #{record.devicetype,jdbcType=VARCHAR},
|
|
userName = #{record.username,jdbcType=VARCHAR},
|
|
latitude = #{record.latitude,jdbcType=VARCHAR},
|
|
longitude = #{record.longitude,jdbcType=VARCHAR},
|
|
version = #{record.version,jdbcType=VARCHAR},
|
|
fk_pid = #{record.fkPid,jdbcType=INTEGER}
|
|
<if test="_parameter != null">
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
</if>
|
|
</update>
|
|
<insert id="batchInsert" parameterType="map">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
@project https://github.com/itfsw/mybatis-generator-plugin
|
|
-->
|
|
insert into device_info
|
|
(id, verifyCode, deviceType, userName, latitude, longitude, version, fk_pid, deviceId
|
|
)
|
|
values
|
|
<foreach collection="list" item="item" separator=",">
|
|
(#{item.id,jdbcType=INTEGER}, #{item.verifycode,jdbcType=VARCHAR}, #{item.devicetype,jdbcType=VARCHAR},
|
|
#{item.username,jdbcType=VARCHAR}, #{item.latitude,jdbcType=VARCHAR}, #{item.longitude,jdbcType=VARCHAR},
|
|
#{item.version,jdbcType=VARCHAR}, #{item.fkPid,jdbcType=INTEGER}, #{item.deviceid,jdbcType=LONGVARCHAR}
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
<insert id="batchInsertSelective" parameterType="map">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
@project https://github.com/itfsw/mybatis-generator-plugin
|
|
-->
|
|
insert into device_info (
|
|
<foreach collection="selective" item="column" separator=",">
|
|
${column.escapedColumnName}
|
|
</foreach>
|
|
)
|
|
values
|
|
<foreach collection="list" item="item" separator=",">
|
|
(
|
|
<foreach collection="selective" item="column" separator=",">
|
|
<if test="'id'.toString() == column.value">
|
|
#{item.id,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="'verifyCode'.toString() == column.value">
|
|
#{item.verifycode,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="'deviceType'.toString() == column.value">
|
|
#{item.devicetype,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="'userName'.toString() == column.value">
|
|
#{item.username,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="'latitude'.toString() == column.value">
|
|
#{item.latitude,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="'longitude'.toString() == column.value">
|
|
#{item.longitude,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="'version'.toString() == column.value">
|
|
#{item.version,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="'fk_pid'.toString() == column.value">
|
|
#{item.fkPid,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="'deviceId'.toString() == column.value">
|
|
#{item.deviceid,jdbcType=LONGVARCHAR}
|
|
</if>
|
|
</foreach>
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
</mapper>
|