Initial commit

This commit is contained in:
2025-09-22 11:51:16 +08:00
commit c32381f8ed
1191 changed files with 130140 additions and 0 deletions

View File

@@ -0,0 +1,172 @@
<?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.ClientInfoMapper">
<resultMap type="ClientInfo" id="ClientInfoResult">
<result property="id" column="id" />
<result property="clientId" column="client_id" />
<result property="username" column="username" />
<result property="osName" column="os_name" />
<result property="appVersion" column="app_version" />
<result property="ipAddress" column="ip_address" />
<result property="lastActiveTime" column="last_active_time" />
<result property="online" column="online" />
<result property="hostname" column="hostname" />
<result property="osVersion" column="os_version" />
<result property="javaVersion" column="java_version" />
<result property="status" column="status" />
<result property="authTime" column="auth_time" />
<result property="accessToken" column="access_token" />
<result property="cpuUsage" column="cpu_usage" />
<result property="memoryUsage" column="memory_usage" />
<result property="diskUsage" column="disk_usage" />
<result property="networkStatus" column="network_status" />
<result property="heartbeatTime" column="heartbeat_time" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectClientInfoVo">
select id, client_id, username, os_name, app_version, ip_address, last_active_time, online,
hostname, os_version, java_version, status, auth_time, access_token, cpu_usage,
memory_usage, disk_usage, network_status, heartbeat_time, create_time, update_time, remark
from client_info
</sql>
<select id="selectClientInfoList" parameterType="ClientInfo" resultMap="ClientInfoResult">
<include refid="selectClientInfoVo"/>
<where>
<if test="clientId != null and clientId != ''"> and client_id like concat('%', #{clientId}, '%')</if>
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
<if test="osName != null and osName != ''"> and os_name like concat('%', #{osName}, '%')</if>
<if test="appVersion != null and appVersion != ''"> and app_version = #{appVersion}</if>
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
<if test="online != null and online != ''"> and online = #{online}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
order by last_active_time desc
</select>
<select id="selectClientInfoById" parameterType="Long" resultMap="ClientInfoResult">
<include refid="selectClientInfoVo"/>
where id = #{id}
</select>
<select id="selectClientInfoByClientId" parameterType="String" resultMap="ClientInfoResult">
<include refid="selectClientInfoVo"/>
where client_id = #{clientId}
</select>
<select id="selectOnlineClientCount" resultType="int">
select count(*) from client_info where online = '1'
</select>
<insert id="insertClientInfo" parameterType="ClientInfo" useGeneratedKeys="true" keyProperty="id">
insert into client_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clientId != null and clientId != ''">client_id,</if>
<if test="username != null and username != ''">username,</if>
<if test="osName != null and osName != ''">os_name,</if>
<if test="appVersion != null and appVersion != ''">app_version,</if>
<if test="ipAddress != null and ipAddress != ''">ip_address,</if>
<if test="lastActiveTime != null">last_active_time,</if>
<if test="online != null and online != ''">online,</if>
<if test="hostname != null and hostname != ''">hostname,</if>
<if test="osVersion != null and osVersion != ''">os_version,</if>
<if test="javaVersion != null and javaVersion != ''">java_version,</if>
<if test="status != null and status != ''">status,</if>
<if test="authTime != null">auth_time,</if>
<if test="accessToken != null and accessToken != ''">access_token,</if>
<if test="cpuUsage != null">cpu_usage,</if>
<if test="memoryUsage != null">memory_usage,</if>
<if test="diskUsage != null">disk_usage,</if>
<if test="networkStatus != null and networkStatus != ''">network_status,</if>
<if test="heartbeatTime != null">heartbeat_time,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null and remark != ''">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clientId != null and clientId != ''">#{clientId},</if>
<if test="username != null and username != ''">#{username},</if>
<if test="osName != null and osName != ''">#{osName},</if>
<if test="appVersion != null and appVersion != ''">#{appVersion},</if>
<if test="ipAddress != null and ipAddress != ''">#{ipAddress},</if>
<if test="lastActiveTime != null">#{lastActiveTime},</if>
<if test="online != null and online != ''">#{online},</if>
<if test="hostname != null and hostname != ''">#{hostname},</if>
<if test="osVersion != null and osVersion != ''">#{osVersion},</if>
<if test="javaVersion != null and javaVersion != ''">#{javaVersion},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="authTime != null">#{authTime},</if>
<if test="accessToken != null and accessToken != ''">#{accessToken},</if>
<if test="cpuUsage != null">#{cpuUsage},</if>
<if test="memoryUsage != null">#{memoryUsage},</if>
<if test="diskUsage != null">#{diskUsage},</if>
<if test="networkStatus != null and networkStatus != ''">#{networkStatus},</if>
<if test="heartbeatTime != null">#{heartbeatTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null and remark != ''">#{remark},</if>
</trim>
</insert>
<update id="updateClientInfo" parameterType="ClientInfo">
update client_info
<trim prefix="SET" suffixOverrides=",">
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
<if test="username != null and username != ''">username = #{username},</if>
<if test="osName != null and osName != ''">os_name = #{osName},</if>
<if test="appVersion != null and appVersion != ''">app_version = #{appVersion},</if>
<if test="ipAddress != null and ipAddress != ''">ip_address = #{ipAddress},</if>
<if test="lastActiveTime != null">last_active_time = #{lastActiveTime},</if>
<if test="online != null and online != ''">online = #{online},</if>
<if test="hostname != null and hostname != ''">hostname = #{hostname},</if>
<if test="osVersion != null and osVersion != ''">os_version = #{osVersion},</if>
<if test="javaVersion != null and javaVersion != ''">java_version = #{javaVersion},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="authTime != null">auth_time = #{authTime},</if>
<if test="accessToken != null and accessToken != ''">access_token = #{accessToken},</if>
<if test="cpuUsage != null">cpu_usage = #{cpuUsage},</if>
<if test="memoryUsage != null">memory_usage = #{memoryUsage},</if>
<if test="diskUsage != null">disk_usage = #{diskUsage},</if>
<if test="networkStatus != null and networkStatus != ''">network_status = #{networkStatus},</if>
<if test="heartbeatTime != null">heartbeat_time = #{heartbeatTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<update id="updateClientOnlineStatus">
update client_info set online = #{online}, last_active_time = now() where client_id = #{clientId}
</update>
<update id="updateClientHeartbeat" parameterType="ClientInfo">
update client_info
<trim prefix="SET" suffixOverrides=",">
<if test="lastActiveTime != null">last_active_time = #{lastActiveTime},</if>
<if test="online != null">online = #{online},</if>
<if test="cpuUsage != null">cpu_usage = #{cpuUsage},</if>
<if test="memoryUsage != null">memory_usage = #{memoryUsage},</if>
<if test="diskUsage != null">disk_usage = #{diskUsage},</if>
<if test="networkStatus != null">network_status = #{networkStatus},</if>
<if test="heartbeatTime != null">heartbeat_time = #{heartbeatTime},</if>
</trim>
where client_id = #{clientId}
</update>
<delete id="deleteClientInfoById" parameterType="Long">
delete from client_info where id = #{id}
</delete>
<delete id="deleteClientInfoByIds" parameterType="String">
delete from client_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>