You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

622 lines
23 KiB

<?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.DeviceDetailMapper">
<resultMap id="BaseResultMap" type="com.topsail.influxdb.pojo.DeviceDetail">
<id column="imei" jdbcType="VARCHAR" property="imei" />
<result column="id" jdbcType="INTEGER" property="id" />
<result column="device_type" jdbcType="INTEGER" property="deviceType" />
<result column="order_id" jdbcType="INTEGER" property="orderId" />
<result column="project_id" jdbcType="INTEGER" property="projectId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="lon" jdbcType="DOUBLE" property="lon" />
<result column="lat" jdbcType="DOUBLE" property="lat" />
<result column="buy_date" jdbcType="TIMESTAMP" property="buyDate" />
<result column="buy_long" jdbcType="REAL" property="buyLong" />
<result column="time" jdbcType="TIMESTAMP" property="time" />
<result column="imsi" jdbcType="VARCHAR" property="imsi" />
<result column="iccid" jdbcType="VARCHAR" property="iccid" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="delivered" jdbcType="INTEGER" property="delivered" />
<result column="platform" jdbcType="VARCHAR" property="platform" />
<result column="deviceId" jdbcType="VARCHAR" property="deviceid" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
<result column="period" jdbcType="INTEGER" property="period" />
<result column="belong" jdbcType="INTEGER" property="belong" />
<result column="handle_result" jdbcType="VARCHAR" property="handleResult" />
<result column="register_info_id" jdbcType="INTEGER" property="registerInfoId" />
<result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
</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">
imei, id, device_type, order_id, project_id, name, lon, lat, buy_date, buy_long,
time, imsi, iccid, address, delivered, platform, deviceId, company_id, period, belong,
handle_result, register_info_id, updatetime
</sql>
<select id="selectByExample" parameterType="com.topsail.influxdb.pojo.DeviceDetailExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from device_detail
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from device_detail
where imei = #{imei,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from device_detail
where imei = #{imei,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.topsail.influxdb.pojo.DeviceDetailExample">
delete from device_detail
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.topsail.influxdb.pojo.DeviceDetail">
insert into device_detail (imei, id, device_type,
order_id, project_id, name,
lon, lat, buy_date,
buy_long, time, imsi,
iccid, address, delivered,
platform, deviceId, company_id,
period, belong, handle_result,
register_info_id, updatetime)
values (#{imei,jdbcType=VARCHAR}, #{id,jdbcType=INTEGER}, #{deviceType,jdbcType=INTEGER},
#{orderId,jdbcType=INTEGER}, #{projectId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
#{lon,jdbcType=DOUBLE}, #{lat,jdbcType=DOUBLE}, #{buyDate,jdbcType=TIMESTAMP},
#{buyLong,jdbcType=REAL}, #{time,jdbcType=TIMESTAMP}, #{imsi,jdbcType=VARCHAR},
#{iccid,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{delivered,jdbcType=INTEGER},
#{platform,jdbcType=VARCHAR}, #{deviceid,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER},
#{period,jdbcType=INTEGER}, #{belong,jdbcType=INTEGER}, #{handleResult,jdbcType=VARCHAR},
#{registerInfoId,jdbcType=INTEGER}, #{updatetime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.topsail.influxdb.pojo.DeviceDetail">
insert into device_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="imei != null">
imei,
</if>
<if test="id != null">
id,
</if>
<if test="deviceType != null">
device_type,
</if>
<if test="orderId != null">
order_id,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="name != null">
name,
</if>
<if test="lon != null">
lon,
</if>
<if test="lat != null">
lat,
</if>
<if test="buyDate != null">
buy_date,
</if>
<if test="buyLong != null">
buy_long,
</if>
<if test="time != null">
time,
</if>
<if test="imsi != null">
imsi,
</if>
<if test="iccid != null">
iccid,
</if>
<if test="address != null">
address,
</if>
<if test="delivered != null">
delivered,
</if>
<if test="platform != null">
platform,
</if>
<if test="deviceid != null">
deviceId,
</if>
<if test="companyId != null">
company_id,
</if>
<if test="period != null">
period,
</if>
<if test="belong != null">
belong,
</if>
<if test="handleResult != null">
handle_result,
</if>
<if test="registerInfoId != null">
register_info_id,
</if>
<if test="updatetime != null">
updatetime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="imei != null">
#{imei,jdbcType=VARCHAR},
</if>
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="deviceType != null">
#{deviceType,jdbcType=INTEGER},
</if>
<if test="orderId != null">
#{orderId,jdbcType=INTEGER},
</if>
<if test="projectId != null">
#{projectId,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="lon != null">
#{lon,jdbcType=DOUBLE},
</if>
<if test="lat != null">
#{lat,jdbcType=DOUBLE},
</if>
<if test="buyDate != null">
#{buyDate,jdbcType=TIMESTAMP},
</if>
<if test="buyLong != null">
#{buyLong,jdbcType=REAL},
</if>
<if test="time != null">
#{time,jdbcType=TIMESTAMP},
</if>
<if test="imsi != null">
#{imsi,jdbcType=VARCHAR},
</if>
<if test="iccid != null">
#{iccid,jdbcType=VARCHAR},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="delivered != null">
#{delivered,jdbcType=INTEGER},
</if>
<if test="platform != null">
#{platform,jdbcType=VARCHAR},
</if>
<if test="deviceid != null">
#{deviceid,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
</if>
<if test="period != null">
#{period,jdbcType=INTEGER},
</if>
<if test="belong != null">
#{belong,jdbcType=INTEGER},
</if>
<if test="handleResult != null">
#{handleResult,jdbcType=VARCHAR},
</if>
<if test="registerInfoId != null">
#{registerInfoId,jdbcType=INTEGER},
</if>
<if test="updatetime != null">
#{updatetime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.topsail.influxdb.pojo.DeviceDetailExample" resultType="java.lang.Long">
select count(*) from device_detail
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update device_detail
<set>
<if test="record.imei != null">
imei = #{record.imei,jdbcType=VARCHAR},
</if>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.deviceType != null">
device_type = #{record.deviceType,jdbcType=INTEGER},
</if>
<if test="record.orderId != null">
order_id = #{record.orderId,jdbcType=INTEGER},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=INTEGER},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.lon != null">
lon = #{record.lon,jdbcType=DOUBLE},
</if>
<if test="record.lat != null">
lat = #{record.lat,jdbcType=DOUBLE},
</if>
<if test="record.buyDate != null">
buy_date = #{record.buyDate,jdbcType=TIMESTAMP},
</if>
<if test="record.buyLong != null">
buy_long = #{record.buyLong,jdbcType=REAL},
</if>
<if test="record.time != null">
time = #{record.time,jdbcType=TIMESTAMP},
</if>
<if test="record.imsi != null">
imsi = #{record.imsi,jdbcType=VARCHAR},
</if>
<if test="record.iccid != null">
iccid = #{record.iccid,jdbcType=VARCHAR},
</if>
<if test="record.address != null">
address = #{record.address,jdbcType=VARCHAR},
</if>
<if test="record.delivered != null">
delivered = #{record.delivered,jdbcType=INTEGER},
</if>
<if test="record.platform != null">
platform = #{record.platform,jdbcType=VARCHAR},
</if>
<if test="record.deviceid != null">
deviceId = #{record.deviceid,jdbcType=VARCHAR},
</if>
<if test="record.companyId != null">
company_id = #{record.companyId,jdbcType=INTEGER},
</if>
<if test="record.period != null">
period = #{record.period,jdbcType=INTEGER},
</if>
<if test="record.belong != null">
belong = #{record.belong,jdbcType=INTEGER},
</if>
<if test="record.handleResult != null">
handle_result = #{record.handleResult,jdbcType=VARCHAR},
</if>
<if test="record.registerInfoId != null">
register_info_id = #{record.registerInfoId,jdbcType=INTEGER},
</if>
<if test="record.updatetime != null">
updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update device_detail
set imei = #{record.imei,jdbcType=VARCHAR},
id = #{record.id,jdbcType=INTEGER},
device_type = #{record.deviceType,jdbcType=INTEGER},
order_id = #{record.orderId,jdbcType=INTEGER},
project_id = #{record.projectId,jdbcType=INTEGER},
name = #{record.name,jdbcType=VARCHAR},
lon = #{record.lon,jdbcType=DOUBLE},
lat = #{record.lat,jdbcType=DOUBLE},
buy_date = #{record.buyDate,jdbcType=TIMESTAMP},
buy_long = #{record.buyLong,jdbcType=REAL},
time = #{record.time,jdbcType=TIMESTAMP},
imsi = #{record.imsi,jdbcType=VARCHAR},
iccid = #{record.iccid,jdbcType=VARCHAR},
address = #{record.address,jdbcType=VARCHAR},
delivered = #{record.delivered,jdbcType=INTEGER},
platform = #{record.platform,jdbcType=VARCHAR},
deviceId = #{record.deviceid,jdbcType=VARCHAR},
company_id = #{record.companyId,jdbcType=INTEGER},
period = #{record.period,jdbcType=INTEGER},
belong = #{record.belong,jdbcType=INTEGER},
handle_result = #{record.handleResult,jdbcType=VARCHAR},
register_info_id = #{record.registerInfoId,jdbcType=INTEGER},
updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.topsail.influxdb.pojo.DeviceDetail">
update device_detail
<set>
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="deviceType != null">
device_type = #{deviceType,jdbcType=INTEGER},
</if>
<if test="orderId != null">
order_id = #{orderId,jdbcType=INTEGER},
</if>
<if test="projectId != null">
project_id = #{projectId,jdbcType=INTEGER},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="lon != null">
lon = #{lon,jdbcType=DOUBLE},
</if>
<if test="lat != null">
lat = #{lat,jdbcType=DOUBLE},
</if>
<if test="buyDate != null">
buy_date = #{buyDate,jdbcType=TIMESTAMP},
</if>
<if test="buyLong != null">
buy_long = #{buyLong,jdbcType=REAL},
</if>
<if test="time != null">
time = #{time,jdbcType=TIMESTAMP},
</if>
<if test="imsi != null">
imsi = #{imsi,jdbcType=VARCHAR},
</if>
<if test="iccid != null">
iccid = #{iccid,jdbcType=VARCHAR},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="delivered != null">
delivered = #{delivered,jdbcType=INTEGER},
</if>
<if test="platform != null">
platform = #{platform,jdbcType=VARCHAR},
</if>
<if test="deviceid != null">
deviceId = #{deviceid,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
</if>
<if test="period != null">
period = #{period,jdbcType=INTEGER},
</if>
<if test="belong != null">
belong = #{belong,jdbcType=INTEGER},
</if>
<if test="handleResult != null">
handle_result = #{handleResult,jdbcType=VARCHAR},
</if>
<if test="registerInfoId != null">
register_info_id = #{registerInfoId,jdbcType=INTEGER},
</if>
<if test="updatetime != null">
updatetime = #{updatetime,jdbcType=TIMESTAMP},
</if>
</set>
where imei = #{imei,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.topsail.influxdb.pojo.DeviceDetail">
update device_detail
set id = #{id,jdbcType=INTEGER},
device_type = #{deviceType,jdbcType=INTEGER},
order_id = #{orderId,jdbcType=INTEGER},
project_id = #{projectId,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
lon = #{lon,jdbcType=DOUBLE},
lat = #{lat,jdbcType=DOUBLE},
buy_date = #{buyDate,jdbcType=TIMESTAMP},
buy_long = #{buyLong,jdbcType=REAL},
time = #{time,jdbcType=TIMESTAMP},
imsi = #{imsi,jdbcType=VARCHAR},
iccid = #{iccid,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
delivered = #{delivered,jdbcType=INTEGER},
platform = #{platform,jdbcType=VARCHAR},
deviceId = #{deviceid,jdbcType=VARCHAR},
company_id = #{companyId,jdbcType=INTEGER},
period = #{period,jdbcType=INTEGER},
belong = #{belong,jdbcType=INTEGER},
handle_result = #{handleResult,jdbcType=VARCHAR},
register_info_id = #{registerInfoId,jdbcType=INTEGER},
updatetime = now()
where imei = #{imei,jdbcType=VARCHAR}
</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_detail
(imei, id, device_type, order_id, project_id, name, lon, lat, buy_date, buy_long,
time, imsi, iccid, address, delivered, platform, deviceId, company_id, period,
belong, handle_result, register_info_id, updatetime)
values
<foreach collection="list" item="item" separator=",">
(#{item.imei,jdbcType=VARCHAR}, #{item.id,jdbcType=INTEGER}, #{item.deviceType,jdbcType=INTEGER},
#{item.orderId,jdbcType=INTEGER}, #{item.projectId,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR},
#{item.lon,jdbcType=DOUBLE}, #{item.lat,jdbcType=DOUBLE}, #{item.buyDate,jdbcType=TIMESTAMP},
#{item.buyLong,jdbcType=REAL}, #{item.time,jdbcType=TIMESTAMP}, #{item.imsi,jdbcType=VARCHAR},
#{item.iccid,jdbcType=VARCHAR}, #{item.address,jdbcType=VARCHAR}, #{item.delivered,jdbcType=INTEGER},
#{item.platform,jdbcType=VARCHAR}, #{item.deviceid,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER},
#{item.period,jdbcType=INTEGER}, #{item.belong,jdbcType=INTEGER}, #{item.handleResult,jdbcType=VARCHAR},
#{item.registerInfoId,jdbcType=INTEGER}, #{item.updatetime,jdbcType=TIMESTAMP})
</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_detail (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'imei'.toString() == column.value">
#{item.imei,jdbcType=VARCHAR}
</if>
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=INTEGER}
</if>
<if test="'device_type'.toString() == column.value">
#{item.deviceType,jdbcType=INTEGER}
</if>
<if test="'order_id'.toString() == column.value">
#{item.orderId,jdbcType=INTEGER}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=INTEGER}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'lon'.toString() == column.value">
#{item.lon,jdbcType=DOUBLE}
</if>
<if test="'lat'.toString() == column.value">
#{item.lat,jdbcType=DOUBLE}
</if>
<if test="'buy_date'.toString() == column.value">
#{item.buyDate,jdbcType=TIMESTAMP}
</if>
<if test="'buy_long'.toString() == column.value">
#{item.buyLong,jdbcType=REAL}
</if>
<if test="'time'.toString() == column.value">
#{item.time,jdbcType=TIMESTAMP}
</if>
<if test="'imsi'.toString() == column.value">
#{item.imsi,jdbcType=VARCHAR}
</if>
<if test="'iccid'.toString() == column.value">
#{item.iccid,jdbcType=VARCHAR}
</if>
<if test="'address'.toString() == column.value">
#{item.address,jdbcType=VARCHAR}
</if>
<if test="'delivered'.toString() == column.value">
#{item.delivered,jdbcType=INTEGER}
</if>
<if test="'platform'.toString() == column.value">
#{item.platform,jdbcType=VARCHAR}
</if>
<if test="'deviceId'.toString() == column.value">
#{item.deviceid,jdbcType=VARCHAR}
</if>
<if test="'company_id'.toString() == column.value">
#{item.companyId,jdbcType=INTEGER}
</if>
<if test="'period'.toString() == column.value">
#{item.period,jdbcType=INTEGER}
</if>
<if test="'belong'.toString() == column.value">
#{item.belong,jdbcType=INTEGER}
</if>
<if test="'handle_result'.toString() == column.value">
#{item.handleResult,jdbcType=VARCHAR}
</if>
<if test="'register_info_id'.toString() == column.value">
#{item.registerInfoId,jdbcType=INTEGER}
</if>
<if test="'updatetime'.toString() == column.value">
#{item.updatetime,jdbcType=TIMESTAMP}
</if>
</foreach>
)
</foreach>
</insert>
<update id="updateDeviceDetailByImei">
update device_detail
<set>
<if test="deviceDetail.lon != null">
lon = #{deviceDetail.lon,jdbcType=DOUBLE},
</if>
<if test="deviceDetail.lat != null">
lat = #{deviceDetail.lat,jdbcType=DOUBLE},
</if>
<if test="deviceDetail.imei != null">
imei = #{deviceDetail.imei,jdbcType=VARCHAR},
</if>
updatetime=now()
</set>
where imei = #{deviceDetail.imei,jdbcType=VARCHAR}
</update>
</mapper>