Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_ht
Commits
491c2809
Commit
491c2809
authored
Jan 16, 2024
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备日志信息完善
parent
07e16f2d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
8 deletions
+31
-8
DeviceLog.java
...e-system/src/main/java/share/system/domain/DeviceLog.java
+7
-0
MqttxServiceImpl.java
...main/java/share/system/service/impl/MqttxServiceImpl.java
+9
-5
DeviceLogMapper.xml
...stem/src/main/resources/mapper/system/DeviceLogMapper.xml
+15
-3
No files found.
share-system/src/main/java/share/system/domain/DeviceLog.java
View file @
491c2809
...
...
@@ -50,6 +50,13 @@ public class DeviceLog extends BaseEntity
@Excel
(
name
=
"消息主题"
)
private
String
topic
;
@Excel
(
name
=
"消息回复结果"
)
@TableField
(
value
=
"`result`"
)
private
String
result
;
@Excel
(
name
=
"描述"
)
private
String
description
;
/**
* 房间名称
*/
...
...
share-system/src/main/java/share/system/service/impl/MqttxServiceImpl.java
View file @
491c2809
...
...
@@ -644,11 +644,15 @@ public class MqttxServiceImpl implements MqttxService {
private
boolean
updateDeviceLog
(
String
topic
,
String
payload
)
{
JSONObject
json
=
JSONUtil
.
parseObj
(
payload
);
if
(
json
.
size
()
>
0
)
{
DeviceLog
deviceLog
=
new
DeviceLog
();
String
seq
=
json
.
getStr
(
"seq"
);
deviceLog
.
setSeq
(
seq
);
deviceLog
.
setRemark
(
payload
);
return
0
<
deviceLogMapper
.
updateBySeq
(
deviceLog
);
JSONArray
array
=
json
.
getJSONArray
(
"params"
);
if
(
array
!=
null
&&
array
.
size
()
>
0
)
{
DeviceLog
deviceLog
=
new
DeviceLog
();
String
seq
=
json
.
getStr
(
"seq"
);
deviceLog
.
setSeq
(
seq
);
deviceLog
.
setRemark
(
payload
);
deviceLog
.
setResult
(
array
.
getStr
(
1
));
return
0
<
deviceLogMapper
.
updateBySeq
(
deviceLog
);
}
}
return
false
;
}
...
...
share-system/src/main/resources/mapper/system/DeviceLogMapper.xml
View file @
491c2809
...
...
@@ -18,10 +18,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"result"
column=
"result"
/>
<result
property=
"description"
column=
"description"
/>
</resultMap>
<sql
id=
"selectDeviceLogVo"
>
select id, dev_mac, dev_id, seq, mqtt_type, mqtt_describe, payload, topic, create_by, create_time, update_by, update_time, remark from s_device_log
select id, dev_mac, dev_id, seq, mqtt_type, mqtt_describe, payload, topic, create_by, create_time,
update_by, update_time, remark, `result`, description from s_device_log
</sql>
<select
id=
"selectDeviceLogList"
parameterType=
"DeviceLog"
resultMap=
"DeviceLogResult"
>
...
...
@@ -44,7 +47,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select
id=
"selectListByMaxId"
resultMap=
"DeviceLogResult"
>
SELECT t1.id, t1.dev_mac, t1.dev_id, t1.seq, t1.mqtt_type, t1.mqtt_describe, t1.payload, t1.topic,
t1.create_by, t1.create_time, t1.update_by, t1.update_time, t1.remark
t1.create_by, t1.create_time, t1.update_by, t1.update_time, t1.remark,
t1.`result`, t1.description
FROM s_device_log t1
JOIN (
SELECT MAX(id) AS max_id
...
...
@@ -74,6 +78,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"updateBy != null"
>
update_by,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"result != null"
>
`result`,
</if>
<if
test=
"description != null"
>
description,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"devMac != null"
>
#{devMac},
</if>
...
...
@@ -88,6 +94,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"updateBy != null"
>
#{updateBy},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
<if
test=
"remark != null"
>
#{remark},
</if>
<if
test=
"result != null"
>
#{result},
</if>
<if
test=
"description != null"
>
#{description},
</if>
</trim>
</insert>
...
...
@@ -106,11 +114,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"result != null"
>
`result` = #{result},
</if>
<if
test=
"description != null"
>
description = #{description},
</if>
</trim>
where id = #{id}
</update>
<update
id=
"updateBySeq"
parameterType=
"DeviceLog"
>
update s_device_log set remark = #{remark} where seq = #{seq}
update s_device_log
set remark = #{remark},`result` = #{result}
where seq = #{seq}
</update>
<delete
id=
"deleteDeviceLogById"
parameterType=
"Long"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment