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
74235268
Commit
74235268
authored
Jul 19, 2022
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:新增设备状态统计接口
parent
de333899
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
0 deletions
+73
-0
ConfigureController.java
...m/yeejoin/equipmanage/controller/ConfigureController.java
+20
-0
EquipmentSpecificAlarmMapper.java
...join/equipmanage/mapper/EquipmentSpecificAlarmMapper.java
+2
-0
IEquipmentSpecificAlarmService.java
...n/equipmanage/service/IEquipmentSpecificAlarmService.java
+2
-0
EquipmentSpecificAlarmServiceImpl.java
...anage/service/impl/EquipmentSpecificAlarmServiceImpl.java
+15
-0
EquipmentSpecificAlarmMapper.xml
...rc/main/resources/mapper/EquipmentSpecificAlarmMapper.xml
+34
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/ConfigureController.java
View file @
74235268
...
...
@@ -19,6 +19,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -54,4 +55,23 @@ public class ConfigureController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
list
);
}
@RequestMapping
(
value
=
"/equipStatusCount"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"系统设备状态统计"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"系统设备状态统计"
)
public
ResponseModel
equipStatusCount
(
@RequestParam
(
required
=
false
)
String
systemCode
)
{
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
String
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
if
(
StringUtils
.
isNotBlank
(
bizOrgCode
))
{
hashMap
.
put
(
"bizOrgCode"
,
bizOrgCode
);
}
}
if
(
StringUtils
.
isNotBlank
(
systemCode
))
{
hashMap
.
put
(
"systemCode"
,
systemCode
);
}
return
CommonResponseUtil
.
success
(
equipmentSpecificAlarmService
.
equipStatusCount
(
hashMap
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentSpecificAlarmMapper.java
View file @
74235268
...
...
@@ -197,4 +197,6 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
* @return
*/
int
selectCountByIotCode
(
@Param
(
"iotCode"
)
String
iotCode
,
@Param
(
"indexKey"
)
String
indexKey
,
@Param
(
"indexValue"
)
String
indexValue
);
List
<
Map
<
String
,
Object
>>
equipStatusCount
(
HashMap
<
String
,
Object
>
hashMap
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentSpecificAlarmService.java
View file @
74235268
...
...
@@ -15,6 +15,7 @@ import com.yeejoin.equipmanage.common.vo.TopographyAlarmVo;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -83,4 +84,5 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif
*/
List
<
EquipmentSpecificAlarm
>
getEquipListBySpecific
(
Boolean
status
,
Long
equipmentSpecificId
);
LinkedList
<
Map
<
String
,
Object
>>
equipStatusCount
(
HashMap
<
String
,
Object
>
hashMap
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificAlarmServiceImpl.java
View file @
74235268
...
...
@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -653,4 +654,18 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
return
equipmentSpecificAlarmMapper
.
getEquipListBySpecific
(
status
,
equipmentSpecificId
);
}
@Override
public
LinkedList
<
Map
<
String
,
Object
>>
equipStatusCount
(
HashMap
<
String
,
Object
>
hashMap
)
{
LinkedList
<
Map
<
String
,
Object
>>
linkedList
=
new
LinkedList
<>();
List
<
Map
<
String
,
Object
>>
list
=
equipmentSpecificAlarmMapper
.
equipStatusCount
(
hashMap
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"正常"
);
map
.
put
(
"value"
,
Integer
.
parseInt
(
list
.
get
(
0
).
get
(
"value"
).
toString
())
-
Integer
.
parseInt
(
list
.
get
(
1
).
get
(
"value"
).
toString
()));
linkedList
.
add
(
map
);
linkedList
.
add
(
list
.
get
(
1
));
}
return
linkedList
;
}
}
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificAlarmMapper.xml
View file @
74235268
...
...
@@ -1140,4 +1140,37 @@
AND equipment_specific_index_key = #{indexKey,jdbcType=VARCHAR}
and `status` = 1
</select>
<select
id=
"equipStatusCount"
parameterType=
"java.util.HashMap"
resultType=
"java.util.Map"
>
SELECT
'总数' AS `name`,
COUNT( DISTINCT wles.id ) AS `value`
FROM
`wl_equipment_specific` `wles`
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, wles.system_id )
<where>
<if
test=
"systemCode != null and systemCode != ''"
>
AND fs.code = #{systemCode}
</if>
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND wles.biz_org_code like concat (#{bizOrgCode},'%')
</if>
</where>
union all
SELECT
'异常' AS `name`,
COUNT( wlesa.equipment_specific_index_value = 'true' ) AS `value`
FROM
wl_equipment_specific_alarm wlesa
LEFT JOIN `wl_equipment_specific` `wles` ON `wlesa`.`equipment_specific_id` = `wles`.`id`
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, wles.system_id )
<where>
wlesa.equipment_specific_index_value = 'true'
<if
test=
"systemCode != null and systemCode != ''"
>
AND fs.code = #{systemCode}
</if>
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND wles.biz_org_code like concat (#{bizOrgCode},'%')
</if>
</where>
</select>
</mapper>
\ 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