mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-29 16:06:36 +08:00
init
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
<?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.admin.mapper.UserMapper">
|
||||
|
||||
<!-- 查询用户隧道权限详情(连表查询隧道和限速规则信息) -->
|
||||
<select id="getUserTunnelDetails" resultType="com.admin.common.dto.UserPackageDto$UserTunnelDetailDto">
|
||||
SELECT
|
||||
ut.id,
|
||||
ut.user_id as userId,
|
||||
ut.tunnel_id as tunnelId,
|
||||
t.name as tunnelName,
|
||||
t.flow as tunnelFlow,
|
||||
ut.flow,
|
||||
ut.in_flow as inFlow,
|
||||
ut.out_flow as outFlow,
|
||||
ut.num,
|
||||
ut.flow_reset_time as flowResetTime,
|
||||
ut.exp_time as expTime,
|
||||
ut.speed_id as speedId,
|
||||
sl.name as speedLimitName,
|
||||
sl.speed
|
||||
FROM user_tunnel ut
|
||||
LEFT JOIN tunnel t ON ut.tunnel_id = t.id
|
||||
LEFT JOIN speed_limit sl ON ut.speed_id = sl.id
|
||||
WHERE ut.user_id = #{userId}
|
||||
ORDER BY ut.id
|
||||
</select>
|
||||
|
||||
<!-- 查询用户转发详情(连表查询隧道信息) -->
|
||||
<select id="getUserForwardDetails" resultType="com.admin.common.dto.UserPackageDto$UserForwardDetailDto">
|
||||
SELECT
|
||||
f.id,
|
||||
f.name,
|
||||
f.tunnel_id as tunnelId,
|
||||
t.name as tunnelName,
|
||||
t.in_ip as inIp,
|
||||
f.in_port as inPort,
|
||||
f.remote_addr as remoteAddr,
|
||||
f.in_flow as inFlow,
|
||||
f.out_flow as outFlow,
|
||||
f.status,
|
||||
f.created_time as createdTime
|
||||
FROM forward f
|
||||
LEFT JOIN tunnel t ON f.tunnel_id = t.id
|
||||
WHERE f.user_id = #{userId}
|
||||
ORDER BY f.created_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 管理员查询所有隧道(流量和转发设置为99999) -->
|
||||
<select id="getAllTunnelsForAdmin" resultType="com.admin.common.dto.UserPackageDto$UserTunnelDetailDto">
|
||||
SELECT
|
||||
t.id,
|
||||
0 as userId,
|
||||
t.id as tunnelId,
|
||||
t.name as tunnelName,
|
||||
t.flow as tunnelFlow,
|
||||
99999 as flow,
|
||||
0 as inFlow,
|
||||
0 as outFlow,
|
||||
99999 as num,
|
||||
null as flowResetTime,
|
||||
null as expTime,
|
||||
null as speedId,
|
||||
'无限制' as speedLimitName,
|
||||
null as speed
|
||||
FROM tunnel t
|
||||
WHERE t.status = 1
|
||||
ORDER BY t.id
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user