<?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.OnlineRateMapper">
|
|
<resultMap id="BaseResultMap" type="com.topsail.influxdb.pojo.OnlineRate">
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
<result column="online" jdbcType="INTEGER" property="online" />
|
|
<result column="count" jdbcType="INTEGER" property="count" />
|
|
<result column="per" jdbcType="DOUBLE" property="per" />
|
|
<result column="platformType" jdbcType="VARCHAR" property="platformtype" />
|
|
<result column="time" jdbcType="TIMESTAMP" property="time" />
|
|
<result column="userName" jdbcType="VARCHAR" property="username" />
|
|
<result column="project_id" jdbcType="INTEGER" property="projectId" />
|
|
<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, online, count, per, platformType, time, userName, project_id, company_id
|
|
</sql>
|
|
<select id="selectByExample" parameterType="com.topsail.influxdb.pojo.OnlineRateExample" resultMap="BaseResultMap">
|
|
select
|
|
<if test="distinct">
|
|
distinct
|
|
</if>
|
|
<include refid="Base_Column_List" />
|
|
from online_rate
|
|
<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.Integer" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from online_rate
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
delete from online_rate
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</delete>
|
|
<delete id="deleteByExample" parameterType="com.topsail.influxdb.pojo.OnlineRateExample">
|
|
delete from online_rate
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</delete>
|
|
<insert id="insert" parameterType="com.topsail.influxdb.pojo.OnlineRate">
|
|
insert into online_rate (id, online, count,
|
|
per, platformType, time,
|
|
userName, project_id, company_id
|
|
)
|
|
values (#{id,jdbcType=INTEGER}, #{online,jdbcType=INTEGER}, #{count,jdbcType=INTEGER},
|
|
#{per,jdbcType=DOUBLE}, #{platformtype,jdbcType=VARCHAR}, #{time,jdbcType=TIMESTAMP},
|
|
#{username,jdbcType=VARCHAR}, #{projectId,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}
|
|
)
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="com.topsail.influxdb.pojo.OnlineRate">
|
|
insert into online_rate
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
id,
|
|
</if>
|
|
<if test="online != null">
|
|
online,
|
|
</if>
|
|
<if test="count != null">
|
|
count,
|
|
</if>
|
|
<if test="per != null">
|
|
per,
|
|
</if>
|
|
<if test="platformtype != null">
|
|
platformType,
|
|
</if>
|
|
<if test="time != null">
|
|
time,
|
|
</if>
|
|
<if test="username != null">
|
|
userName,
|
|
</if>
|
|
<if test="projectId != null">
|
|
project_id,
|
|
</if>
|
|
<if test="companyId != null">
|
|
company_id,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
#{id,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="online != null">
|
|
#{online,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="count != null">
|
|
#{count,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="per != null">
|
|
#{per,jdbcType=DOUBLE},
|
|
</if>
|
|
<if test="platformtype != null">
|
|
#{platformtype,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="time != null">
|
|
#{time,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="username != null">
|
|
#{username,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="projectId != null">
|
|
#{projectId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="companyId != null">
|
|
#{companyId,jdbcType=INTEGER},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<select id="countByExample" parameterType="com.topsail.influxdb.pojo.OnlineRateExample" resultType="java.lang.Long">
|
|
select count(*) from online_rate
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</select>
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
update online_rate
|
|
<set>
|
|
<if test="record.id != null">
|
|
id = #{record.id,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="record.online != null">
|
|
online = #{record.online,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="record.count != null">
|
|
count = #{record.count,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="record.per != null">
|
|
per = #{record.per,jdbcType=DOUBLE},
|
|
</if>
|
|
<if test="record.platformtype != null">
|
|
platformType = #{record.platformtype,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.time != null">
|
|
time = #{record.time,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="record.username != null">
|
|
userName = #{record.username,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.projectId != null">
|
|
project_id = #{record.projectId,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 online_rate
|
|
set id = #{record.id,jdbcType=INTEGER},
|
|
online = #{record.online,jdbcType=INTEGER},
|
|
count = #{record.count,jdbcType=INTEGER},
|
|
per = #{record.per,jdbcType=DOUBLE},
|
|
platformType = #{record.platformtype,jdbcType=VARCHAR},
|
|
time = #{record.time,jdbcType=TIMESTAMP},
|
|
userName = #{record.username,jdbcType=VARCHAR},
|
|
project_id = #{record.projectId,jdbcType=INTEGER},
|
|
company_id = #{record.companyId,jdbcType=INTEGER}
|
|
<if test="_parameter != null">
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
</if>
|
|
</update>
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.topsail.influxdb.pojo.OnlineRate">
|
|
update online_rate
|
|
<set>
|
|
<if test="online != null">
|
|
online = #{online,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="count != null">
|
|
count = #{count,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="per != null">
|
|
per = #{per,jdbcType=DOUBLE},
|
|
</if>
|
|
<if test="platformtype != null">
|
|
platformType = #{platformtype,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="time != null">
|
|
time = #{time,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="username != null">
|
|
userName = #{username,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="projectId != null">
|
|
project_id = #{projectId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="companyId != null">
|
|
company_id = #{companyId,jdbcType=INTEGER},
|
|
</if>
|
|
</set>
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
<update id="updateByPrimaryKey" parameterType="com.topsail.influxdb.pojo.OnlineRate">
|
|
update online_rate
|
|
set online = #{online,jdbcType=INTEGER},
|
|
count = #{count,jdbcType=INTEGER},
|
|
per = #{per,jdbcType=DOUBLE},
|
|
platformType = #{platformtype,jdbcType=VARCHAR},
|
|
time = #{time,jdbcType=TIMESTAMP},
|
|
userName = #{username,jdbcType=VARCHAR},
|
|
project_id = #{projectId,jdbcType=INTEGER},
|
|
company_id = #{companyId,jdbcType=INTEGER}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</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 online_rate
|
|
(id, online, count, per, platformType, time, userName, project_id, company_id)
|
|
values
|
|
<foreach collection="list" item="item" separator=",">
|
|
(#{item.id,jdbcType=INTEGER}, #{item.online,jdbcType=INTEGER}, #{item.count,jdbcType=INTEGER},
|
|
#{item.per,jdbcType=DOUBLE}, #{item.platformtype,jdbcType=VARCHAR}, #{item.time,jdbcType=TIMESTAMP},
|
|
#{item.username,jdbcType=VARCHAR}, #{item.projectId,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 online_rate (
|
|
<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="'online'.toString() == column.value">
|
|
#{item.online,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="'count'.toString() == column.value">
|
|
#{item.count,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="'per'.toString() == column.value">
|
|
#{item.per,jdbcType=DOUBLE}
|
|
</if>
|
|
<if test="'platformType'.toString() == column.value">
|
|
#{item.platformtype,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="'time'.toString() == column.value">
|
|
#{item.time,jdbcType=TIMESTAMP}
|
|
</if>
|
|
<if test="'userName'.toString() == column.value">
|
|
#{item.username,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="'project_id'.toString() == column.value">
|
|
#{item.projectId,jdbcType=INTEGER}
|
|
</if>
|
|
<if test="'company_id'.toString() == column.value">
|
|
#{item.companyId,jdbcType=INTEGER}
|
|
</if>
|
|
</foreach>
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
</mapper>
|