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.
 

240 lines
8.8 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.DeviceProjectViewMapper">
<resultMap id="BaseResultMap" type="com.topsail.influxdb.pojo.DeviceProjectView">
<result column="imei" jdbcType="VARCHAR" property="imei" />
<result column="deviceType" jdbcType="INTEGER" property="devicetype" />
<result column="userName" jdbcType="VARCHAR" property="username" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
<result column="project_id" jdbcType="INTEGER" property="projectId" />
<result column="imei2" jdbcType="VARCHAR" property="imei2" />
</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, deviceType, userName, company_id, project_id, imei2
</sql>
<select id="selectByExample" parameterType="com.topsail.influxdb.pojo.DeviceProjectViewExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from device_project_view
<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.DeviceProjectViewExample">
delete from device_project_view
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.topsail.influxdb.pojo.DeviceProjectView">
insert into device_project_view (imei, deviceType, userName,
company_id, project_id, imei2
)
values (#{imei,jdbcType=VARCHAR}, #{devicetype,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR},
#{companyId,jdbcType=INTEGER}, #{projectId,jdbcType=INTEGER}, #{imei2,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.topsail.influxdb.pojo.DeviceProjectView">
insert into device_project_view
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="imei != null">
imei,
</if>
<if test="devicetype != null">
deviceType,
</if>
<if test="username != null">
userName,
</if>
<if test="companyId != null">
company_id,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="imei2 != null">
imei2,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="imei != null">
#{imei,jdbcType=VARCHAR},
</if>
<if test="devicetype != null">
#{devicetype,jdbcType=INTEGER},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
</if>
<if test="projectId != null">
#{projectId,jdbcType=INTEGER},
</if>
<if test="imei2 != null">
#{imei2,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.topsail.influxdb.pojo.DeviceProjectViewExample" resultType="java.lang.Long">
select count(*) from device_project_view
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update device_project_view
<set>
<if test="record.imei != null">
imei = #{record.imei,jdbcType=VARCHAR},
</if>
<if test="record.devicetype != null">
deviceType = #{record.devicetype,jdbcType=INTEGER},
</if>
<if test="record.username != null">
userName = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.companyId != null">
company_id = #{record.companyId,jdbcType=INTEGER},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=INTEGER},
</if>
<if test="record.imei2 != null">
imei2 = #{record.imei2,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update device_project_view
set imei = #{record.imei,jdbcType=VARCHAR},
deviceType = #{record.devicetype,jdbcType=INTEGER},
userName = #{record.username,jdbcType=VARCHAR},
company_id = #{record.companyId,jdbcType=INTEGER},
project_id = #{record.projectId,jdbcType=INTEGER},
imei2 = #{record.imei2,jdbcType=VARCHAR}
<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_project_view
(imei, deviceType, userName, company_id, project_id, imei2)
values
<foreach collection="list" item="item" separator=",">
(#{item.imei,jdbcType=VARCHAR}, #{item.devicetype,jdbcType=INTEGER}, #{item.username,jdbcType=VARCHAR},
#{item.companyId,jdbcType=INTEGER}, #{item.projectId,jdbcType=INTEGER}, #{item.imei2,jdbcType=VARCHAR}
)
</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_project_view (
<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="'deviceType'.toString() == column.value">
#{item.devicetype,jdbcType=INTEGER}
</if>
<if test="'userName'.toString() == column.value">
#{item.username,jdbcType=VARCHAR}
</if>
<if test="'company_id'.toString() == column.value">
#{item.companyId,jdbcType=INTEGER}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=INTEGER}
</if>
<if test="'imei2'.toString() == column.value">
#{item.imei2,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>