2025-08-21 09:28:46 +08:00
<?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.ruoyi.system.mapper.EpsServerRevenueConfigMapper" >
2025-09-02 19:54:54 +08:00
2025-08-21 09:28:46 +08:00
<resultMap type= "EpsServerRevenueConfig" id= "EpsServerRevenueConfigResult" >
<result property= "id" column= "id" />
<result property= "nodeName" column= "node_name" />
<result property= "revenueMethod" column= "revenue_method" />
<result property= "hardwareSn" column= "hardware_sn" />
<result property= "trafficPort" column= "traffic_port" />
<result property= "bandwidth95" column= "bandwidth_95" />
<result property= "packageBandwidth" column= "package_bandwidth" />
<result property= "updateTime" column= "update_time" />
<result property= "businessName" column= "business_name" />
<result property= "businessCode" column= "business_code" />
<result property= "registrationStatus" column= "registration_status" />
<result property= "createBy" column= "create_by" />
<result property= "updateBy" column= "update_by" />
<result property= "createTime" column= "create_time" />
2025-08-28 09:40:11 +08:00
<result property= "changed" column= "changed" />
2025-09-02 19:54:54 +08:00
<result property= "serverIp" column= "server_ip" />
2025-08-21 09:28:46 +08:00
</resultMap>
<sql id= "selectEpsServerRevenueConfigVo" >
2025-09-02 19:54:54 +08:00
select id, node_name, revenue_method, hardware_sn, traffic_port, bandwidth_95, package_bandwidth, update_time, business_name, business_code, registration_status, create_by, update_by, create_time, changed, server_ip from eps_server_revenue_config
2025-08-21 09:28:46 +08:00
</sql>
<select id= "selectEpsServerRevenueConfigList" parameterType= "EpsServerRevenueConfig" resultMap= "EpsServerRevenueConfigResult" >
<include refid= "selectEpsServerRevenueConfigVo" />
<where>
2025-09-02 19:54:54 +08:00
and registration_status = "1"
2025-08-21 09:28:46 +08:00
<if test= "nodeName != null and nodeName != ''" > and node_name like concat('%', #{nodeName}, '%')</if>
<if test= "revenueMethod != null and revenueMethod != ''" > and revenue_method = #{revenueMethod}</if>
<if test= "hardwareSn != null and hardwareSn != ''" > and hardware_sn = #{hardwareSn}</if>
<if test= "trafficPort != null and trafficPort != ''" > and traffic_port = #{trafficPort}</if>
<if test= "bandwidth95 != null " > and bandwidth_95 = #{bandwidth95}</if>
<if test= "packageBandwidth != null " > and package_bandwidth = #{packageBandwidth}</if>
<if test= "businessName != null and businessName != ''" > and business_name like concat('%', #{businessName}, '%')</if>
<if test= "businessCode != null and businessCode != ''" > and business_code = #{businessCode}</if>
2025-08-28 09:40:11 +08:00
<if test= "changed != null and changed != ''" > and changed = #{changed}</if>
2025-09-02 19:54:54 +08:00
<if test= "serverIp != null and serverIp != ''" > and server_ip = #{serverIp}</if>
2025-08-21 09:28:46 +08:00
</where>
</select>
2025-09-02 19:54:54 +08:00
2025-08-21 09:28:46 +08:00
<select id= "selectEpsServerRevenueConfigById" parameterType= "Long" resultMap= "EpsServerRevenueConfigResult" >
<include refid= "selectEpsServerRevenueConfigVo" />
where id = #{id}
</select>
<insert id= "insertEpsServerRevenueConfig" parameterType= "EpsServerRevenueConfig" >
insert into eps_server_revenue_config
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "id != null" > id,</if>
<if test= "nodeName != null" > node_name,</if>
<if test= "revenueMethod != null" > revenue_method,</if>
<if test= "hardwareSn != null" > hardware_sn,</if>
<if test= "trafficPort != null" > traffic_port,</if>
<if test= "bandwidth95 != null" > bandwidth_95,</if>
<if test= "packageBandwidth != null" > package_bandwidth,</if>
<if test= "updateTime != null" > update_time,</if>
<if test= "businessName != null" > business_name,</if>
<if test= "businessCode != null" > business_code,</if>
<if test= "registrationStatus != null" > registration_status,</if>
<if test= "createBy != null" > create_by,</if>
<if test= "updateBy != null" > update_by,</if>
<if test= "createTime != null" > create_time,</if>
2025-08-28 09:40:11 +08:00
<if test= "changed != null" > changed,</if>
2025-09-02 19:54:54 +08:00
<if test= "serverIp != null" > server_ip,</if>
</trim>
2025-08-21 09:28:46 +08:00
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "id != null" > #{id},</if>
<if test= "nodeName != null" > #{nodeName},</if>
<if test= "revenueMethod != null" > #{revenueMethod},</if>
<if test= "hardwareSn != null" > #{hardwareSn},</if>
<if test= "trafficPort != null" > #{trafficPort},</if>
<if test= "bandwidth95 != null" > #{bandwidth95},</if>
<if test= "packageBandwidth != null" > #{packageBandwidth},</if>
<if test= "updateTime != null" > #{updateTime},</if>
<if test= "businessName != null" > #{businessName},</if>
<if test= "businessCode != null" > #{businessCode},</if>
<if test= "registrationStatus != null" > #{registrationStatus},</if>
<if test= "createBy != null" > #{createBy},</if>
<if test= "updateBy != null" > #{updateBy},</if>
<if test= "createTime != null" > #{createTime},</if>
2025-08-28 09:40:11 +08:00
<if test= "changed != null" > #{changed},</if>
2025-09-02 19:54:54 +08:00
<if test= "serverIp != null" > #{serverIp},</if>
</trim>
2025-08-21 09:28:46 +08:00
</insert>
<update id= "updateEpsServerRevenueConfig" parameterType= "EpsServerRevenueConfig" >
update eps_server_revenue_config
<trim prefix= "SET" suffixOverrides= "," >
<if test= "nodeName != null" > node_name = #{nodeName},</if>
<if test= "revenueMethod != null" > revenue_method = #{revenueMethod},</if>
<if test= "hardwareSn != null" > hardware_sn = #{hardwareSn},</if>
<if test= "trafficPort != null" > traffic_port = #{trafficPort},</if>
<if test= "bandwidth95 != null" > bandwidth_95 = #{bandwidth95},</if>
<if test= "packageBandwidth != null" > package_bandwidth = #{packageBandwidth},</if>
<if test= "updateTime != null" > update_time = #{updateTime},</if>
<if test= "businessName != null" > business_name = #{businessName},</if>
<if test= "businessCode != null" > business_code = #{businessCode},</if>
<if test= "registrationStatus != null" > registration_status = #{registrationStatus},</if>
<if test= "createBy != null" > create_by = #{createBy},</if>
<if test= "updateBy != null" > update_by = #{updateBy},</if>
<if test= "createTime != null" > create_time = #{createTime},</if>
2025-08-28 09:40:11 +08:00
<if test= "changed != null" > changed = #{changed},</if>
2025-09-02 19:54:54 +08:00
<if test= "serverIp != null" > server_ip = #{serverIp},</if>
2025-08-21 09:28:46 +08:00
</trim>
where id = #{id}
</update>
2025-09-04 23:18:08 +08:00
<update id= "updateEpsServerRevenueConfigByServerSn" parameterType= "EpsServerRevenueConfig" >
update eps_server_revenue_config
<trim prefix= "SET" suffixOverrides= "," >
<if test= "nodeName != null" > node_name = #{nodeName},</if>
</trim>
where hardware_sn = #{hardwareSn}
</update>
2025-08-21 09:28:46 +08:00
<delete id= "deleteEpsServerRevenueConfigById" parameterType= "Long" >
delete from eps_server_revenue_config where id = #{id}
</delete>
<delete id= "deleteEpsServerRevenueConfigByIds" parameterType= "String" >
2025-09-02 19:54:54 +08:00
delete from eps_server_revenue_config where id in
2025-08-21 09:28:46 +08:00
<foreach item= "id" collection= "array" open= "(" separator= "," close= ")" >
#{id}
</foreach>
</delete>
2025-08-21 18:29:22 +08:00
<select id= "getNodeMsgByIp" parameterType= "String" resultType= "java.util.Map" >
SELECT
rrr.hardware_sn AS hardwareSn,
rrr.resource_name AS resourceName,
esrc.revenue_method AS revenueMethod,
esrc.business_code AS businessCode,
2025-09-01 20:24:01 +08:00
esrc.business_name AS businessName,
esrc.package_bandwidth AS packageBandwidth
2025-08-21 18:29:22 +08:00
FROM
rm_resource_registration rrr
LEFT JOIN
eps_server_revenue_config esrc
ON
rrr.hardware_sn = esrc.hardware_sn
<where>
and rrr.registration_status = '1'
2025-08-22 18:13:10 +08:00
and rrr.ip_address = #{ipAddress}
2025-08-21 18:29:22 +08:00
</where>
</select>
2025-09-02 19:54:54 +08:00
<select id= "countBySn" parameterType= "String" >
<include refid= "selectEpsServerRevenueConfigVo" />
where hardware_sn = #{hardwareSn}
</select>
2025-09-09 17:45:39 +08:00
<select id= "countBusinessByTraffic" resultType= "java.lang.Integer" >
select count(1) from eps_server_revenue_config a left join rm_resource_registration b on a.hardware_sn=b.hardware_sn where a.revenue_method = '1' and b.online_status='1'
</select>
<select id= "countDeviceNumTop5" resultType= "java.util.Map" >
select count(1) total,a.business_name businessName from eps_server_revenue_config a left join rm_resource_registration b on a.hardware_sn=b.hardware_sn where a.revenue_method = '1' and b.online_status='1' group by a.business_name order by total desc limit 5
</select>
2025-08-21 09:28:46 +08:00
</mapper>