Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
232e2ba4
由
康伟
编写于
2024-09-20 14:12:37 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge remote-tracking branch 'origin/master'
2 个父辈
01fff184
b16a2cdb
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
228 行增加
和
23 行删除
sk-module-biz/src/main/java/com/skua/modules/emergency/controller/EmergencyRiskEventController.java
sk-module-biz/src/main/java/com/skua/modules/emergency/controller/EventMapController.java
sk-module-biz/src/main/java/com/skua/modules/emergency/service/IEmergencyRiskEventService.java
sk-module-biz/src/main/java/com/skua/modules/emergency/service/impl/EmergencyRiskEventServiceImpl.java
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/mapper/FactoryCenterMapper.java
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/mapper/xml/FactoryCenterMapper.xml
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/service/impl/FactoryCenterServiceImpl.java
sk-module-biz/src/main/java/com/skua/modules/emergency/controller/EmergencyRiskEventController.java
查看文件 @
232e2ba
...
...
@@ -33,7 +33,7 @@ import java.util.stream.Collectors;
*/
@Slf4j
@Api
(
tags
=
"应急风险事件"
)
@RestController
(
"webEmergencyRiskEventController"
)
@RestController
@RequestMapping
(
"/web/emergency/emergencyRiskEvent"
)
public
class
EmergencyRiskEventController
{
@Autowired
...
...
sk-module-biz/src/main/java/com/skua/modules/emergency/controller/EventMapController.java
0 → 100644
查看文件 @
232e2ba
package
com
.
skua
.
modules
.
emergency
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.skua.core.api.vo.Result
;
import
com.skua.core.aspect.annotation.AutoLog
;
import
com.skua.modules.emergency.entity.EmergencyRiskEvent
;
import
com.skua.modules.emergency.service.IEmergencyRiskEventService
;
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.web.bind.annotation.*
;
import
java.util.*
;
/**
* 安全环保地图接口
*/
@Slf4j
@Api
(
tags
=
"安全环保地图"
)
@RestController
@RequestMapping
(
"/safetyEnviron/map"
)
public
class
EventMapController
{
@Autowired
private
IEmergencyRiskEventService
emergencyRiskEventService
;
/**
* 安全隐患事件数量
*/
@AutoLog
(
value
=
"安全隐患事件数量"
)
@ApiOperation
(
value
=
"安全隐患事件数量"
,
notes
=
"安全隐患事件数量"
)
@GetMapping
(
value
=
"/getCount"
)
public
Result
<
Map
<
String
,
Object
>>
getHandleCount
(
EmergencyRiskEvent
emergencyRiskEvent
){
Result
<
Map
<
String
,
Object
>>
result
=
new
Result
<>();
Map
<
String
,
Object
>
map
=
emergencyRiskEventService
.
getCount
(
emergencyRiskEvent
);
result
.
setSuccess
(
true
);
result
.
setResult
(
map
);
return
result
;
}
}
sk-module-biz/src/main/java/com/skua/modules/emergency/service/IEmergencyRiskEventService.java
查看文件 @
232e2ba
...
...
@@ -25,14 +25,9 @@ public interface IEmergencyRiskEventService extends IService<EmergencyRiskEvent>
void
handle
(
EmergencyRiskEventHandleDto
dto
);
/**
* <pre>
* 运营总览,应急事件已/未处理数量
* </pre>
* @param startTime
* @param endTime
* @param handleType【1未处理/3已处理】
* @author Li Yuanyuan,2023/7/3 14:09
* @Description: TODO(这里描述这个方法的需求变更情况)
* 安全隐患事件数量统计
* @param emergencyRiskEvent
* @return
*/
Map
<
String
,
Object
>
getNoHandleWorkOrderInfo
(
String
startTime
,
String
endTime
,
String
handleType
);
Map
<
String
,
Object
>
getCount
(
EmergencyRiskEvent
emergencyRiskEvent
);
}
...
...
sk-module-biz/src/main/java/com/skua/modules/emergency/service/impl/EmergencyRiskEventServiceImpl.java
查看文件 @
232e2ba
...
...
@@ -29,6 +29,7 @@ import org.springframework.stereotype.Service;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -92,19 +93,12 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven
}
@Override
public
Map
<
String
,
Object
>
getNoHandleWorkOrderInfo
(
String
startTime
,
String
endTime
,
String
handleType
)
{
QueryWrapper
queryWrapper
=
new
QueryWrapper
();
if
(
StringUtils
.
isEmpty
(
startTime
)){
//默认开始时间当年第一天
//结束时间未今天
endTime
=
DateUtils
.
getTodayOrMonthDate
(
"day"
)+
" 23:59:59"
;
startTime
=
endTime
.
substring
(
0
,
4
)+
"-01-01 00:00:00"
;
}
queryWrapper
.
select
(
"count(*) AS num "
);
queryWrapper
.
eq
(
"handle_result"
,
handleType
);
queryWrapper
.
ge
(
"report_date"
,
startTime
);
queryWrapper
.
le
(
"report_date"
,
endTime
);
return
getMap
(
queryWrapper
);
public
Map
<
String
,
Object
>
getCount
(
EmergencyRiskEvent
emergencyRiskEvent
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"total"
,
"9"
);
map
.
put
(
"yes"
,
"5"
);
map
.
put
(
"no"
,
"4"
);
return
map
;
}
@Override
...
...
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/mapper/FactoryCenterMapper.java
查看文件 @
232e2ba
package
com
.
skua
.
modules
.
dataAnalysis
.
mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
public
interface
FactoryCenterMapper
{
List
<
Map
<
String
,
Object
>>
getWssltj
(
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
,
@Param
(
"startDateTb"
)
String
startDateTb
,
@Param
(
"endDateTb"
)
String
endDateTb
,
@Param
(
"departId"
)
String
departId
);
List
<
Map
<
String
,
Object
>>
getHdltj
(
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
,
@Param
(
"startDateTb"
)
String
startDateTb
,
@Param
(
"endDateTb"
)
String
endDateTb
,
@Param
(
"departId"
)
String
departId
);
List
<
Map
<
String
,
Object
>>
getCnltj
(
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
,
@Param
(
"startDateTb"
)
String
startDateTb
,
@Param
(
"endDateTb"
)
String
endDateTb
,
@Param
(
"departId"
)
String
departId
);
Map
<
String
,
Object
>
getData
(
@Param
(
"month"
)
String
month
,
@Param
(
"departId"
)
String
departId
);
}
...
...
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/mapper/xml/FactoryCenterMapper.xml
查看文件 @
232e2ba
...
...
@@ -2,4 +2,160 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.skua.modules.dataAnalysis.mapper.FactoryCenterMapper"
>
<select
id=
"getWssltj"
resultType=
"java.util.HashMap"
>
SELECT
LEFT ( v.time, 7 ) AS time,
round( sum( v.CSL ) / 10000, 2 ) AS clsl,
ifnull(v2.clsl,0) as clsl_tb
FROM
view_2119 v
left join (
SELECT
RIGHT( LEFT ( time, 7 ), 2 ) AS time,
round( sum( CSL ) / 10000, 2 ) AS clsl
FROM
view_2119
WHERE
depart_id = #{departId}
AND time
>
= #{startDateTb}
AND time
<
= #{endDateTb}
GROUP BY
LEFT ( time, 7 )
) v2 on RIGHT( LEFT ( v.time, 7 ), 2 ) = v2.time
WHERE v.depart_id = #{departId}
AND v.time
>
= #{startDate}
AND v.time
<
= #{endDate}
GROUP BY
LEFT ( v.time, 7 )
</select>
<select
id=
"getHdltj"
resultType=
"java.util.HashMap"
>
SELECT
ROUND(SUM(v3.DLHJ)/10000,2) as hdl,
ROUND(ifnull(v2.clsl,0),2) as clsl,
ROUND(SUM(v3.DLHJ)/ifnull(v2.clsl,0),2) as dsdh,
ROUND(pre.hdl/10000,2) as hdl_tb,
ROUND(pre.clsl,2) as clsl_tb,
ROUND(pre.dsdh,2) as dsdh_tb,
LEFT(v3.time,7) as time
FROM
view_3a24 v3
left join (
SELECT
SUM(CSL) as clsl,
LEFT(time,7) as time
FROM
view_2119
WHERE
depart_id = #{departId}
AND time
>
= #{startDate}
AND time
<
= #{endDate}
GROUP BY LEFT ( time, 7 )
) v2 on LEFT(v3.time,7) = v2.time
left join (
SELECT
SUM(v3.DLHJ) as hdl,
ifnull(v2.clsl,0) as clsl,
round(SUM(v3.DLHJ)/ifnull(v2.clsl,0),2) as dsdh,
LEFT(v3.time,7) as time
FROM
view_3a24 v3
left join (
SELECT
SUM(CSL) as clsl,
LEFT(time,7) as time
FROM
view_2119
WHERE
depart_id = #{departId}
AND time
>
= #{startDateTb}
AND time
<
= #{endDateTb}
GROUP BY LEFT ( time, 7 )
) v2 on LEFT(v3.time,7) = v2.time
WHERE
v3.depart_id = #{departId}
AND v3.time
>
= #{startDateTb}
AND v3.time
<
= #{endDateTb}
GROUP BY LEFT ( v3.time, 7 )
) pre on right(pre.time,2) = right(LEFT(v3.time,7),2)
WHERE
v3.depart_id = #{departId}
AND v3.time
>
= #{startDate}
AND v3.time
<
= #{endDate}
GROUP BY LEFT ( v3.time, 7 )
</select>
<select
id=
"getCnltj"
resultType=
"java.util.HashMap"
>
SELECT
SUM(v3.WNL) as cnl,
ifnull(v2.clsl,0) as clsl,
round(SUM(v3.WNL)/(ifnull(v2.clsl,0)/10000),2) as wdscnl,
pre.cnl as cnl_tb,
pre.clsl as clsl_tb,
pre.wdscnl as wdscnl_tb,
LEFT(v3.time,7) as time
FROM
view_3a24 v3
left join (
SELECT
SUM(CSL) as clsl,
LEFT(time,7) as time
FROM
view_2119
WHERE
depart_id = #{departId}
AND time
>
= #{startDate}
AND time
<
= #{endDate}
GROUP BY LEFT ( time, 7 )
) v2 on LEFT(v3.time,7) = v2.time
left join (
SELECT
SUM(v3.WNL) as cnl,
ifnull(v2.clsl,0) as clsl,
round(SUM(v3.WNL)/(ifnull(v2.clsl,0)/10000),2) as wdscnl,
LEFT(v3.time,7) as time
FROM
view_3a24 v3
left join (
SELECT
SUM(CSL) as clsl,
LEFT(time,7) as time
FROM
view_2119
WHERE
depart_id = #{departId}
AND time
>
= #{startDateTb}
AND time
<
= #{endDateTb}
GROUP BY LEFT ( time, 7 )
) v2 on LEFT(v3.time,7) = v2.time
WHERE
v3.depart_id = #{departId}
AND v3.time
>
= #{startDateTb}
AND v3.time
<
= #{endDateTb}
GROUP BY LEFT ( v3.time, 7 )
) pre on right(pre.time,2) = right(LEFT(v3.time,7),2)
WHERE
v3.depart_id = #{departId}
AND v3.time
>
= #{startDate}
AND v3.time
<
= #{endDate}
GROUP BY LEFT ( v3.time, 7 )
</select>
<select
id=
"getData"
resultType=
"java.util.HashMap"
>
SELECT
ROUND(SUM( v3.DLHJ )/10000,2) AS yzdl,
ROUND(AVG( v3.DLHJ )/10000,2) AS rjdl,
ROUND(SUM( v3.WNL ),2) AS yzcnl,
ROUND(SUM( v2.CSL )/10000,2) AS yclsl,
ROUND(SUM( v3.DLHJ )/SUM( v2.CSL ),2) as dsdh,
ROUND(AVG( v2.CSL )/10000,2) AS rjclsl,
ROUND(SUM( v3.WNL )/(SUM( v2.CSL )/10000),2) as wdscnl,
LEFT ( v3.time, 7 ) AS time
FROM
view_3a24 v3
LEFT JOIN (select CSL,time from view_2119 where LEFT ( time, 7 ) = #{month} and depart_id = #{departId}) v2 ON v2.time = v3.time
where LEFT ( v3.time, 7 ) = #{month}
and v3.depart_id = #{departId}
</select>
</mapper>
...
...
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/service/impl/FactoryCenterServiceImpl.java
查看文件 @
232e2ba
此文件的差异被折叠,
点击展开。
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论