Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety-progress
Project
Project
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
耿迪迪
gassafety-progress
Commits
84b45ab5
Commit
84b45ab5
authored
Mar 02, 2022
by
王晓倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大屏标点报警接口
parent
7dbf6501
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
96 additions
and
103 deletions
+96
-103
TDetectorUserController.java
...ong/web/controller/supervise/TDetectorUserController.java
+2
-2
TDetectorUserMapper.java
...in/java/com/zehong/system/mapper/TDetectorUserMapper.java
+4
-4
TDeviceInfoMapper.java
...main/java/com/zehong/system/mapper/TDeviceInfoMapper.java
+8
-0
TSiteStationInfoMapper.java
...java/com/zehong/system/mapper/TSiteStationInfoMapper.java
+9
-0
ITDetectorUserService.java
...java/com/zehong/system/service/ITDetectorUserService.java
+5
-3
TDetectorUserServiceImpl.java
.../zehong/system/service/impl/TDetectorUserServiceImpl.java
+43
-43
TDetectorUserMapper.xml
.../src/main/resources/mapper/system/TDetectorUserMapper.xml
+10
-51
TDeviceInfoMapper.xml
...em/src/main/resources/mapper/system/TDeviceInfoMapper.xml
+8
-0
TSiteStationInfoMapper.xml
...c/main/resources/mapper/system/TSiteStationInfoMapper.xml
+7
-0
No files found.
gassafetyprogress-admin/src/main/java/com/zehong/web/controller/supervise/TDetectorUserController.java
View file @
84b45ab5
...
...
@@ -50,8 +50,8 @@ public class TDetectorUserController extends BaseController
* @return
*/
@GetMapping
(
"/detectorUserList"
)
public
AjaxResult
detectorUserList
(){
return
AjaxResult
.
success
(
tDetectorUserService
.
detectorUserList
());
public
AjaxResult
detectorUserList
(
TDetectorUser
tDetectorUser
){
return
AjaxResult
.
success
(
tDetectorUserService
.
detectorUserList
(
tDetectorUser
));
}
/**
...
...
gassafetyprogress-system/src/main/java/com/zehong/system/mapper/TDetectorUserMapper.java
View file @
84b45ab5
package
com
.
zehong
.
system
.
mapper
;
import
java.util.List
;
import
java.util.Map
;
import
com.zehong.system.domain.TDetectorInfo
;
import
com.zehong.system.domain.TDetectorUser
;
...
...
@@ -27,15 +28,14 @@ public interface TDetectorUserMapper
*
* @return 燃气用户
*/
public
List
<
TDetectorUserVO
>
countTDetectorUser
(
TDetector
Info
tDetectorInfo
);
public
List
<
TDetectorUserVO
>
countTDetectorUser
(
TDetector
User
tDetectorUser
);
/**
* 查询探测器报警用户
*
* @param tDetectorUser 探测器用户
* @return 探测器用户
* @return map
*/
public
TDetectorUserVO
countTDetectorUserAlarm
(
TDetectorUser
tDetectorUser
);
public
List
<
Map
>
getDetectorUserAlarmList
(
);
/**
* 泽宏云推送查询燃气用户
...
...
gassafetyprogress-system/src/main/java/com/zehong/system/mapper/TDeviceInfoMapper.java
View file @
84b45ab5
...
...
@@ -5,6 +5,7 @@ import java.util.Map;
import
com.zehong.system.domain.TDeviceInfo
;
import
com.zehong.system.domain.TDeviceInfoS
;
import
com.zehong.system.domain.vo.TDetectorUserVO
;
import
org.apache.ibatis.annotations.Param
;
/**
...
...
@@ -23,6 +24,13 @@ public interface TDeviceInfoMapper
*/
public
TDeviceInfo
selectTDeviceInfoById
(
Long
deviceId
);
/**
* 查询设备报警信息
*
* @return map
*/
public
List
<
Map
>
getDeviceInfoAlarmList
();
/**
* 查询设备信息列表
*
...
...
gassafetyprogress-system/src/main/java/com/zehong/system/mapper/TSiteStationInfoMapper.java
View file @
84b45ab5
package
com
.
zehong
.
system
.
mapper
;
import
java.util.List
;
import
java.util.Map
;
import
com.zehong.system.domain.TSiteStationInfo
;
/**
...
...
@@ -19,6 +21,13 @@ public interface TSiteStationInfoMapper
*/
public
TSiteStationInfo
selectTSiteStationInfoById
(
Long
siteStationId
);
/**
* 查询场站报警信息
*
* @return map
*/
public
List
<
Map
>
getSiteStationAlarmList
();
/**
* 查询场站信息列表
*
...
...
gassafetyprogress-system/src/main/java/com/zehong/system/service/ITDetectorUserService.java
View file @
84b45ab5
package
com
.
zehong
.
system
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
com.zehong.system.domain.TDetectorUser
;
import
com.zehong.system.domain.vo.TDetectorUserVO
;
...
...
@@ -18,14 +20,14 @@ public interface ITDetectorUserService
*
* @return 探测器用户集合
*/
public
List
<
TDetectorUserVO
>
detectorUserList
();
public
List
<
TDetectorUserVO
>
detectorUserList
(
TDetectorUser
tDetectorUser
);
/**
* 查询探测器报警用户(前台调用)
*
* @return 探测器用户
*/
public
List
<
TDetectorUserVO
>
getDetectorUserAlarmList
();
public
List
<
Map
>
getDetectorUserAlarmList
();
/**
* 查询探测器报警用户(后台推送)
...
...
@@ -33,7 +35,7 @@ public interface ITDetectorUserService
* @param tDetectorUser 探测器用户
* @return 探测器用户
*/
public
TDetectorUserVO
detectorUserAlarmList
(
TDetectorUser
tDetectorUser
);
public
List
<
TDetectorUserVO
>
detectorUserAlarmList
(
TDetectorUser
tDetectorUser
);
/**
* 泽宏云推送查询燃气用户
...
...
gassafetyprogress-system/src/main/java/com/zehong/system/service/impl/TDetectorUserServiceImpl.java
View file @
84b45ab5
...
...
@@ -2,19 +2,18 @@ package com.zehong.system.service.impl;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
com.zehong.system.domain.TDetectorInfo
;
import
com.zehong.system.domain.TDetectorReportData
;
import
com.zehong.system.domain.vo.TDetectorUserVO
;
import
com.zehong.system.mapper.TDetectorInfoMapper
;
import
com.zehong.system.mapper.TDetectorReportDataMapper
;
import
com.zehong.system.mapper.TDeviceInfoMapper
;
import
com.zehong.system.mapper.TSiteStationInfoMapper
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TDetectorUserMapper
;
import
com.zehong.system.domain.TDetectorUser
;
import
com.zehong.system.service.ITDetectorUserService
;
import
org.springframework.util.StringUtils
;
/**
* 燃气用户Service业务层处理
...
...
@@ -28,9 +27,9 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
@Autowired
private
TDetectorUserMapper
tDetectorUserMapper
;
@Autowired
private
TDe
tectorInfoMapper
tDetector
InfoMapper
;
private
TDe
viceInfoMapper
tDevice
InfoMapper
;
@Autowired
private
T
DetectorReportDataMapper
tDetectorReportData
Mapper
;
private
T
SiteStationInfoMapper
tSiteStationInfo
Mapper
;
/**
...
...
@@ -39,10 +38,10 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
* @return 探测器用户
*/
@Override
public
List
<
TDetectorUserVO
>
detectorUserList
()
public
List
<
TDetectorUserVO
>
detectorUserList
(
TDetectorUser
tDetectorUser
)
{
List
<
TDetectorUserVO
>
list
=
new
ArrayList
<>();
List
<
TDetectorUserVO
>
tDetectorUserList
=
tDetectorUserMapper
.
countTDetectorUser
(
new
TDetectorInfo
()
);
List
<
TDetectorUserVO
>
tDetectorUserList
=
tDetectorUserMapper
.
countTDetectorUser
(
tDetectorUser
);
List
<
Object
>
initList
=
new
ArrayList
<>();
for
(
TDetectorUserVO
user
:
tDetectorUserList
){
...
...
@@ -54,14 +53,12 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
initList
.
add
(
user
);
userVO
.
setDetectorCountList
(
initList
);
userVO
.
setIconType
(
"6"
);
userVO
.
setUserStatus
(
"1"
);
}
else
{
BeanUtils
.
copyProperties
(
user
,
temp
);
List
<
Object
>
newList
=
new
ArrayList
<>();
newList
.
add
(
temp
);
userVO
.
setDetectorCountList
(
newList
);
userVO
.
setIconType
(
"6"
);
userVO
.
setUserStatus
(
"1"
);
list
.
add
(
userVO
);
}
}
...
...
@@ -75,34 +72,32 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
* @return 探测器用户
*/
@Override
public
List
<
TDetectorUserVO
>
getDetectorUserAlarmList
()
public
List
<
Map
>
getDetectorUserAlarmList
()
{
List
<
TDetectorUserVO
>
list
=
new
ArrayList
<>();
TDetectorInfo
tDetectorInfo
=
new
TDetectorInfo
();
tDetectorInfo
.
setDetectorStatus
(
"2"
);
// 查询报警的数据
List
<
TDetectorUserVO
>
tDetectorUserList
=
tDetectorUserMapper
.
countTDetectorUser
(
tDetectorInfo
);
List
<
Map
>
list
=
new
ArrayList
<>();
List
<
Object
>
initList
=
new
ArrayList
<>();
for
(
TDetectorUserVO
user
:
tDetectorUserList
){
TDetectorUserVO
userVO
=
new
TDetectorUserVO
();
BeanUtils
.
copyProperties
(
user
,
userVO
);
TDetectorUserVO
temp
=
new
TDetectorUserVO
();
if
(
user
.
getUserId
().
equals
(
temp
.
getUserId
())){
initList
.
add
(
user
);
userVO
.
setDetectorCountList
(
initList
);
userVO
.
setIconType
(
"6"
);
userVO
.
setUserStatus
(
"2"
);
}
else
{
BeanUtils
.
copyProperties
(
user
,
temp
);
List
<
Object
>
newList
=
new
ArrayList
<>();
newList
.
add
(
temp
);
userVO
.
setDetectorCountList
(
newList
);
userVO
.
setIconType
(
"6"
);
userVO
.
setUserStatus
(
"2"
);
list
.
add
(
userVO
);
// 查询报警用户
List
<
Map
>
userList
=
tDetectorUserMapper
.
getDetectorUserAlarmList
();
for
(
Map
map
:
userList
){
map
.
put
(
"iconType"
,
"6"
);
list
.
add
(
map
);
}
// 查询报警设备
List
<
Map
>
infoList
=
tDeviceInfoMapper
.
getDeviceInfoAlarmList
();
for
(
Map
map
:
infoList
){
// deviceType:1阀门井 2调压箱
if
(
map
.
get
(
"deviceType"
).
equals
(
"1"
)){
map
.
put
(
"iconType"
,
"3"
);
}
else
if
(
map
.
get
(
"deviceType"
).
equals
(
"2"
)){
map
.
put
(
"iconType"
,
"2"
);
}
list
.
add
(
map
);
}
// 查询报警场站
List
<
Map
>
stationList
=
tSiteStationInfoMapper
.
getSiteStationAlarmList
();
for
(
Map
map
:
stationList
){
map
.
put
(
"iconType"
,
"4"
);
list
.
add
(
map
);
}
return
list
;
...
...
@@ -115,17 +110,22 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
* @return 探测器用户
*/
@Override
public
TDetectorUserVO
detectorUserAlarmList
(
TDetectorUser
tDetectorUser
)
public
List
<
TDetectorUserVO
>
detectorUserAlarmList
(
TDetectorUser
tDetectorUser
)
{
List
<
Object
>
list
=
new
ArrayList
<>();
TDetectorUserVO
user
=
tDetectorUserMapper
.
countTDetectorUserAlarm
(
tDetectorUser
);
List
<
TDetectorUserVO
>
list
=
new
ArrayList
<>();
List
<
TDetectorUserVO
>
tDetectorUserList
=
tDetectorUserMapper
.
countTDetectorUser
(
tDetectorUser
);
List
<
Object
>
initList
=
new
ArrayList
<>();
for
(
TDetectorUserVO
user
:
tDetectorUserList
)
{
TDetectorUserVO
userVO
=
new
TDetectorUserVO
();
BeanUtils
.
copyProperties
(
user
,
userVO
);
initList
.
add
(
userVO
);
userVO
.
setDetectorCountList
(
initList
);
list
.
add
(
user
);
userVO
.
setDetectorCountList
(
list
);
}
return
userVO
;
return
list
;
}
/**
...
...
gassafetyprogress-system/src/main/resources/mapper/system/TDetectorUserMapper.xml
View file @
84b45ab5
...
...
@@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where user_id = #{userId}
</select>
<select
id=
"countTDetectorUser"
resultType=
"TDetectorUserVO"
parameterType=
"TDetector
Info
"
>
<select
id=
"countTDetectorUser"
resultType=
"TDetectorUserVO"
parameterType=
"TDetector
User
"
>
select t1.*,
IFNULL(t2.historyAlarmNum,0) AS historyAlarmNum,
IFNULL(t2.processingAlarmNum,0) AS processingAlarmNum,
...
...
@@ -66,8 +66,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.phone AS phone,
a.email AS email,
CASE a.detector_type
WHEN '1' THEN '家用
报警
器'
WHEN '2' THEN '工业
报警
器' END AS detectorType,
WHEN '1' THEN '家用
探测
器'
WHEN '2' THEN '工业
探测
器' END AS detectorType,
COUNT(a.detector_id) AS detectorCount,
SUM(CASE a.detector_status WHEN '0' THEN 1 ELSE 0 END) AS onLineNum,
SUM(CASE a.detector_status WHEN '1' THEN 1 ELSE 0 END) AS offLineNum
...
...
@@ -77,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a2.* from t_detector_info a1
right join t_detector_user a2 on a1.user_id = a2.user_id
<where>
a1.is_del = '0' and a2.is_del = '0'
<if
test=
"
detectorStatus != null and detectorStatus != ''"
>
and a1.detector_status = #{detectorStatus
}
</if>
<if
test=
"
userId != null and userId != ''"
>
and a2.user_id = #{userId
}
</if>
</where>
) a
group by a.user_id,a.detector_type
...
...
@@ -92,59 +92,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join t_detector_info b2 on b1.detector_code = b2.detector_code
right join t_detector_user b3 on b2.user_id = b3.user_id
<where>
b2.is_del = '0' and b3.is_del = '0'
<if
test=
"
detectorStatus != null and detectorStatus != ''"
>
and b2.detector_status = #{detectorStatus
}
</if>
<if
test=
"
userId != null and userId != ''"
>
and b3.user_id = #{userId
}
</if>
</where>
) b
group by b.user_id,b.detector_type
) t2 on t2.userId = t1.userId
</select>
<select
id=
"countTDetectorUserAlarm"
resultType=
"TDetectorUserVO"
parameterType=
"TDetectorUser"
>
select t1.*,
IFNULL(t2.historyAlarmNum,0) AS historyAlarmNum,
IFNULL(t2.processingAlarmNum,0) AS processingAlarmNum,
IFNULL(t2.cancelAlarmNum,0) AS cancelAlarmNum
from(
select a.user_id AS userId,
a.detector_id AS detectorId,
a.detector_status AS detectorStatus,
a.nick_name AS nickName,
a.user_type AS userType,
a.address AS address,
a.longitude AS longitude,
a.latitude AS latitude,
a.linkman AS linkman,
a.phone AS phone,
a.email AS email,
CASE a.detector_type
WHEN '1' THEN '家用报警器'
WHEN '2' THEN '工业报警器' END AS detectorType,
COUNT(a.detector_id) AS detectorCount,
SUM(CASE a.detector_status WHEN '0' THEN 1 ELSE 0 END) AS onLineNum,
SUM(CASE a.detector_status WHEN '1' THEN 1 ELSE 0 END) AS offLineNum
from(select a1.detector_id,
a1.detector_type,
a1.detector_status,
a2.* from t_detector_info a1
<select
id=
"getDetectorUserAlarmList"
resultType=
"Map"
>
select a2.user_id as userId
from t_detector_info a1
right join t_detector_user a2 on a1.user_id = a2.user_id
where a1.is_del = '0' and a2.is_del = '0' and a2.user_id = #{userId}) a
group by a.detector_type
) t1 left join (
select b.user_id AS userId,
COUNT(b.id) AS historyAlarmNum,
SUM(CASE b.is_cancel_alarm WHEN '0' THEN 1 ELSE 0 END) AS processingAlarmNum,
COUNT(b.id) - SUM(CASE b.is_cancel_alarm WHEN '0' THEN 1 ELSE 0 END) AS cancelAlarmNum
from(select b1.id,b1.is_cancel_alarm,b2.*
from t_detector_report_data b1
left join t_detector_info b2 on b1.detector_code = b2.detector_code
right join t_detector_user b3 on b2.user_id = b3.user_id
where b2.is_del = '0' and b3.is_del = '0' and b3.user_id = #{userId}) b
group by b.detector_type
) t2 on t2.userId = t1.userId
where a1.is_del = '0' and a2.is_del = '0' and a1.detector_status = '2'
</select>
<insert
id=
"insertTDetectorUser"
parameterType=
"TDetectorUser"
useGeneratedKeys=
"true"
keyProperty=
"userId"
>
...
...
gassafetyprogress-system/src/main/resources/mapper/system/TDeviceInfoMapper.xml
View file @
84b45ab5
...
...
@@ -64,6 +64,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where device_id = #{deviceId} and is_del='0'
</select>
<select
id=
"getDeviceInfoAlarmList"
resultType=
"Map"
>
select a2.device_id as deviceId,
a2.device_type as deviceType
from t_detector_info a1
right join t_device_info a2 on a1.device_id = a2.device_id
where a1.is_del = '0' and a2.is_del = '0' and a1.detector_status = '2'
</select>
<insert
id=
"insertTDeviceInfo"
parameterType=
"TDeviceInfo"
useGeneratedKeys=
"true"
keyProperty=
"deviceId"
>
insert into t_device_info
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
gassafetyprogress-system/src/main/resources/mapper/system/TSiteStationInfoMapper.xml
View file @
84b45ab5
...
...
@@ -46,6 +46,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where site_station_id = #{siteStationId} and is_del='0'
</select>
<select
id=
"getSiteStationAlarmList"
resultType=
"Map"
>
select a2.site_station_id as siteStationId
from t_detector_info a1
right join t_site_station_info a2 on a1.site_station_id = a2.site_station_id
where a1.is_del = '0' and a2.is_del = '0' and a1.detector_status = '2'
</select>
<insert
id=
"insertTSiteStationInfo"
parameterType=
"TSiteStationInfo"
useGeneratedKeys=
"true"
keyProperty=
"siteStationId"
>
insert into t_site_station_info
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
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