出省流量统计增加立即执行、增加占比总计、不同运营商也统计.
磁盘统计HDD改为所有磁盘、速率单位改为 MB/s、流量图开始时间修正。 流量95值收益优化
This commit is contained in:
@@ -147,8 +147,8 @@
|
||||
a.update_time as updateTime,
|
||||
b.serial,
|
||||
TRUNCATE(IFNULL(b.total,0)/(1024 * 1024 * 1024), 0) as total,
|
||||
TRUNCATE(IFNULL(b.write_speed,0)/1024, 0) as writeSpeed,
|
||||
TRUNCATE(IFNULL(b.read_speed,0)/1024, 0) as readSpeed,
|
||||
TRUNCATE(IFNULL(b.write_speed,0)/(1024*1024), 0) as writeSpeed,
|
||||
TRUNCATE(IFNULL(b.read_speed,0)/(1024*1024), 0) as readSpeed,
|
||||
b.type,
|
||||
TRUNCATE(IFNULL(b.used_space,0)/(1024 * 1024 * 1024), 0) as usedSpace
|
||||
FROM all_disk_name a
|
||||
|
||||
@@ -219,10 +219,22 @@
|
||||
inner join (
|
||||
select client_id, type, max(create_time) as latest_time
|
||||
from ${tableName}
|
||||
where client_id = #{clientId} and type = #{type}
|
||||
group by client_id, type
|
||||
where client_id = #{clientId}
|
||||
group by client_id
|
||||
) t1 on t2.client_id = t1.client_id
|
||||
and t2.type = t1.type
|
||||
and t2.create_time = t1.latest_time
|
||||
</select>
|
||||
<select id="sumDistInfoByCondition" parameterType="InitialDiskInfo" resultMap="InitialDiskInfoResult">
|
||||
select sum(used_space) used_space,create_time
|
||||
from ${tableName}
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
<if test="name != null and name != ''"> and name = #{name}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="startTime != null and startTime != ''"> and create_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||
</where>
|
||||
group by create_time
|
||||
order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
+103
@@ -184,4 +184,107 @@
|
||||
<delete id="deleteByParentInterfaceName" parameterType="String">
|
||||
delete from rm_network_interface_child where client_id = #{clientId} and parent_interface =#{name}
|
||||
</delete>
|
||||
<select id="getNetworkInterfaceChildList" parameterType="RmNetworkInterfaceChild" resultType="RmNetworkInterfaceChild">
|
||||
SELECT
|
||||
a.id,
|
||||
a.client_id AS clientId,
|
||||
a.parent_interface AS parentInterface,
|
||||
a.isp,
|
||||
a.province,
|
||||
a.city,
|
||||
a.public_ip AS publicIp,
|
||||
a.interface_name AS interfaceName,
|
||||
a.mac_address AS macAddress,
|
||||
a.interface_type AS interfaceType,
|
||||
a.ipv4_address AS ipv4Address,
|
||||
a.ipv6_address AS ipv6Address,
|
||||
a.gateway,
|
||||
a.create_time AS createTime,
|
||||
a.update_time AS updateTime,
|
||||
a.create_by AS createBy,
|
||||
a.update_by AS updateBy,
|
||||
a.bind_ip AS bindIp,
|
||||
a.new_flag AS newFlag,
|
||||
a.status,
|
||||
a.bandwidth_result AS bandwidthResult,
|
||||
a.net_create_time AS netCreateTime,
|
||||
b.ping_dropped AS pingDropped
|
||||
FROM rm_network_interface_child a
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
t1.client_id,
|
||||
t1.create_time,
|
||||
CASE
|
||||
WHEN t1.name LIKE '%(%' THEN
|
||||
TRIM(SUBSTRING_INDEX(t1.name, '(', 1))
|
||||
ELSE t1.name
|
||||
END as name,
|
||||
t1.mac,
|
||||
t1.ping_dropped
|
||||
FROM
|
||||
${tableName} t1
|
||||
INNER JOIN (
|
||||
SELECT
|
||||
client_id,
|
||||
MAX(create_time) as latest_time
|
||||
FROM
|
||||
${tableName}
|
||||
WHERE
|
||||
client_id = #{clientId}
|
||||
GROUP BY
|
||||
client_id
|
||||
) t2 ON t1.client_id = t2.client_id AND t1.create_time = t2.latest_time
|
||||
) b ON a.client_id = b.client_id and a.interface_name = b.name and a.mac_address = b.mac
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''">
|
||||
and a.client_id = #{clientId}
|
||||
</if>
|
||||
<if test="parentInterface != null and parentInterface != ''">
|
||||
and a.parent_interface = #{parentInterface}
|
||||
and a.ipv4_address != '' and a.ipv4_address != 'N/A'
|
||||
</if>
|
||||
<if test="isp != null and isp != ''">
|
||||
and a.isp = #{isp}
|
||||
</if>
|
||||
<if test="province != null and province != ''">
|
||||
and a.province = #{province}
|
||||
</if>
|
||||
<if test="city != null and city != ''">
|
||||
and a.city = #{city}
|
||||
</if>
|
||||
<if test="publicIp != null and publicIp != ''">
|
||||
and a.public_ip = #{publicIp}
|
||||
</if>
|
||||
<if test="interfaceName != null and interfaceName != ''">
|
||||
and a.interface_name like concat('%', #{interfaceName}, '%')
|
||||
</if>
|
||||
<if test="macAddress != null and macAddress != ''">
|
||||
and a.mac_address = #{macAddress}
|
||||
</if>
|
||||
<if test="interfaceType != null and interfaceType != ''">
|
||||
and a.interface_type = #{interfaceType}
|
||||
</if>
|
||||
<if test="ipv4Address != null and ipv4Address != ''">
|
||||
and a.ipv4_address = #{ipv4Address}
|
||||
</if>
|
||||
<if test="ipv6Address != null and ipv6Address != ''">
|
||||
and a.ipv6_address = #{ipv6Address}
|
||||
</if>
|
||||
<if test="gateway != null and gateway != ''">
|
||||
and a.gateway = #{gateway}
|
||||
</if>
|
||||
<if test="bindIp != null and bindIp != ''">
|
||||
and a.bind_ip = #{bindIp}
|
||||
</if>
|
||||
<if test="newFlag != null">
|
||||
and a.new_flag = #{newFlag}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and a.status = #{status}
|
||||
</if>
|
||||
<if test="ipv4Flag != null and ipv4Flag">
|
||||
and a.ipv4_address != '' and a.ipv4_address != 'N/A'
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user