<?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.OnenetDeviceMapper">
|
|
<resultMap id="BaseResultMap" type="com.topsail.influxdb.pojo.OnenetDevice">
|
|
<result column="id" jdbcType="INTEGER" property="id" />
|
|
<result column="verifyCode" jdbcType="VARCHAR" property="verifycode" />
|
|
<result column="deviceId" jdbcType="VARCHAR" property="deviceid" />
|
|
<result column="deviceType" jdbcType="VARCHAR" property="devicetype" />
|
|
<result column="userName" jdbcType="VARCHAR" property="username" />
|
|
<result column="latitude" jdbcType="DOUBLE" property="latitude" />
|
|
<result column="longitude" jdbcType="DOUBLE" property="longitude" />
|
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
|
<result column="period" jdbcType="VARCHAR" property="period" />
|
|
<result column="imei" jdbcType="VARCHAR" property="imei" />
|
|
<result column="dperiod" jdbcType="INTEGER" property="dperiod" />
|
|
<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, verifyCode, deviceId, deviceType, userName, latitude, longitude, type, period,
|
|
imei, dperiod, company_id
|
|
</sql>
|
|
<select id="selectByExample" parameterType="com.topsail.influxdb.pojo.OnenetDeviceExample" resultMap="BaseResultMap">
|
|
select
|
|
<if test="distinct">
|
|
distinct
|
|
</if>
|
|
<include refid="Base_Column_List" />
|
|
from onenet_device
|
|
<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.OnenetDeviceExample">
|
|
delete from onenet_device
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</delete>
|
|
<insert id="insert" parameterType="com.topsail.influxdb.pojo.OnenetDevice">
|
|
insert into onenet_device (id, verifyCode, deviceId,
|
|
deviceType, userName, latitude,
|
|
longitude, type, period,
|
|
imei, dperiod, company_id
|
|
)
|
|
values (#{id,jdbcType=INTEGER}, #{verifycode,jdbcType=VARCHAR}, #{deviceid,jdbcType=VARCHAR},
|
|
#{devicetype,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{latitude,jdbcType=DOUBLE},
|
|
#{longitude,jdbcType=DOUBLE}, #{type,jdbcType=VARCHAR}, #{period,jdbcType=VARCHAR},
|
|
#{imei,jdbcType=VARCHAR}, #{dperiod,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}
|
|
)
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="com.topsail.influxdb.pojo.OnenetDevice">
|
|
insert into onenet_device
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
id,
|
|
</if>
|
|
<if test="verifycode != null">
|
|
verifyCode,
|
|
</if>
|
|
<if test="deviceid != null">
|
|
deviceId,
|
|
</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="type != null">
|
|
type,
|
|
</if>
|
|
<if test="period != null">
|
|
period,
|
|
</if>
|
|
<if test="imei != null">
|
|
imei,
|
|
</if>
|
|
<if test="dperiod != null">
|
|
dperiod,
|
|
</if>
|
|
<if test="companyId != null">
|
|
company_id,
|
|
</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="deviceid != null">
|
|
#{deviceid,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=DOUBLE},
|
|
</if>
|
|
<if test="longitude != null">
|
|
#{longitude,jdbcType=DOUBLE},
|
|
</if>
|
|
<if test="type != null">
|
|
#{type,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="period != null">
|
|
#{period,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="imei != null">
|
|
#{imei,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="dperiod != null">
|
|
#{dperiod,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="companyId != null">
|
|
#{companyId,jdbcType=INTEGER},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<select id="countByExample" parameterType="com.topsail.influxdb.pojo.OnenetDeviceExample" resultType="java.lang.Long">
|
|
select count(*) from onenet_device
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</select>
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
update onenet_device
|
|
<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.deviceid != null">
|
|
deviceId = #{record.deviceid,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=DOUBLE},
|
|
</if>
|
|
<if test="record.longitude != null">
|
|
longitude = #{record.longitude,jdbcType=DOUBLE},
|
|
</if>
|
|
<if test="record.type != null">
|
|
type = #{record.type,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.period != null">
|
|
period = #{record.period,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.imei != null">
|
|
imei = #{record.imei,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.dperiod != null">
|
|
dperiod = #{record.dperiod,jdbcType=INTEGER},
|
|
</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 onenet_device
|
|
set id = #{record.id,jdbcType=INTEGER},
|
|
verifyCode = #{record.verifycode,jdbcType=VARCHAR},
|
|
deviceId = #{record.deviceid,jdbcType=VARCHAR},
|
|
deviceType = #{record.devicetype,jdbcType=VARCHAR},
|
|
userName = #{record.username,jdbcType=VARCHAR},
|
|
latitude = #{record.latitude,jdbcType=DOUBLE},
|
|
longitude = #{record.longitude,jdbcType=DOUBLE},
|
|
type = #{record.type,jdbcType=VARCHAR},
|
|
period = #{record.period,jdbcType=VARCHAR},
|
|
imei = #{record.imei,jdbcType=VARCHAR},
|
|
dperiod = #{record.dperiod,jdbcType=INTEGER},
|
|
company_id = #{record.companyId,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 onenet_device
|
|
(id, verifyCode, deviceId, deviceType, userName, latitude, longitude, type, period,
|
|
imei, dperiod, company_id)
|
|
values
|
|
<foreach collection="list" item="item" separator=",">
|
|
(#{item.id,jdbcType=INTEGER}, #{item.verifycode,jdbcType=VARCHAR}, #{item.deviceid,jdbcType=VARCHAR},
|
|
#{item.devicetype,jdbcType=VARCHAR}, #{item.username,jdbcType=VARCHAR}, #{item.latitude,jdbcType=DOUBLE},
|
|
#{item.longitude,jdbcType=DOUBLE}, #{item.type,jdbcType=VARCHAR}, #{item.period,jdbcType=VARCHAR},
|
|
#{item.imei,jdbcType=VARCHAR}, #{item.dperiod,jdbcType=INTEGER}, #{item.companyId,jdbcType=INTEGER}
|
|
)
|
|
</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 onenet_device (
|
|
<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="'deviceId'.toString() == column.value">
|
|
#{item.deviceid,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=DOUBLE}
|
|
</if>
|
|
<if test="'longitude'.toString() == column.value">
|
|
#{item.longitude,jdbcType=DOUBLE}
|
|
</if>
|
|
<if test="'type'.toString() == column.value">
|
|
#{item.type,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="'period'.toString() == column.value">
|
|
#{item.period,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="'imei'.toString() == column.value">
|
|
#{item.imei,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="'dperiod'.toString() == column.value">
|
|
#{item.dperiod,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="'company_id'.toString() == column.value">
|
|
#{item.companyId,jdbcType=INTEGER}
|
|
</if>
|
|
</foreach>
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
</mapper>
|