新增业务流量入库方法。
增加自动创建业务流量分表方法
This commit is contained in:
+177
@@ -0,0 +1,177 @@
|
||||
<?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.tongran.rocketmq.mapper.InitialNetBusinessTrafficMapper">
|
||||
|
||||
<resultMap type="InitialNetBusinessTraffic" id="InitialNetBusinessTrafficResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="mac" column="mac" />
|
||||
<result property="name" column="name" />
|
||||
<result property="pid" column="pid" />
|
||||
<result property="processName" column="process_name" />
|
||||
<result property="inSpeed" column="in_speed" />
|
||||
<result property="outSpeed" column="out_speed" />
|
||||
<result property="connectionCount" column="connection_count" />
|
||||
<result property="ipv4InSpeed" column="ipv4_in_speed" />
|
||||
<result property="ipv4OutSpeed" column="ipv4_out_speed" />
|
||||
<result property="ipv6InSpeed" column="ipv6_in_speed" />
|
||||
<result property="ipv6OutSpeed" column="ipv6_out_speed" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInitialNetBusinessTrafficVo">
|
||||
select id, client_id, mac, name, pid, process_name, in_speed, out_speed, connection_count, ipv4_in_speed, ipv4_out_speed, ipv6_in_speed, ipv6_out_speed, create_by, create_time, update_by, update_time, remark from initial_net_business_traffic
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialNetBusinessTrafficList" parameterType="InitialNetBusinessTraffic" resultMap="InitialNetBusinessTrafficResult">
|
||||
<include refid="selectInitialNetBusinessTrafficVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="mac != null and mac != ''"> and mac = #{mac}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="pid != null "> and pid = #{pid}</if>
|
||||
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
|
||||
<if test="inSpeed != null and inSpeed != ''"> and in_speed = #{inSpeed}</if>
|
||||
<if test="outSpeed != null and outSpeed != ''"> and out_speed = #{outSpeed}</if>
|
||||
<if test="connectionCount != null "> and connection_count = #{connectionCount}</if>
|
||||
<if test="ipv4InSpeed != null and ipv4InSpeed != ''"> and ipv4_in_speed = #{ipv4InSpeed}</if>
|
||||
<if test="ipv4OutSpeed != null and ipv4OutSpeed != ''"> and ipv4_out_speed = #{ipv4OutSpeed}</if>
|
||||
<if test="ipv6InSpeed != null and ipv6InSpeed != ''"> and ipv6_in_speed = #{ipv6InSpeed}</if>
|
||||
<if test="ipv6OutSpeed != null and ipv6OutSpeed != ''"> and ipv6_out_speed = #{ipv6OutSpeed}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInitialNetBusinessTrafficById" parameterType="Long" resultMap="InitialNetBusinessTrafficResult">
|
||||
<include refid="selectInitialNetBusinessTrafficVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialNetBusinessTraffic" parameterType="InitialNetBusinessTraffic" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into initial_net_business_traffic
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null">client_id,</if>
|
||||
<if test="mac != null">mac,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="pid != null">pid,</if>
|
||||
<if test="processName != null">process_name,</if>
|
||||
<if test="inSpeed != null">in_speed,</if>
|
||||
<if test="outSpeed != null">out_speed,</if>
|
||||
<if test="connectionCount != null">connection_count,</if>
|
||||
<if test="ipv4InSpeed != null">ipv4_in_speed,</if>
|
||||
<if test="ipv4OutSpeed != null">ipv4_out_speed,</if>
|
||||
<if test="ipv6InSpeed != null">ipv6_in_speed,</if>
|
||||
<if test="ipv6OutSpeed != null">ipv6_out_speed,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null">#{clientId},</if>
|
||||
<if test="mac != null">#{mac},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="pid != null">#{pid},</if>
|
||||
<if test="processName != null">#{processName},</if>
|
||||
<if test="inSpeed != null">#{inSpeed},</if>
|
||||
<if test="outSpeed != null">#{outSpeed},</if>
|
||||
<if test="connectionCount != null">#{connectionCount},</if>
|
||||
<if test="ipv4InSpeed != null">#{ipv4InSpeed},</if>
|
||||
<if test="ipv4OutSpeed != null">#{ipv4OutSpeed},</if>
|
||||
<if test="ipv6InSpeed != null">#{ipv6InSpeed},</if>
|
||||
<if test="ipv6OutSpeed != null">#{ipv6OutSpeed},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInitialNetBusinessTraffic" parameterType="InitialNetBusinessTraffic">
|
||||
update initial_net_business_traffic
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null">client_id = #{clientId},</if>
|
||||
<if test="mac != null">mac = #{mac},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="pid != null">pid = #{pid},</if>
|
||||
<if test="processName != null">process_name = #{processName},</if>
|
||||
<if test="inSpeed != null">in_speed = #{inSpeed},</if>
|
||||
<if test="outSpeed != null">out_speed = #{outSpeed},</if>
|
||||
<if test="connectionCount != null">connection_count = #{connectionCount},</if>
|
||||
<if test="ipv4InSpeed != null">ipv4_in_speed = #{ipv4InSpeed},</if>
|
||||
<if test="ipv4OutSpeed != null">ipv4_out_speed = #{ipv4OutSpeed},</if>
|
||||
<if test="ipv6InSpeed != null">ipv6_in_speed = #{ipv6InSpeed},</if>
|
||||
<if test="ipv6OutSpeed != null">ipv6_out_speed = #{ipv6OutSpeed},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInitialNetBusinessTrafficById" parameterType="Long">
|
||||
delete from initial_net_business_traffic where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialNetBusinessTrafficByIds" parameterType="String">
|
||||
delete from initial_net_business_traffic where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<insert id="batchInsertBusinessTraffic" parameterType="list">
|
||||
insert into initial_net_business_traffic
|
||||
(client_id, mac, name, pid, process_name, in_speed, out_speed,
|
||||
connection_count, ipv4_in_speed, ipv4_out_speed, ipv6_in_speed,
|
||||
ipv6_out_speed, create_by, create_time, update_by, update_time, remark)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.clientId}, #{item.mac}, #{item.name}, #{item.pid},
|
||||
#{item.processName}, #{item.inSpeed}, #{item.outSpeed},
|
||||
#{item.connectionCount}, #{item.ipv4InSpeed}, #{item.ipv4OutSpeed},
|
||||
#{item.ipv6InSpeed}, #{item.ipv6OutSpeed}, #{item.createBy},
|
||||
#{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsertBusinessRecoverTraffic" parameterType="list">
|
||||
insert into initial_net_business_traffic
|
||||
(client_id, mac, name, pid, process_name, in_speed, out_speed,
|
||||
connection_count, ipv4_in_speed, ipv4_out_speed, ipv6_in_speed,
|
||||
ipv6_out_speed, create_by, create_time, update_by, update_time, remark)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.clientId}, #{item.mac}, #{item.name}, #{item.pid},
|
||||
#{item.processName}, #{item.inSpeed}, #{item.outSpeed},
|
||||
#{item.connectionCount}, #{item.ipv4InSpeed}, #{item.ipv4OutSpeed},
|
||||
#{item.ipv6InSpeed}, #{item.ipv6OutSpeed}, #{item.createBy},
|
||||
#{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
|
||||
</foreach>
|
||||
</insert>
|
||||
<select id="getNetBusinessTrafficList" parameterType="InitialNetBusinessTraffic" resultMap="InitialNetBusinessTrafficResult">
|
||||
select id, client_id, mac, name, pid, process_name, in_speed, out_speed, connection_count, ipv4_in_speed, ipv4_out_speed, ipv6_in_speed, ipv6_out_speed, create_by, create_time, update_by, update_time, remark
|
||||
from ${tableName}
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="mac != null and mac != ''"> and mac = #{mac}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="pid != null "> and pid = #{pid}</if>
|
||||
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
|
||||
<if test="inSpeed != null and inSpeed != ''"> and in_speed = #{inSpeed}</if>
|
||||
<if test="outSpeed != null and outSpeed != ''"> and out_speed = #{outSpeed}</if>
|
||||
<if test="connectionCount != null "> and connection_count = #{connectionCount}</if>
|
||||
<if test="ipv4InSpeed != null and ipv4InSpeed != ''"> and ipv4_in_speed = #{ipv4InSpeed}</if>
|
||||
<if test="ipv4OutSpeed != null and ipv4OutSpeed != ''"> and ipv4_out_speed = #{ipv4OutSpeed}</if>
|
||||
<if test="ipv6InSpeed != null and ipv6InSpeed != ''"> and ipv6_in_speed = #{ipv6InSpeed}</if>
|
||||
<if test="ipv6OutSpeed != null and ipv6OutSpeed != ''"> and ipv6_out_speed = #{ipv6OutSpeed}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
<?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.tongran.rocketmq.mapper.InitialNetBusinessTrafficTempMapper">
|
||||
|
||||
<resultMap type="InitialNetBusinessTrafficTemp" id="InitialNetBusinessTrafficTempResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="mac" column="mac" />
|
||||
<result property="name" column="name" />
|
||||
<result property="pid" column="pid" />
|
||||
<result property="processName" column="process_name" />
|
||||
<result property="inSpeed" column="in_speed" />
|
||||
<result property="outSpeed" column="out_speed" />
|
||||
<result property="connectionCount" column="connection_count" />
|
||||
<result property="ipv4InSpeed" column="ipv4_in_speed" />
|
||||
<result property="ipv4OutSpeed" column="ipv4_out_speed" />
|
||||
<result property="ipv6InSpeed" column="ipv6_in_speed" />
|
||||
<result property="ipv6OutSpeed" column="ipv6_out_speed" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInitialNetBusinessTrafficTempVo">
|
||||
select id, client_id, mac, name, pid, process_name, in_speed, out_speed, connection_count, ipv4_in_speed, ipv4_out_speed, ipv6_in_speed, ipv6_out_speed, create_by, create_time, update_by, update_time, remark from initial_net_business_traffic_temp
|
||||
</sql>
|
||||
|
||||
<select id="selectInitialNetBusinessTrafficTempList" parameterType="InitialNetBusinessTrafficTemp" resultMap="InitialNetBusinessTrafficTempResult">
|
||||
<include refid="selectInitialNetBusinessTrafficTempVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="mac != null and mac != ''"> and mac = #{mac}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="pid != null "> and pid = #{pid}</if>
|
||||
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
|
||||
<if test="inSpeed != null and inSpeed != ''"> and in_speed = #{inSpeed}</if>
|
||||
<if test="outSpeed != null and outSpeed != ''"> and out_speed = #{outSpeed}</if>
|
||||
<if test="connectionCount != null "> and connection_count = #{connectionCount}</if>
|
||||
<if test="ipv4InSpeed != null and ipv4InSpeed != ''"> and ipv4_in_speed = #{ipv4InSpeed}</if>
|
||||
<if test="ipv4OutSpeed != null and ipv4OutSpeed != ''"> and ipv4_out_speed = #{ipv4OutSpeed}</if>
|
||||
<if test="ipv6InSpeed != null and ipv6InSpeed != ''"> and ipv6_in_speed = #{ipv6InSpeed}</if>
|
||||
<if test="ipv6OutSpeed != null and ipv6OutSpeed != ''"> and ipv6_out_speed = #{ipv6OutSpeed}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectInitialNetBusinessTrafficTempById" parameterType="Long" resultMap="InitialNetBusinessTrafficTempResult">
|
||||
<include refid="selectInitialNetBusinessTrafficTempVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInitialNetBusinessTrafficTemp" parameterType="InitialNetBusinessTrafficTemp" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into initial_net_business_traffic_temp
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null">client_id,</if>
|
||||
<if test="mac != null">mac,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="pid != null">pid,</if>
|
||||
<if test="processName != null">process_name,</if>
|
||||
<if test="inSpeed != null">in_speed,</if>
|
||||
<if test="outSpeed != null">out_speed,</if>
|
||||
<if test="connectionCount != null">connection_count,</if>
|
||||
<if test="ipv4InSpeed != null">ipv4_in_speed,</if>
|
||||
<if test="ipv4OutSpeed != null">ipv4_out_speed,</if>
|
||||
<if test="ipv6InSpeed != null">ipv6_in_speed,</if>
|
||||
<if test="ipv6OutSpeed != null">ipv6_out_speed,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null">#{clientId},</if>
|
||||
<if test="mac != null">#{mac},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="pid != null">#{pid},</if>
|
||||
<if test="processName != null">#{processName},</if>
|
||||
<if test="inSpeed != null">#{inSpeed},</if>
|
||||
<if test="outSpeed != null">#{outSpeed},</if>
|
||||
<if test="connectionCount != null">#{connectionCount},</if>
|
||||
<if test="ipv4InSpeed != null">#{ipv4InSpeed},</if>
|
||||
<if test="ipv4OutSpeed != null">#{ipv4OutSpeed},</if>
|
||||
<if test="ipv6InSpeed != null">#{ipv6InSpeed},</if>
|
||||
<if test="ipv6OutSpeed != null">#{ipv6OutSpeed},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInitialNetBusinessTrafficTemp" parameterType="InitialNetBusinessTrafficTemp">
|
||||
update initial_net_business_traffic_temp
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="clientId != null">client_id = #{clientId},</if>
|
||||
<if test="mac != null">mac = #{mac},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="pid != null">pid = #{pid},</if>
|
||||
<if test="processName != null">process_name = #{processName},</if>
|
||||
<if test="inSpeed != null">in_speed = #{inSpeed},</if>
|
||||
<if test="outSpeed != null">out_speed = #{outSpeed},</if>
|
||||
<if test="connectionCount != null">connection_count = #{connectionCount},</if>
|
||||
<if test="ipv4InSpeed != null">ipv4_in_speed = #{ipv4InSpeed},</if>
|
||||
<if test="ipv4OutSpeed != null">ipv4_out_speed = #{ipv4OutSpeed},</if>
|
||||
<if test="ipv6InSpeed != null">ipv6_in_speed = #{ipv6InSpeed},</if>
|
||||
<if test="ipv6OutSpeed != null">ipv6_out_speed = #{ipv6OutSpeed},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInitialNetBusinessTrafficTempById" parameterType="Long">
|
||||
delete from initial_net_business_traffic_temp where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInitialNetBusinessTrafficTempByIds" parameterType="String">
|
||||
delete from initial_net_business_traffic_temp where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteBusinessTempMsgByClientId" parameterType="String">
|
||||
delete from initial_net_business_traffic_temp where client_id = #{clientId}
|
||||
</delete>
|
||||
<delete id="deleteBusinessTempMsgByClientIdAndTime" parameterType="InitialNetBusinessTrafficTemp">
|
||||
delete from initial_bandwidth_traffic_recover_temp where client_id = #{clientId} and create_time=#{createTime}
|
||||
</delete>
|
||||
<insert id="batchInsertBusinessTemp" parameterType="list">
|
||||
insert into initial_net_business_traffic_temp
|
||||
(client_id, mac, name, pid, process_name, in_speed, out_speed,
|
||||
connection_count, ipv4_in_speed, ipv4_out_speed, ipv6_in_speed,
|
||||
ipv6_out_speed, create_by, create_time, update_by, update_time, remark)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.clientId}, #{item.mac}, #{item.name}, #{item.pid},
|
||||
#{item.processName}, #{item.inSpeed}, #{item.outSpeed},
|
||||
#{item.connectionCount}, #{item.ipv4InSpeed}, #{item.ipv4OutSpeed},
|
||||
#{item.ipv6InSpeed}, #{item.ipv6OutSpeed}, #{item.createBy},
|
||||
#{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsertBusinessRecoverTemp" parameterType="list">
|
||||
insert into initial_net_business_traffic_temp
|
||||
(client_id, mac, name, pid, process_name, in_speed, out_speed,
|
||||
connection_count, ipv4_in_speed, ipv4_out_speed, ipv6_in_speed,
|
||||
ipv6_out_speed, create_by, create_time, update_by, update_time, remark)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.clientId}, #{item.mac}, #{item.name}, #{item.pid},
|
||||
#{item.processName}, #{item.inSpeed}, #{item.outSpeed},
|
||||
#{item.connectionCount}, #{item.ipv4InSpeed}, #{item.ipv4OutSpeed},
|
||||
#{item.ipv6InSpeed}, #{item.ipv6OutSpeed}, #{item.createBy},
|
||||
#{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user