优化95值计算相关数据查看
This commit is contained in:
+2
@@ -129,5 +129,7 @@ public class EpsNodeBandwidth extends BaseEntity
|
|||||||
private Long monitorId;
|
private Long monitorId;
|
||||||
/** 服务器id \n 分割 */
|
/** 服务器id \n 分割 */
|
||||||
private String clientIds;
|
private String clientIds;
|
||||||
|
/** mac 地址 */
|
||||||
|
private String macAddress;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-1
@@ -1,8 +1,9 @@
|
|||||||
package com.tongran.system.mapper;
|
package com.tongran.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.tongran.system.domain.EpsMethodChangeRecord;
|
import com.tongran.system.domain.EpsMethodChangeRecord;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收益方式修改记录Mapper接口
|
* 收益方式修改记录Mapper接口
|
||||||
*
|
*
|
||||||
@@ -58,4 +59,12 @@ public interface EpsMethodChangeRecordMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteEpsMethodChangeRecordByIds(Long[] ids);
|
public int deleteEpsMethodChangeRecordByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询收益方式修改记录列表
|
||||||
|
*
|
||||||
|
* @param epsMethodChangeRecord 收益方式修改记录
|
||||||
|
* @return 收益方式修改记录
|
||||||
|
*/
|
||||||
|
public EpsMethodChangeRecord getNetNameByRecord(EpsMethodChangeRecord epsMethodChangeRecord);
|
||||||
}
|
}
|
||||||
|
|||||||
+21
@@ -844,6 +844,26 @@ public class EpsInitialTrafficDataServiceImpl implements EpsInitialTrafficDataSe
|
|||||||
private void calculateNormalDeviceBandwidth(EpsInitialTrafficData queryParam,
|
private void calculateNormalDeviceBandwidth(EpsInitialTrafficData queryParam,
|
||||||
String dailyStartTime,
|
String dailyStartTime,
|
||||||
String dailyEndTime, String calculationMode) {
|
String dailyEndTime, String calculationMode) {
|
||||||
|
|
||||||
|
// 获取业务变更记录
|
||||||
|
EpsMethodChangeRecord changeQuery = new EpsMethodChangeRecord();
|
||||||
|
changeQuery.setClientId(queryParam.getClientId());
|
||||||
|
changeQuery.setEndTime(dailyEndTime);
|
||||||
|
EpsMethodChangeRecord record = epsMethodChangeRecordMapper
|
||||||
|
.getNetNameByRecord(changeQuery);
|
||||||
|
if(record != null){
|
||||||
|
String name = record.getTrafficPort();
|
||||||
|
// 查询mac
|
||||||
|
AllInterfaceName allInterfaceName = new AllInterfaceName();
|
||||||
|
allInterfaceName.setClientId(queryParam.getClientId());
|
||||||
|
allInterfaceName.setInterfaceName(name);
|
||||||
|
allInterfaceName.setResourceType("1");
|
||||||
|
List<AllInterfaceName> allInterfaceNameList = allInterfaceNameMapper.selectByNames(allInterfaceName);
|
||||||
|
if(allInterfaceNameList != null && !allInterfaceNameList.isEmpty()){
|
||||||
|
AllInterfaceName interfaceName = allInterfaceNameList.get(0);
|
||||||
|
queryParam.setMac(interfaceName.getServerIp());
|
||||||
|
}
|
||||||
|
}
|
||||||
queryParam.setStartTime(dailyStartTime);
|
queryParam.setStartTime(dailyStartTime);
|
||||||
queryParam.setEndTime(dailyEndTime);
|
queryParam.setEndTime(dailyEndTime);
|
||||||
List<EpsInitialTrafficData> dataList = query(queryParam);
|
List<EpsInitialTrafficData> dataList = query(queryParam);
|
||||||
@@ -967,6 +987,7 @@ public class EpsInitialTrafficDataServiceImpl implements EpsInitialTrafficDataSe
|
|||||||
// 查询此条数据是否存在
|
// 查询此条数据是否存在
|
||||||
List<EpsNodeBandwidth> exitsList = epsNodeBandwidthMapper.selectEpsNodeBandwidthList(bandwidth);
|
List<EpsNodeBandwidth> exitsList = epsNodeBandwidthMapper.selectEpsNodeBandwidthList(bandwidth);
|
||||||
bandwidth.setBandwidthResult(result);
|
bandwidth.setBandwidthResult(result);
|
||||||
|
bandwidth.setMacAddress(data.getMac());
|
||||||
switch (data.getBandwidthType()){
|
switch (data.getBandwidthType()){
|
||||||
case "1":
|
case "1":
|
||||||
bandwidth.setBandwidth95Daily(result);
|
bandwidth.setBandwidth95Daily(result);
|
||||||
|
|||||||
+1
@@ -72,6 +72,7 @@ public class EpsNodeBandwidthServiceImpl implements IEpsNodeBandwidthService
|
|||||||
queryParams.setClientId(epsNodeBandwidth.getClientId());
|
queryParams.setClientId(epsNodeBandwidth.getClientId());
|
||||||
queryParams.setServiceSn(epsNodeBandwidth.getHardwareSn());
|
queryParams.setServiceSn(epsNodeBandwidth.getHardwareSn());
|
||||||
queryParams.setBusinessId(epsNodeBandwidth.getBusinessId());
|
queryParams.setBusinessId(epsNodeBandwidth.getBusinessId());
|
||||||
|
queryParams.setMac(epsNodeBandwidth.getMacAddress());
|
||||||
queryParams.setStartTime(dailyStartTime);
|
queryParams.setStartTime(dailyStartTime);
|
||||||
queryParams.setEndTime(dailyEndTime);
|
queryParams.setEndTime(dailyEndTime);
|
||||||
// 获取总数
|
// 获取总数
|
||||||
|
|||||||
+5
-2
@@ -383,7 +383,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
SELECT
|
SELECT
|
||||||
a.id,
|
a.id,
|
||||||
GROUP_CONCAT(DISTINCT a.`name` SEPARATOR ',') AS name,
|
GROUP_CONCAT(DISTINCT a.`name` SEPARATOR ',') AS name,
|
||||||
a.`mac` AS mac,
|
GROUP_CONCAT(DISTINCT a.`mac` SEPARATOR ',') AS mac,
|
||||||
a.`status` AS status,
|
a.`status` AS status,
|
||||||
a.`type` AS type,
|
a.`type` AS type,
|
||||||
a.`ipV4` AS ipV4,
|
a.`ipV4` AS ipV4,
|
||||||
@@ -453,7 +453,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
and a.revenue_method = #{revenueMethod}
|
and a.revenue_method = #{revenueMethod}
|
||||||
</if>
|
</if>
|
||||||
<if test="mac != null and mac != ''">
|
<if test="mac != null and mac != ''">
|
||||||
and a.mac = #{mac}
|
and a.mac in
|
||||||
|
<foreach collection="mac.split(',')" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
GROUP BY a.create_time DESC
|
GROUP BY a.create_time DESC
|
||||||
|
|||||||
+10
@@ -115,4 +115,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="getNetNameByRecord" parameterType="EpsMethodChangeRecord" resultMap="EpsMethodChangeRecordResult">
|
||||||
|
<include refid="selectEpsMethodChangeRecordVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||||
|
<if test="endTime != null and endTime != ''"> and create_time <= #{endTime}</if>
|
||||||
|
</where>
|
||||||
|
order by create_time desc
|
||||||
|
limit 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
+6
-1
@@ -34,15 +34,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="serverClientId" column="server_client_id" />
|
<result property="serverClientId" column="server_client_id" />
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="macAddress" column="mac_address" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectEpsNodeBandwidthVo">
|
<sql id="selectEpsNodeBandwidthVo">
|
||||||
select id, node_name, hardware_sn, calculation_mode, bandwidth_type, bandwidth_result, bandwidth_95_daily, bandwidth_95_monthly, avg_monthly_bandwidth_95, package_bandwidth_daily, machine_flow, uplink_switch, create_time, update_time, switch_sn, interface_name, resource_type, interface_link_device_type, effective_bandwidth_95_daily, effective_bandwidth_95_monthly, effective_avg_monthly_bandwidth_95, business_name, business_id, remark1, create_datetime, client_id, server_client_id, create_by, update_by from eps_node_bandwidth
|
select id, node_name, hardware_sn, calculation_mode, bandwidth_type, bandwidth_result, bandwidth_95_daily, bandwidth_95_monthly, avg_monthly_bandwidth_95, package_bandwidth_daily, machine_flow, uplink_switch, create_time, update_time, switch_sn, interface_name, resource_type, interface_link_device_type, effective_bandwidth_95_daily, effective_bandwidth_95_monthly, effective_avg_monthly_bandwidth_95, business_name, business_id, remark1, create_datetime, client_id, server_client_id, create_by, update_by, mac_address from eps_node_bandwidth
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectEpsNodeBandwidthList" parameterType="EpsNodeBandwidth" resultMap="EpsNodeBandwidthResult">
|
<select id="selectEpsNodeBandwidthList" parameterType="EpsNodeBandwidth" resultMap="EpsNodeBandwidthResult">
|
||||||
<include refid="selectEpsNodeBandwidthVo"/>
|
<include refid="selectEpsNodeBandwidthVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
<if test="macAddress != null and macAddress != ''"> and mac_address = #{macAddress}</if>
|
||||||
<if test="nodeName != null and nodeName != ''"> and node_name like concat('%', #{nodeName}, '%')</if>
|
<if test="nodeName != null and nodeName != ''"> and node_name like concat('%', #{nodeName}, '%')</if>
|
||||||
<if test="hardwareSn != null and hardwareSn != ''"> and hardware_sn = #{hardwareSn}</if>
|
<if test="hardwareSn != null and hardwareSn != ''"> and hardware_sn = #{hardwareSn}</if>
|
||||||
<if test="calculationMode != null and calculationMode != ''"> and calculation_mode = #{calculationMode}</if>
|
<if test="calculationMode != null and calculationMode != ''"> and calculation_mode = #{calculationMode}</if>
|
||||||
@@ -120,6 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="serverClientId != null">server_client_id,</if>
|
<if test="serverClientId != null">server_client_id,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="macAddress != null">mac_address,</if>
|
||||||
create_time,
|
create_time,
|
||||||
update_time,
|
update_time,
|
||||||
</trim>
|
</trim>
|
||||||
@@ -150,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="serverClientId != null">#{serverClientId},</if>
|
<if test="serverClientId != null">#{serverClientId},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="macAddress != null">#{macAddress},</if>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="createTime != null">
|
<when test="createTime != null">
|
||||||
#{createTime},
|
#{createTime},
|
||||||
@@ -200,6 +204,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="serverClientId != null">server_client_id = #{serverClientId},</if>
|
<if test="serverClientId != null">server_client_id = #{serverClientId},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="macAddress != null">mac_address = #{macAddress},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|||||||
Reference in New Issue
Block a user