insert into client_info
client_id,
username,
access_token,
os_name,
os_version,
java_version,
app_version,
hostname,
ip_address,
status,
auth_time,
last_active_time,
online,
cpu_usage,
memory_usage,
disk_usage,
network_status,
heartbeat_time,
#{clientId},
#{username},
#{accessToken},
#{osName},
#{osVersion},
#{javaVersion},
#{appVersion},
#{hostname},
#{ipAddress},
#{status},
#{authTime},
#{lastActiveTime},
#{online},
#{cpuUsage},
#{memoryUsage},
#{diskUsage},
#{networkStatus},
#{heartbeatTime},
update client_info
username = #{username},
access_token = #{accessToken},
os_name = #{osName},
os_version = #{osVersion},
java_version = #{javaVersion},
app_version = #{appVersion},
hostname = #{hostname},
ip_address = #{ipAddress},
status = #{status},
last_active_time = #{lastActiveTime},
online = #{online},
cpu_usage = #{cpuUsage},
memory_usage = #{memoryUsage},
disk_usage = #{diskUsage},
network_status = #{networkStatus},
heartbeat_time = #{heartbeatTime},
update_time = NOW()
where client_id = #{clientId}
insert into client_event_log(
client_id,
event_type,
event_content,
event_time,
event_level,
status
)values(
#{clientId},
#{eventType},
#{eventContent},
#{eventTime},
#{eventLevel},
#{status}
)
insert into client_data_report
client_id,
data_type,
data_count,
collect_time,
status,
#{clientId},
#{dataType},
#{dataCount},
#{collectTime},
#{status},
INSERT INTO client_error_report
client_id,
error_type,
error_message,
error_time
#{clientId},
#{errorType},
#{errorMessage},
#{errorTime}
update client_info set online = #{param2} where client_id = #{param1}
update client_info
last_active_time = #{lastActiveTime},
heartbeat_time = #{heartbeatTime},
online = #{online},
cpu_usage = #{cpuUsage},
memory_usage = #{memoryUsage},
disk_usage = #{diskUsage},
network_status = #{networkStatus}
where client_id = #{clientId}
update client_auth_info
username = #{username},
access_token = #{accessToken},
os_name = #{osName},
os_version = #{osVersion},
java_version = #{javaVersion},
app_version = #{appVersion},
hostname = #{hostname},
ip_address = #{ipAddress},
status = #{status},
last_active_time = #{lastActiveTime},
online = #{online}
where client_id = #{clientId}
select id, client_id, username, access_token, os_name, os_version, java_version,
app_version, hostname, ip_address, status, auth_time, last_active_time, online
from client_auth_info
select id, client_id, username, error_type, error_message, stack_trace,
error_time, os_name, os_version, app_version
from client_error_report
select id, client_id, username, heartbeat_time, cpu_usage, memory_usage,
disk_usage, network_status
from client_heartbeat
select id, client_id, username, data_type, data_count, collect_time, status
from client_data_report
INSERT INTO client_alibaba1688_monitor
(
client_id,
ip_address,
event_type,
event_time,
duration,
create_time
)
VALUES
(
#{clientId},
#{ipAddress},
#{eventType},
#{eventTime},
#{duration},
#{createTime},
)
UPDATE client_info
SET online = '0'
WHERE online = '1'
AND (heartbeat_time IS NULL OR heartbeat_time < DATE_SUB(NOW(), INTERVAL 7 DAY))
DELETE FROM client_error_report
WHERE error_time < DATE_SUB(NOW(), INTERVAL 30 DAY)
DELETE FROM client_data_report
WHERE collect_time < DATE_SUB(NOW(), INTERVAL 90 DAY)
AND data_type NOT IN ('API_CALL')
DELETE FROM client_event_log
WHERE event_time < DATE_SUB(NOW(), INTERVAL 7 DAY)
UPDATE client_data_report
SET data_count = #{newCount},
collect_time = NOW()
WHERE id = #{id}