Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
c51897dc
Commit
c51897dc
authored
Jun 25, 2022
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
根据换流站统计消防系统状态
parent
8de6ebf7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
1 deletion
+59
-1
FireEquipmentSignalLogMapper.java
...t/module/ccs/api/mapper/FireEquipmentSignalLogMapper.java
+7
-0
FireFightingSystemMapper.java
.../boot/module/ccs/api/mapper/FireFightingSystemMapper.java
+4
-0
FireEquipmentSignalLogMapper.xml
...rc/main/resources/mapper/FireEquipmentSignalLogMapper.xml
+9
-0
FireFightingSystemMapper.xml
...pi/src/main/resources/mapper/FireFightingSystemMapper.xml
+8
-0
FireStationInfoController.java
.../module/ccs/biz/controller/FireStationInfoController.java
+11
-1
FireStationInfoServiceImpl.java
...dule/ccs/biz/service/impl/FireStationInfoServiceImpl.java
+20
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/mapper/FireEquipmentSignalLogMapper.java
View file @
c51897dc
...
@@ -32,4 +32,11 @@ public interface FireEquipmentSignalLogMapper extends BaseMapper<FireEquipmentSi
...
@@ -32,4 +32,11 @@ public interface FireEquipmentSignalLogMapper extends BaseMapper<FireEquipmentSi
* @return List<FireEquipmentDto>
* @return List<FireEquipmentDto>
*/
*/
List
<
FireEquipmentDto
>
distinctByEquipmentId
(
@Param
(
"stationCode"
)
String
stationCode
,
@Param
(
"alarmDate"
)
String
alarmDate
);
List
<
FireEquipmentDto
>
distinctByEquipmentId
(
@Param
(
"stationCode"
)
String
stationCode
,
@Param
(
"alarmDate"
)
String
alarmDate
);
/**
* 根据系统
* @param mrid
* @return
*/
Integer
getAlarmCountByMrid
(
@Param
(
"mrid"
)
String
mrid
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/mapper/FireFightingSystemMapper.java
View file @
c51897dc
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.ccs.api.mapper;
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.ccs.api.mapper;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireFightingSystem
;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireFightingSystem
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
/**
/**
* 消防系统信息 Mapper 接口
* 消防系统信息 Mapper 接口
*
*
...
@@ -11,4 +13,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -11,4 +13,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
*/
public
interface
FireFightingSystemMapper
extends
BaseMapper
<
FireFightingSystem
>
{
public
interface
FireFightingSystemMapper
extends
BaseMapper
<
FireFightingSystem
>
{
List
<
FireFightingSystem
>
getMridByCode
(
String
stationCode
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/resources/mapper/FireEquipmentSignalLogMapper.xml
View file @
c51897dc
...
@@ -74,4 +74,13 @@
...
@@ -74,4 +74,13 @@
and ai.station_code =#{stationCode}
and ai.station_code =#{stationCode}
</if>
</if>
</select>
</select>
<select
id=
"getAlarmCountByMrid"
resultType=
"java.lang.Integer"
>
SELECT
IFNULL( sum( is_alarm ), 0 )
FROM
asf_fire_equipment_signal_log
WHERE
FIND_IN_SET(#{mrid,jdbcType=VARCHAR}, system_mrids)
</select>
</mapper>
</mapper>
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
c51897dc
...
@@ -2,4 +2,12 @@
...
@@ -2,4 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.ccs.api.mapper.FireFightingSystemMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.ccs.api.mapper.FireFightingSystemMapper"
>
<select
id=
"getMridByCode"
resultType=
"com.yeejoin.amos.boot.module.ccs.api.entity.FireFightingSystem"
>
SELECT *
FROM
ast_fire_fighting_system
where station_code = #{stationCode,jdbcType=VARCHAR}
GROUP BY
mrid
</select>
</mapper>
</mapper>
amos-boot-module/amos-boot-module-biz/amos-boot-module-ccs-biz/src/main/java/com/yeejoin/amos/boot/module/ccs/biz/controller/FireStationInfoController.java
View file @
c51897dc
...
@@ -112,10 +112,20 @@ public class FireStationInfoController extends BaseController {
...
@@ -112,10 +112,20 @@ public class FireStationInfoController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据换流站code统计消防车"
,
notes
=
"根据换流站code统计消防车"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据换流站code统计消防车"
,
notes
=
"根据换流站code统计消防车"
)
@GetMapping
(
value
=
"/getCarInfoByStationCode"
)
@GetMapping
(
value
=
"/getCarInfoByStationCode"
)
public
ResponseModel
<
List
<
CarInfoVO
>>
getCarInfoByStationCode
(
@ApiParam
(
value
=
"换流站编号"
)
@RequestParam
(
required
=
true
)
String
stationCode
)
{
public
ResponseModel
<
List
<
CarInfoVO
>>
getCarInfoByStationCode
(
@ApiParam
(
value
=
"换流站编号"
,
required
=
true
)
@RequestParam
(
required
=
true
)
String
stationCode
)
{
if
(
StrUtil
.
isEmpty
(
stationCode
))
{
if
(
StrUtil
.
isEmpty
(
stationCode
))
{
throw
new
BadRequest
(
"换流站编号不能为空"
);
throw
new
BadRequest
(
"换流站编号不能为空"
);
}
}
return
ResponseHelper
.
buildResponse
(
fireStationInfoServiceImpl
.
getCarInfoByStationCode
(
stationCode
));
return
ResponseHelper
.
buildResponse
(
fireStationInfoServiceImpl
.
getCarInfoByStationCode
(
stationCode
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据换流站code统计消防系统状态"
,
notes
=
"根据换流站code统计消防系统状态"
)
@GetMapping
(
value
=
"/getFireSystemByStationCode"
)
public
ResponseModel
<
Map
<
String
,
Integer
>>
getFireSystemByStationCode
(
@ApiParam
(
value
=
"换流站编号"
,
required
=
true
)
@RequestParam
(
required
=
true
)
String
stationCode
)
{
if
(
StrUtil
.
isEmpty
(
stationCode
))
{
throw
new
BadRequest
(
"换流站编号不能为空"
);
}
return
ResponseHelper
.
buildResponse
(
fireStationInfoServiceImpl
.
getFireSystemByStationCode
(
stationCode
));
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-ccs-biz/src/main/java/com/yeejoin/amos/boot/module/ccs/biz/service/impl/FireStationInfoServiceImpl.java
View file @
c51897dc
...
@@ -6,8 +6,11 @@ import cn.hutool.core.date.DateTime;
...
@@ -6,8 +6,11 @@ import cn.hutool.core.date.DateTime;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto
;
import
com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto
;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireFightingSystem
;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireStationInfo
;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireStationInfo
;
import
com.yeejoin.amos.boot.module.ccs.api.enums.StationOrderByTypeEnum
;
import
com.yeejoin.amos.boot.module.ccs.api.enums.StationOrderByTypeEnum
;
import
com.yeejoin.amos.boot.module.ccs.api.mapper.FireEquipmentSignalLogMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.mapper.FireFightingSystemMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.mapper.FireStationInfoMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.mapper.FireStationInfoMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.mapper.FireVehicleMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.mapper.FireVehicleMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.service.IFireStationInfoService
;
import
com.yeejoin.amos.boot.module.ccs.api.service.IFireStationInfoService
;
...
@@ -34,6 +37,13 @@ public class FireStationInfoServiceImpl extends BaseService<FireStationInfoDto,
...
@@ -34,6 +37,13 @@ public class FireStationInfoServiceImpl extends BaseService<FireStationInfoDto,
@Autowired
@Autowired
private
FireVehicleMapper
fireVehicleMapper
;
private
FireVehicleMapper
fireVehicleMapper
;
@Autowired
private
FireFightingSystemMapper
fireFightingSystemMapper
;
@Autowired
private
FireEquipmentSignalLogMapper
fireEquipmentSignalLogMapper
;
/**
/**
* 列表查询 示例
* 列表查询 示例
*
*
...
@@ -153,4 +163,13 @@ public class FireStationInfoServiceImpl extends BaseService<FireStationInfoDto,
...
@@ -153,4 +163,13 @@ public class FireStationInfoServiceImpl extends BaseService<FireStationInfoDto,
});
});
return
carInfoByStationCode
;
return
carInfoByStationCode
;
}
}
public
Map
<
String
,
Integer
>
getFireSystemByStationCode
(
String
stationCode
)
{
HashMap
<
String
,
Integer
>
resultMap
=
new
HashMap
<>();
List
<
FireFightingSystem
>
mridList
=
fireFightingSystemMapper
.
getMridByCode
(
stationCode
);
mridList
.
forEach
(
item
->
{
resultMap
.
put
(
item
.
getName
(),
fireEquipmentSignalLogMapper
.
getAlarmCountByMrid
(
item
.
getMrid
()));
});
return
resultMap
;
}
}
}
\ No newline at end of file
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