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
591a4d3f
Commit
591a4d3f
authored
Jul 24, 2024
by
刘凡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)增加应急卡片接口
parent
aa6eccaf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
204 additions
and
0 deletions
+204
-0
AlertCalledMapper.java
...os/boot/module/elevator/api/mapper/AlertCalledMapper.java
+17
-0
ElevatorMapper.java
.../amos/boot/module/elevator/api/mapper/ElevatorMapper.java
+2
-0
YjBaseMapper.java
...in/amos/boot/module/elevator/api/mapper/YjBaseMapper.java
+18
-0
AlertCalledMapper.xml
...96333-api/src/main/resources/mapper/AlertCalledMapper.xml
+34
-0
ElevatorMapper.xml
...le-96333-api/src/main/resources/mapper/ElevatorMapper.xml
+16
-0
YjBaseMapper.xml
...dule-96333-api/src/main/resources/mapper/YjBaseMapper.xml
+9
-0
DPStatisticsController.java
...odule/elevator/biz/controller/DPStatisticsController.java
+108
-0
DPStatisticsServiceImpl.java
...le/elevator/biz/service/impl/DPStatisticsServiceImpl.java
+0
-0
No files found.
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/java/com/yeejoin/amos/boot/module/elevator/api/mapper/AlertCalledMapper.java
View file @
591a4d3f
...
...
@@ -43,6 +43,23 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
* @param endDate
* @return
*/
List
<
Map
<
String
,
Object
>>
queryNearlyList
(
@Param
(
"beginDate"
)
String
beginDate
,
@Param
(
"endDate"
)
String
endDate
,
@Param
(
"regionCode"
)
String
regionCode
);
/**
* 接警情况统计(按场所)
*
* @return
*/
List
<
Map
<
String
,
Object
>>
queryListByLocation
(
@Param
(
"regionCode"
)
String
regionCode
);
/**
* 接警情况统计
*
* @param beginDate
* @param endDate
* @return
*/
Map
<
String
,
Long
>
queryAlertStatusCount
(
@Param
(
"beginDate"
)
String
beginDate
,
@Param
(
"endDate"
)
String
endDate
,
@Param
(
"groupCode"
)
String
groupCode
,
...
...
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/java/com/yeejoin/amos/boot/module/elevator/api/mapper/ElevatorMapper.java
View file @
591a4d3f
...
...
@@ -70,4 +70,6 @@ public interface ElevatorMapper extends BaseMapper<Elevator> {
Map
<
String
,
Object
>
selectMainUnitMessage
(
String
sequenceNbr
);
Map
<
String
,
Object
>
selectUseUnitByAlertId
(
String
sequenceNbr
);
List
<
Map
<
String
,
Object
>>
elevatorCountStat
(
@Param
(
"regionCodes"
)
List
<
String
>
regionCodes
);
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/java/com/yeejoin/amos/boot/module/elevator/api/mapper/YjBaseMapper.java
0 → 100644
View file @
591a4d3f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
elevator
.
api
.
mapper
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* Mapper 接口
*
* @author system_generator
* @date 2023-12-13
*/
@Mapper
public
interface
YjBaseMapper
{
CompanyModel
selectOneCompanyByCode
(
String
companyCode
);
String
getOrgCodeByCompanyCode
(
String
companyCode
);
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/resources/mapper/AlertCalledMapper.xml
View file @
591a4d3f
...
...
@@ -122,6 +122,40 @@
</if>
</select>
<select
id=
"queryNearlyList"
resultType=
"java.util.Map"
>
SELECT
date_format (call_time, '%Y-%m-%d') AS day,
alarm_type as alarmType,
ifnull ( SUM ( CASE WHEN father_alert IS NULL THEN 1 ELSE 0 END ), 0) AS majorAlertCount
FROM
tz_alert_called
WHERE
biz_org_code like concat(#{regionCode}, '%')
AND day BETWEEN #{beginDate} AND #{endDate}
GROUP BY
day, alarm_type
ORDER BY
day ASC
</select>
<select
id=
"queryListByLocation"
resultType=
"java.util.Map"
>
SELECT
ifnull ( SUM ( CASE WHEN father_alert IS NULL THEN 1 ELSE 0 END ), 0 ) AS majorAlertCount,
cdd.NAME as name
FROM
tz_alert_called tac
LEFT JOIN idx_biz_jg_use_info ibjuj ON tac.equipment_id = ibjuj.RECORD
LEFT JOIN cb_data_dictionary cdd ON ibjuj.USE_PLACE = cdd.sequence_nbr
WHERE
biz_org_code LIKE concat(#{regionCode}, '%')
AND
ibjuj.USE_PLACE is NOT NULL
AND cdd.NAME is NOT NULL
GROUP BY
cdd.NAME
ORDER BY ibjuj.USE_PLACE ASC
</select>
<select
id=
"queryAlertListByQueryDto"
resultType=
"java.util.Map"
>
SELECT
a.sequence_nbr AS sequenceNbr,
...
...
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/resources/mapper/ElevatorMapper.xml
View file @
591a4d3f
...
...
@@ -581,4 +581,20 @@
ibjmri.SEQUENCE_NBR = #{sequenceNbr}
</select>
<select
id=
"elevatorCountStat"
resultType=
"java.util.Map"
>
SELECT
district,
region_code as regionCode,
count(region_code) as total
FROM
tcb_elevator
WHERE
<if
test=
"regionCodes != null"
>
<foreach
collection=
"regionCodes"
index=
"index"
item=
"item"
open=
"("
separator=
" OR "
close=
")"
>
tcb_elevator.region_code LIKE CONCAT('%', #{item}, '%')
</foreach>
</if>
GROUP BY region_code
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/resources/mapper/YjBaseMapper.xml
0 → 100644
View file @
591a4d3f
<?xml version="1.0" encoding="UTF-8"?>
<!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.elevator.api.mapper.YjBaseMapper"
>
<select
id=
"getOrgCodeByCompanyCode"
resultType=
"java.lang.String"
>
select org_code from privilege_company where company_code = #{companyCode} limit 1
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/controller/DPStatisticsController.java
0 → 100644
View file @
591a4d3f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
elevator
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.AlertMaintenanceUnitStatisticsDto
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.AlertUseUnitStatisticsDto
;
import
com.yeejoin.amos.boot.module.elevator.biz.service.impl.DPStatisticsServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.FieldError
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
import
java.util.Map
;
/**
* 大屏统计controller
*
* @author Administrator
*/
@RestController
@RequestMapping
(
"/db/statistics"
)
@Api
(
tags
=
"大屏统计"
)
public
class
DPStatisticsController
{
private
DPStatisticsServiceImpl
statisticsService
;
public
DPStatisticsController
(
DPStatisticsServiceImpl
statisticsService
)
{
this
.
statisticsService
=
statisticsService
;
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-应急-办理量 (近7日)"
,
notes
=
"大屏-应急-办理量 (近7日)"
)
@PostMapping
(
value
=
"/yj/eventStatByDay"
)
public
ResponseModel
<
JSONObject
>
eventStatByDay
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
throws
Exception
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
eventStatByDay
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-应急-电梯数量统计 (按区域)"
,
notes
=
"大屏-应急-电梯数量统计 (按区域)"
)
@PostMapping
(
value
=
"/yj/elevatorCountStat"
)
public
ResponseModel
<
JSONObject
>
elevatorCountStat
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
throws
Exception
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
elevatorCountStat
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-应急-事件分布 (按场所)"
,
notes
=
"大屏-应急-事件分布 (按场所)"
)
@PostMapping
(
value
=
"/yj/eventStatByLocation"
)
public
ResponseModel
<
JSONObject
>
eventStatByLocation
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
throws
Exception
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
eventStatByLocation
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-应急-困人救援月度情况"
,
notes
=
"大屏-应急-困人救援月度情况"
)
@PostMapping
(
value
=
"/yj/trappedUserCount"
)
public
ResponseModel
<
JSONObject
>
trappedUserCount
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
throws
Exception
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
trappedUserCount
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-应急-月度困人故障高发使用单位"
,
notes
=
"大屏-应急-月度困人故障高发使用单位"
)
@PostMapping
(
value
=
"/yj/trappedUserHighCompanyCount"
)
public
ResponseModel
<
List
<
AlertUseUnitStatisticsDto
>>
trappedUserHighCompanyCount
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
throws
Exception
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
trappedUserHighCompanyCount
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏-应急-维保单位平均救援时间排名"
,
notes
=
"大屏-应急-维保单位平均救援时间排名"
)
@PostMapping
(
value
=
"/yj/rankUnitByRescueTime"
)
public
ResponseModel
<
List
<
AlertMaintenanceUnitStatisticsDto
>>
rankUnitByRescueTime
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
throws
Exception
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
rankUnitByRescueTime
(
dpFilterParamDto
));
}
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/service/impl/DPStatisticsServiceImpl.java
0 → 100644
View file @
591a4d3f
This diff is collapsed.
Click to expand it.
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