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
237ca311
Commit
237ca311
authored
Sep 14, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消防系统-运行数据接口开发
parent
2b5ef428
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
2 deletions
+90
-2
EquipmentSpecificIndexController.java
...ipmanage/controller/EquipmentSpecificIndexController.java
+27
-1
EquipmentSpecificIndexMapper.java
...join/equipmanage/mapper/EquipmentSpecificIndexMapper.java
+12
-1
IEquipmentSpecificIndexSerivce.java
...n/equipmanage/service/IEquipmentSpecificIndexSerivce.java
+4
-0
EquipmentSpecificIndexSerivceImpl.java
...anage/service/impl/EquipmentSpecificIndexSerivceImpl.java
+15
-0
EquipmentSpecificIndexMapper.xml
...rc/main/resources/mapper/EquipmentSpecificIndexMapper.xml
+32
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentSpecificIndexController.java
View file @
237ca311
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
...
@@ -13,11 +17,13 @@ import org.springframework.web.bind.annotation.RestController;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
java.util.Map
;
@Slf4j
@RestController
@Api
(
tags
=
"装备性能指标API"
)
@RequestMapping
(
value
=
"/equipSpecificIndex"
)
public
class
EquipmentSpecificIndexController
{
public
class
EquipmentSpecificIndexController
extends
AbstractBaseController
{
@Autowired
private
IEquipmentSpecificIndexSerivce
equipmentSpecificIndexService
;
...
...
@@ -29,4 +35,24 @@ public class EquipmentSpecificIndexController {
return
equipmentSpecificIndexService
.
getById
(
id
);
}
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取性能指标"
,
notes
=
"获取性能指标"
)
public
IPage
<
Map
<
String
,
Object
>>
getPage
(
@RequestParam
(
value
=
"pageNumber"
,
required
=
false
)
Integer
pageNumber
,
@RequestParam
(
value
=
"pageSize"
,
required
=
false
)
Integer
pageSize
,
@RequestParam
(
value
=
"bizOrgCode"
,
required
=
false
)
String
bizOrgCode
,
@RequestParam
(
value
=
"systemId"
,
required
=
false
)
String
systemId
,
@RequestParam
(
value
=
"equipName"
,
required
=
false
)
String
equipName
,
@RequestParam
(
value
=
"startDate"
,
required
=
false
)
String
startDate
,
@RequestParam
(
value
=
"endDate"
,
required
=
false
)
String
endDate
)
{
if
(!
StringUtils
.
hasText
(
bizOrgCode
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
bizOrgCode
=
reginParams
.
getPersonIdentity
().
getCompanyBizOrgCode
();
}
Page
<
EquipmentSpecificIndex
>
page
=
new
Page
<>(
pageNumber
,
pageSize
);
return
equipmentSpecificIndexService
.
getPage
(
page
,
bizOrgCode
,
systemId
,
equipName
,
startDate
,
endDate
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentSpecificIndexMapper.java
View file @
237ca311
package
com
.
yeejoin
.
equipmanage
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.Video
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO
;
...
...
@@ -105,7 +107,7 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
List
<
EquipmentIndexVO
>
getEquipIndexBySpecificIdIn
(
@Param
(
"list"
)
List
<
String
>
specificDetails
);
List
<
EquipmentIndexVO
>
getEquipIndexByIdIn
(
@Param
(
"list"
)
List
<
Long
>
specificIndexIds
);
List
<
Map
<
String
,
Object
>>
getEquipSpecificIndexByUpdateDateDesc
();
List
<
EquipmentSpecificIndex
>
getEquipmentSpeIndexByIotCodeTrend
(
String
iotCode
,
Integer
isTrend
,
String
fieldKey
);
...
...
@@ -117,4 +119,13 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
List
<
EquipmentSpecificIndex
>
getEquipIndexInIndex
(
@Param
(
"list"
)
List
<
String
>
listIndex
);
EquipmentSpecificIndex
getEquipmentSpeIndexByAddress
(
String
indexAddress
,
String
eventAddress
,
String
gatewayId
);
IPage
<
Map
<
String
,
Object
>>
selectEquipIndexPage
(
@Param
(
"page"
)
Page
<
EquipmentSpecificIndex
>
page
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
,
@Param
(
"systemId"
)
String
systemId
,
@Param
(
"equipName"
)
String
equipName
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentSpecificIndexSerivce.java
View file @
237ca311
package
com
.
yeejoin
.
equipmanage
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.Video
;
...
...
@@ -77,4 +79,6 @@ public interface IEquipmentSpecificIndexSerivce extends IService<EquipmentSpecif
List
<
EquipmentIndexVO
>
getEquipIndexBySpecificIdIn
(
List
<
String
>
specificDetails
);
List
<
EquipmentIndexVO
>
getEquipIndexByIdIn
(
List
<
Long
>
specificIndexIds
);
IPage
<
Map
<
String
,
Object
>>
getPage
(
Page
<
EquipmentSpecificIndex
>
page
,
String
bizOrgCode
,
String
systemId
,
String
equipName
,
String
startDate
,
String
endDate
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificIndexSerivceImpl.java
View file @
237ca311
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
...
...
@@ -11,6 +13,8 @@ import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -97,4 +101,15 @@ public class EquipmentSpecificIndexSerivceImpl extends ServiceImpl<EquipmentSpec
}
}
@Override
public
IPage
<
Map
<
String
,
Object
>>
getPage
(
Page
<
EquipmentSpecificIndex
>
page
,
String
bizOrgCode
,
String
systemId
,
String
equipName
,
String
startDate
,
String
endDate
)
{
IPage
<
Map
<
String
,
Object
>>
resultPage
=
this
.
baseMapper
.
selectEquipIndexPage
(
page
,
bizOrgCode
,
systemId
,
equipName
,
startDate
,
endDate
);
resultPage
.
getRecords
().
forEach
(
record
->
{
String
updateDate
=
record
.
getOrDefault
(
"updateDate"
,
""
).
toString
();
LocalDateTime
dateTime
=
LocalDateTime
.
parse
(
updateDate
);
String
formattedDate
=
dateTime
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
));
record
.
put
(
"updateDate"
,
formattedDate
);
});
return
resultPage
;
}
}
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificIndexMapper.xml
View file @
237ca311
...
...
@@ -596,4 +596,35 @@
</if>
</where>
</select>
<select
id=
"selectEquipIndexPage"
resultType=
"java.util.Map"
>
SELECT wesi.id AS id,
wes.code AS equipmentSpecificCode,
wes.name AS equipmentSpecificName,
wesi.equipment_index_name AS equipmentIndexName,
wesi.value AS equipmentIndexValue,
wesi.unit AS equipmentIndexUnit,
wes.position AS location,
wesi.update_date AS updateDate
FROM wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
<where>
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND wes.biz_org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
<if
test=
"systemId != null and systemId != ''"
>
AND wes.system_id = #{systemId}
</if>
<if
test=
"equipName != null and equipName != ''"
>
AND wes.name LIKE CONCAT('%', #{equipName}, '%')
</if>
<if
test=
"startDate != null and startDate != ''"
>
AND wesi.update_date >= #{startDate}
</if>
<if
test=
"endDate != null and endDate != ''"
>
AND wesi.update_date
<
= #{endDate}
</if>
</where>
ORDER BY wesi.update_date DESC
</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