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
fc274294
Commit
fc274294
authored
Jan 24, 2024
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备网关、设备日志查询条件新增
parent
ce4c4e40
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
24 deletions
+39
-24
SStoreServiceImpl.java
...ain/java/share/system/service/impl/SStoreServiceImpl.java
+1
-0
DeviceLogMapper.xml
...stem/src/main/resources/mapper/system/DeviceLogMapper.xml
+18
-11
DeviceStatusLogMapper.xml
...rc/main/resources/mapper/system/DeviceStatusLogMapper.xml
+20
-13
No files found.
share-system/src/main/java/share/system/service/impl/SStoreServiceImpl.java
View file @
fc274294
...
@@ -506,6 +506,7 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
...
@@ -506,6 +506,7 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
put
(
"id"
,
store
.
getId
());
put
(
"id"
,
store
.
getId
());
put
(
"name"
,
store
.
getName
());
put
(
"name"
,
store
.
getName
());
put
(
"storeType"
,
store
.
getStoreType
());
put
(
"storeType"
,
store
.
getStoreType
());
put
(
"deviceGroup"
,
store
.
getDeviceGroup
());
}};
}};
return
map
;
return
map
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
...
share-system/src/main/resources/mapper/system/DeviceLogMapper.xml
View file @
fc274294
...
@@ -23,27 +23,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -23,27 +23,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
</resultMap>
<sql
id=
"selectDeviceLogVo"
>
<sql
id=
"selectDeviceLogVo"
>
select id, dev_mac, dev_id, seq, mqtt_type, mqtt_describe, payload, topic, create_by, create_time,
select s1.id, s1.dev_mac, s1.dev_id, s1.seq, s1.mqtt_type, s1.mqtt_describe, s1.payload, s1.topic,
update_by, update_time, remark, `result`, description from s_device_log
s1.create_by, s1.create_time,
s1.update_by, s1.update_time, s1.remark, s1.`result`, s1.description
from s_device_log s1
left join s_device s2 on s1.dev_id = s2.dev_id
left join s_room s3 on s2.room_id = s3.id
left join s_store s4 on s3.store_id = s4.id
</sql>
</sql>
<select
id=
"selectDeviceLogList"
parameterType=
"DeviceLog"
resultMap=
"DeviceLogResult"
>
<select
id=
"selectDeviceLogList"
parameterType=
"DeviceLog"
resultMap=
"DeviceLogResult"
>
<include
refid=
"selectDeviceLogVo"
/>
<include
refid=
"selectDeviceLogVo"
/>
<where>
<where>
<if
test=
"devMac != null and devMac != ''"
>
and dev_mac = #{devMac}
</if>
<if
test=
"devMac != null and devMac != ''"
>
and s1.dev_mac = #{devMac}
</if>
<if
test=
"devId != null and devId != ''"
>
and dev_id = #{devId}
</if>
<if
test=
"devId != null and devId != ''"
>
and s1.dev_id = #{devId}
</if>
<if
test=
"seq != null and seq != ''"
>
and seq = #{seq}
</if>
<if
test=
"seq != null and seq != ''"
>
and s1.seq = #{seq}
</if>
<if
test=
"mqttType != null and mqttType != ''"
>
and mqtt_type = #{mqttType}
</if>
<if
test=
"mqttType != null and mqttType != ''"
>
and s1.mqtt_type = #{mqttType}
</if>
<if
test=
"mqttDescribe != null and mqttDescribe != ''"
>
and mqtt_describe = #{mqttDescribe}
</if>
<if
test=
"mqttDescribe != null and mqttDescribe != ''"
>
and s1.mqtt_describe = #{mqttDescribe}
</if>
<if
test=
"payload != null and payload != ''"
>
and payload = #{payload}
</if>
<if
test=
"payload != null and payload != ''"
>
and s1.payload = #{payload}
</if>
<if
test=
"topic != null and topic != ''"
>
and topic = #{topic}
</if>
<if
test=
"topic != null and topic != ''"
>
and s1.topic = #{topic}
</if>
<if
test=
"storeName != null and storeName != ''"
>
and s4.name like concat('%', #{storeName}, '%')
</if>
<if
test=
"roomName != null and roomName != ''"
>
and s3.name like concat('%', #{roomName}, '%')
</if>
</where>
</where>
order by create_time desc
order by
s1.
create_time desc
</select>
</select>
<select
id=
"selectDeviceLogById"
parameterType=
"Long"
resultMap=
"DeviceLogResult"
>
<select
id=
"selectDeviceLogById"
parameterType=
"Long"
resultMap=
"DeviceLogResult"
>
<include
refid=
"selectDeviceLogVo"
/>
<include
refid=
"selectDeviceLogVo"
/>
where id = #{id}
where
s1.
id = #{id}
</select>
</select>
<select
id=
"selectListByMaxId"
resultMap=
"DeviceLogResult"
>
<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,
SELECT t1.id, t1.dev_mac, t1.dev_id, t1.seq, t1.mqtt_type, t1.mqtt_describe, t1.payload, t1.topic,
...
...
share-system/src/main/resources/mapper/system/DeviceStatusLogMapper.xml
View file @
fc274294
...
@@ -22,29 +22,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -22,29 +22,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
</resultMap>
<sql
id=
"selectDeviceStatusLogVo"
>
<sql
id=
"selectDeviceStatusLogVo"
>
select id, dev_id, dev_mac, is_abnormal, status, room_id, voltage, signal_value, create_time, update_time,
select s1.id, s1.dev_id, s1.dev_mac, s1.is_abnormal, s1.status, s1.room_id, s1.voltage,
remark, operate_log_id, is_send_sms, previous_status from s_device_status_log
s1.signal_value, s1.create_time, s1.update_time,
s1.remark, s1.operate_log_id, s1.is_send_sms, s1.previous_status
from s_device_status_log s1
left join s_device s2 on s1.dev_id = s2.dev_id
left join s_room s3 on s2.room_id = s3.id
left join s_store s4 on s3.store_id = s4.id
</sql>
</sql>
<select
id=
"selectDeviceStatusLogList"
parameterType=
"DeviceStatusLog"
resultMap=
"DeviceStatusLogResult"
>
<select
id=
"selectDeviceStatusLogList"
parameterType=
"DeviceStatusLog"
resultMap=
"DeviceStatusLogResult"
>
<include
refid=
"selectDeviceStatusLogVo"
/>
<include
refid=
"selectDeviceStatusLogVo"
/>
<where>
<where>
<if
test=
"devId != null and devId != ''"
>
and dev_id = #{devId}
</if>
<if
test=
"devId != null and devId != ''"
>
and s1.dev_id = #{devId}
</if>
<if
test=
"devMac != null and devMac != ''"
>
and dev_mac = #{devMac}
</if>
<if
test=
"devMac != null and devMac != ''"
>
and s1.dev_mac = #{devMac}
</if>
<if
test=
"isAbnormal != null "
>
and is_abnormal = #{isAbnormal}
</if>
<if
test=
"isAbnormal != null "
>
and s1.is_abnormal = #{isAbnormal}
</if>
<if
test=
"status != null and status != ''"
>
and status = #{status}
</if>
<if
test=
"status != null and status != ''"
>
and s1.status = #{status}
</if>
<if
test=
"roomId != null "
>
and room_id = #{roomId}
</if>
<if
test=
"roomId != null "
>
and s1.room_id = #{roomId}
</if>
<if
test=
"voltage != null and voltage != ''"
>
and voltage = #{voltage}
</if>
<if
test=
"voltage != null and voltage != ''"
>
and s1.voltage = #{voltage}
</if>
<if
test=
"signalValue != null and signalValue != ''"
>
and signal_value = #{signalValue}
</if>
<if
test=
"signalValue != null and signalValue != ''"
>
and s1.signal_value = #{signalValue}
</if>
<if
test=
"operateLogId != null "
>
and operate_log_id = #{operateLogId}
</if>
<if
test=
"operateLogId != null "
>
and s1.operate_log_id = #{operateLogId}
</if>
<if
test=
"isSendSms != null "
>
and is_send_sms = #{isSendSms}
</if>
<if
test=
"isSendSms != null "
>
and s1.is_send_sms = #{isSendSms}
</if>
<if
test=
"storeName != null and storeName != ''"
>
and s4.name like concat('%', #{storeName}, '%')
</if>
<if
test=
"roomName != null and roomName != ''"
>
and s3.name like concat('%', #{roomName}, '%')
</if>
</where>
</where>
order by create_time desc
order by
s1.
create_time desc
</select>
</select>
<select
id=
"selectDeviceStatusLogById"
parameterType=
"Long"
resultMap=
"DeviceStatusLogResult"
>
<select
id=
"selectDeviceStatusLogById"
parameterType=
"Long"
resultMap=
"DeviceStatusLogResult"
>
<include
refid=
"selectDeviceStatusLogVo"
/>
<include
refid=
"selectDeviceStatusLogVo"
/>
where id = #{id}
where
s1.
id = #{id}
</select>
</select>
<insert
id=
"insertDeviceStatusLog"
parameterType=
"DeviceStatusLog"
>
<insert
id=
"insertDeviceStatusLog"
parameterType=
"DeviceStatusLog"
>
...
...
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