Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
cf91e8c6
Commit
cf91e8c6
authored
Apr 23, 2020
by
吴江
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_upgrade' of
http://172.16.10.76/station/YeeAmosFireAutoSysRoot
into dev_upgrade
parents
66c1b345
e0239459
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
463 additions
and
56 deletions
+463
-56
CheckStatusEnum.java
...va/com/yeejoin/amos/fas/common/enums/CheckStatusEnum.java
+88
-0
ResourceTypeDefEnum.java
...om/yeejoin/amos/fas/common/enums/ResourceTypeDefEnum.java
+14
-2
RegionTreeResponse.java
...oin/amos/fas/core/common/response/RegionTreeResponse.java
+2
-1
CheckErrorBo.java
...n/java/com/yeejoin/amos/fas/business/bo/CheckErrorBo.java
+47
-0
View3dController.java
...eejoin/amos/fas/business/controller/View3dController.java
+19
-7
View3dMapper.java
...om/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
+25
-1
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+14
-14
View3dServiceImpl.java
...oin/amos/fas/business/service/impl/View3dServiceImpl.java
+63
-9
IView3dService.java
...ejoin/amos/fas/business/service/intfc/IView3dService.java
+11
-0
dbTemplate_view3d.xml
...sStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
+180
-22
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/common/enums/CheckStatusEnum.java
0 → 100644
View file @
cf91e8c6
package
com
.
yeejoin
.
amos
.
fas
.
common
.
enums
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author suhg
*/
public
enum
CheckStatusEnum
{
QUALIFIED
(
"合格"
,
"1"
,
""
),
UNQUALIFIED
(
"不合格"
,
"2"
,
"#DF7400"
),
OMISSION
(
"漏检"
,
"3"
,
"#FF0000"
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
String
code
;
/**
* 颜色
*/
private
String
color
;
private
CheckStatusEnum
(
String
name
,
String
code
,
String
color
){
this
.
name
=
name
;
this
.
code
=
code
;
this
.
color
=
color
;
}
public
static
CheckStatusEnum
getEnum
(
String
code
)
{
CheckStatusEnum
checkStatusEnum
=
null
;
for
(
CheckStatusEnum
type:
CheckStatusEnum
.
values
())
{
if
(
type
.
getCode
().
equals
(
code
))
{
checkStatusEnum
=
type
;
break
;
}
}
return
checkStatusEnum
;
}
public
static
List
<
Map
<
String
,
String
>>
getEnumList
()
{
List
<
Map
<
String
,
String
>>
nameList
=
new
ArrayList
<>();
for
(
CheckStatusEnum
c:
CheckStatusEnum
.
values
())
{
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"name"
,
c
.
getName
());
map
.
put
(
"code"
,
c
.
getCode
());
map
.
put
(
"color"
,
c
.
getColor
());
nameList
.
add
(
map
);
}
return
nameList
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getColor
()
{
return
color
;
}
public
void
setColor
(
String
color
)
{
this
.
color
=
color
;
}
}
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/common/enums/ResourceTypeDefEnum.java
View file @
cf91e8c6
...
...
@@ -11,13 +11,13 @@ public enum ResourceTypeDefEnum {
patrol
(
"巡检点"
,
"patrol"
,
"巡检点"
,
"patrol"
),
impEquipment
(
"重点设备"
,
"impEquipment"
,
"重点设备"
,
"impEquipment"
),
monitorEquipment
(
"探测器"
,
"monitorEquipment"
,
"探测器"
,
"monitorEquipment"
),
video
(
"视频设备"
,
"video"
,
"摄像头"
,
"video"
),
hydrant
(
"消火栓"
,
"hydrant"
,
"消防设备"
,
"fireEquipment"
),
pool
(
"消防水池"
,
"pool"
,
"消防设备"
,
"fireEquipment"
),
fireCar
(
"消防车"
,
"fireCar"
,
"消防设备"
,
"fireEquipment"
),
fireEquipment
(
"灭火器材"
,
"fireEquipment"
,
"消防设备"
,
"fireEquipment"
),
fireChamber
(
"消防小室"
,
"fireChamber"
,
"消防设备"
,
"fireEquipment"
),
fireFoamRoom
(
"消防泡沫间"
,
"fireFoamRoom"
,
"消防设备"
,
"fireEquipment"
),
video
(
"视频设备"
,
"video"
,
"摄像头"
,
"video"
);
fireFoamRoom
(
"消防泡沫间"
,
"fireFoamRoom"
,
"消防设备"
,
"fireEquipment"
);
/**
* 名称,描述
...
...
@@ -73,6 +73,18 @@ public enum ResourceTypeDefEnum {
}
return
list
;
}
public
static
Boolean
containsTypeCode
(
String
typeCode
)
{
Boolean
flag
=
false
;
for
(
ResourceTypeDefEnum
e
:
ResourceTypeDefEnum
.
values
())
{
Map
<
String
,
String
>
reso
=
new
HashMap
<>();
if
(
e
.
getTypeCode
().
equals
(
typeCode
))
{
flag
=
true
;
break
;
}
}
return
flag
;
}
public
String
getName
()
{
return
name
;
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/core/common/response/RegionTreeResponse.java
View file @
cf91e8c6
package
com
.
yeejoin
.
amos
.
fas
.
core
.
common
.
response
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
RegionTreeResponse
{
...
...
@@ -12,7 +13,7 @@ public class RegionTreeResponse {
private
String
ue4Rotation
;
private
String
ue4Extent
;
private
Boolean
isBind
;
private
List
<
RegionTreeResponse
>
children
;
private
List
<
RegionTreeResponse
>
children
=
new
ArrayList
<>()
;
private
String
type
;
public
Long
getId
()
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/bo/CheckErrorBo.java
0 → 100644
View file @
cf91e8c6
package
com
.
yeejoin
.
amos
.
fas
.
business
.
bo
;
/**
* @author suhg
*/
public
class
CheckErrorBo
{
private
String
status
;
private
String
changeDate
;
private
Long
id
;
private
String
name
;
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getChangeDate
()
{
return
changeDate
;
}
public
void
setChangeDate
(
String
changeDate
)
{
this
.
changeDate
=
changeDate
;
}
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/View3dController.java
View file @
cf91e8c6
...
...
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum
;
import
io.swagger.annotations.Api
;
import
java.util.List
;
...
...
@@ -40,11 +41,11 @@ public class View3dController extends BaseController {
}
@ApiOperation
(
value
=
"区域详情查询"
,
notes
=
"区域详情查询"
)
@GetMapping
(
value
=
"region/detail/{
i
d}"
)
public
CommonResponse
getRegionDetail
(
@PathVariable
(
"
id"
)
Long
i
d
)
{
@GetMapping
(
value
=
"region/detail/{
riskSourceI
d}"
)
public
CommonResponse
getRegionDetail
(
@PathVariable
(
"
riskSourceId"
)
Long
riskSourceI
d
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionById
(
i
d
,
orgCode
));
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionById
(
riskSourceI
d
,
orgCode
));
}
@ApiOperation
(
value
=
"区域绑定"
,
notes
=
"区域绑定"
)
...
...
@@ -66,10 +67,21 @@ public class View3dController extends BaseController {
@ApiOperation
(
value
=
"按照分类查询点树"
,
notes
=
"按照分类查询点树"
)
@GetMapping
(
value
=
"point/tree/{type}"
)
public
CommonResponse
getPointTreeByType
(
@PathVariable
(
"type"
)
String
type
)
{
public
CommonResponse
getPointTreeByType
(
@PathVariable
(
value
=
"type"
)
String
type
)
{
if
(
ResourceTypeDefEnum
.
containsTypeCode
(
type
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
return
CommonResponseUtil
.
success
(
view3dService
.
getPointTreeByType
(
type
,
orgCode
));
}
return
CommonResponseUtil
.
failure
(
type
+
" 类型不存在"
);
}
@ApiOperation
(
value
=
"按照不同类型查询点详情"
,
notes
=
"按照不同类型查询点详情"
)
@GetMapping
(
value
=
"point/detail"
)
public
CommonResponse
getPointDetail
(
String
type
,
Long
pointId
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
return
CommonResponseUtil
.
success
(
view3dService
.
getPointTreeByType
(
type
,
orgCode
));
return
CommonResponseUtil
.
success
(
view3dService
.
getPointDetailByTypeAndId
(
type
,
pointId
,
orgCode
));
}
@ApiOperation
(
value
=
"今日安全指数查询"
,
notes
=
"按照日期查询安全指数及分类数据"
)
...
...
@@ -80,9 +92,9 @@ public class View3dController extends BaseController {
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexInfoByDate
(
orgCode
,
date
));
}
@ApiOperation
(
value
=
"今日安全指数详情"
,
notes
=
"
risk-风险异常,check-巡检异常,equipProblem-设备故障
"
)
@ApiOperation
(
value
=
"今日安全指数详情"
,
notes
=
"
今日安全指数详情
"
)
@GetMapping
(
value
=
"/safetyIndex/detail/{type}"
)
public
CommonResponse
getSafetyIndexDetail
(
@PathVariable
String
type
){
public
CommonResponse
getSafetyIndexDetail
(
@
ApiParam
(
value
=
"risk-风险异常,check-巡检异常,equip-设备故障"
)
@
PathVariable
String
type
){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexDetail
(
type
,
orgCode
));
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
View file @
cf91e8c6
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.fas.business.bo.CheckErrorBo
;
import
com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -10,8 +12,22 @@ import org.apache.ibatis.annotations.Param;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
public
interface
View3dMapper
extends
BaseMapper
{
/**
* 按类型查询树
* @param type
* @param orgCode
* @return
*/
List
<
RegionTreeResponse
>
getPointTreeByType
(
@Param
(
"type"
)
String
type
,
@Param
(
"orgCode"
)
String
orgCode
);
/**
* 获取点详情
* @param type
* @param pointId
* @param orgCode
* @return
*/
HashMap
<
String
,
Object
>
getPointDetailByTypeAndId
(
@Param
(
"type"
)
String
type
,
@Param
(
"pointId"
)
Long
pointId
,
@Param
(
"orgCode"
)
String
orgCode
);
/**
* 统计风险上升异常数量(风险点)-日期+机构
...
...
@@ -33,4 +49,12 @@ public interface View3dMapper extends BaseMapper{
* @return list
*/
List
<
RiskPointRpnChangeBo
>
getAllErrorRiskPoint
(
Map
<
String
,
Object
>
params
);
/**
* 今日安全指数详情
* @param params orgCode,date
* @return list
*/
List
<
CheckErrorBo
>
getAllErrorPatrolPoint
(
Map
<
String
,
Object
>
params
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
cf91e8c6
...
...
@@ -1754,20 +1754,20 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
//区域列表转树
private
static
List
<
RegionTreeResponse
>
getRiskRegionTree
(
List
<
RegionTreeResponse
>
list
)
{
List
<
RegionTreeResponse
>
treeList
=
new
ArrayList
<
RegionTreeResponse
>();
for
(
RegionTreeResponse
tree
:
list
)
{
if
(
tree
.
getParentId
()
!=
null
&&
tree
.
getParentId
()
==
0
)
{
treeList
.
add
(
tree
);
}
for
(
RegionTreeResponse
treeNode
:
list
)
{
if
(
treeNode
.
getParentId
().
longValue
()
==
tree
.
getId
())
{
if
(
tree
.
getChildren
()
=
=
null
)
{
tree
.
setChildren
(
new
ArrayList
<>()
);
}
tree
.
getChildren
().
add
(
treeNode
);
}
}
}
HashMap
<
Long
,
RegionTreeResponse
>
hashMap
=
new
HashMap
<
>();
list
.
forEach
(
e
->
hashMap
.
put
(
e
.
getId
(),
e
));
List
<
RegionTreeResponse
>
treeList
=
new
ArrayList
<
RegionTreeResponse
>();
list
.
forEach
(
r
->
{
Long
parentId
=
r
.
getParentId
();
if
(
parentId
!=
null
)
{
RegionTreeResponse
pRegion
=
hashMap
.
get
(
parentId
);
if
(
pRegion
!
=
null
)
{
pRegion
.
getChildren
().
add
(
r
);
}
else
{
treeList
.
add
(
r
);
}
}
}
);
return
treeList
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/View3dServiceImpl.java
View file @
cf91e8c6
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
static
org
.
hamcrest
.
CoreMatchers
.
either
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.itextpdf.text.pdf.PdfStructTreeController.returnType
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.fas.business.bo.BindPointBo
;
import
com.yeejoin.amos.fas.business.bo.CheckErrorBo
;
import
com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo
;
import
com.yeejoin.amos.fas.business.dao.mapper.PatrolMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
...
...
@@ -13,6 +22,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
import
com.yeejoin.amos.fas.business.vo.ErrorContentVo
;
import
com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo
;
import
com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo
;
import
com.yeejoin.amos.fas.common.enums.CheckStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.RpnChangeTypeEum
;
import
com.yeejoin.amos.fas.common.enums.StatisticsErrorTypeEum
;
import
com.yeejoin.amos.fas.core.common.request.DateUtil
;
...
...
@@ -178,7 +188,32 @@ public class View3dServiceImpl implements IView3dService {
@Override
public
List
<
RegionTreeResponse
>
getPointTreeByType
(
String
type
,
String
orgCode
)
{
return
view3dMapper
.
getPointTreeByType
(
type
,
orgCode
);
List
<
RegionTreeResponse
>
pointTreeByType
=
view3dMapper
.
getPointTreeByType
(
type
,
orgCode
);
return
convertPointTree
(
pointTreeByType
);
}
//区域列表转树
private
static
List
<
RegionTreeResponse
>
convertPointTree
(
List
<
RegionTreeResponse
>
list
)
{
HashMap
<
Long
,
RegionTreeResponse
>
hashMap
=
new
HashMap
<>();
list
.
forEach
(
e
->
hashMap
.
put
(
e
.
getId
(),
e
));
List
<
RegionTreeResponse
>
treeList
=
new
ArrayList
<
RegionTreeResponse
>();
list
.
forEach
(
r
->
{
Long
parentId
=
r
.
getParentId
();
if
(
parentId
!=
null
)
{
RegionTreeResponse
pRegion
=
hashMap
.
get
(
parentId
);
if
(
pRegion
!=
null
)
{
pRegion
.
getChildren
().
add
(
r
);
}
else
{
treeList
.
add
(
r
);
}
}
});
return
treeList
;
}
@Override
public
HashMap
<
String
,
Object
>
getPointDetailByTypeAndId
(
String
type
,
Long
pointId
,
String
orgCode
)
{
return
view3dMapper
.
getPointDetailByTypeAndId
(
type
,
pointId
,
orgCode
);
}
@Override
...
...
@@ -212,11 +247,12 @@ public class View3dServiceImpl implements IView3dService {
public
List
<
SafetyIndexDetailVo
>
getSafetyIndexDetail
(
String
type
,
String
orgCode
)
{
List
<
SafetyIndexDetailVo
>
resultList
=
Lists
.
newArrayList
();
String
dateStr
=
DateUtil
.
getDateFormat
(
new
Date
(),
DateUtil
.
DATE_DEFAULT_FORMAT
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"orgCode"
,
orgCode
);
// params.put("orgCode","1*2");
params
.
put
(
"date"
,
dateStr
);
if
(
StatisticsErrorTypeEum
.
risk
.
getCode
().
equals
(
type
)){
//1.按照日期+机构,查询出所有风险点
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"orgCode"
,
orgCode
);
params
.
put
(
"date"
,
dateStr
);
List
<
RiskPointRpnChangeBo
>
risks
=
view3dMapper
.
getAllErrorRiskPoint
(
params
);
//2.按照 风险等级id进行分组,加工数据
Map
<
Long
,
List
<
RiskPointRpnChangeBo
>>
map
=
risks
.
stream
().
collect
(
Collectors
.
groupingBy
(
RiskPointRpnChangeBo:
:
getRiskLevelId
));
...
...
@@ -226,19 +262,37 @@ public class View3dServiceImpl implements IView3dService {
SafetyIndexDetailVo
safetyIndexDetailVo
=
new
SafetyIndexDetailVo
();
safetyIndexDetailVo
.
setTypeCode
(
Long
.
toString
(
k
));
safetyIndexDetailVo
.
setTypeName
(
riskLevelMap
.
get
(
k
));
List
<
ErrorContentVo
>
errorContentVoList
=
new
ArrayList
<>();
BeanUtils
.
copyProperties
(
v
,
errorContentVoList
);
safetyIndexDetailVo
.
setContent
(
errorContentVoList
);
safetyIndexDetailVo
.
setContent
(
getErrorContentVos
(
v
));
resultList
.
add
(
safetyIndexDetailVo
);
});
}
else
if
(
StatisticsErrorTypeEum
.
patrol
.
getCode
().
equals
(
type
)){
//1.按照日期+机构,查询出异常巡检
List
<
CheckErrorBo
>
checkErrorBoList
=
view3dMapper
.
getAllErrorPatrolPoint
(
params
);
//2.按照状态进行分组,加工返回数据
Map
<
String
,
List
<
CheckErrorBo
>>
map
=
checkErrorBoList
.
stream
().
collect
(
Collectors
.
groupingBy
(
CheckErrorBo:
:
getStatus
));
map
.
forEach
((
k
,
v
)->{
SafetyIndexDetailVo
safetyIndexDetailVo
=
new
SafetyIndexDetailVo
();
safetyIndexDetailVo
.
setTypeCode
(
k
);
safetyIndexDetailVo
.
setTypeName
(
CheckStatusEnum
.
getEnum
(
k
).
getName
());
safetyIndexDetailVo
.
setContent
(
getErrorContentVos
(
v
));
resultList
.
add
(
safetyIndexDetailVo
);
});
}
else
if
(
StatisticsErrorTypeEum
.
equip
.
getCode
().
equals
(
type
)){
//TODO:待毛颖确认调整完成后继续
}
return
resultList
;
}
private
List
<
ErrorContentVo
>
getErrorContentVos
(
List
<?>
v
)
{
List
<
ErrorContentVo
>
errorContentVoList
=
new
ArrayList
<>();
errorContentVoList
=
v
.
stream
().
map
(
e
->{
ErrorContentVo
errorContentVo
=
new
ErrorContentVo
();
BeanUtils
.
copyProperties
(
e
,
errorContentVo
);
return
errorContentVo
;
}).
collect
(
Collectors
.
toList
());
return
errorContentVoList
;
}
private
Long
getCheckExceptionNum
(
String
orgCode
,
String
date
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"orgCode"
,
orgCode
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IView3dService.java
View file @
cf91e8c6
...
...
@@ -6,6 +6,7 @@ import com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -35,6 +36,15 @@ public interface IView3dService {
*/
List
<
RegionTreeResponse
>
getPointTreeByType
(
String
type
,
String
orgCode
);
/**
* 获取点详情
* @param type 树类型
* @param pointId 点id
* @param orgCode 登录机构
* @return
*/
HashMap
<
String
,
Object
>
getPointDetailByTypeAndId
(
String
type
,
Long
pointId
,
String
orgCode
);
/**
* 今日安全指数
* @param orgCode 登陆机构
...
...
@@ -49,4 +59,5 @@ public interface IView3dService {
* @return list
*/
List
<
SafetyIndexDetailVo
>
getSafetyIndexDetail
(
String
type
,
String
orgCode
);
}
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
View file @
cf91e8c6
...
...
@@ -2,30 +2,172 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.fas.business.dao.mapper.View3dMapper"
>
<select
id=
"getPointTreeByType"
resultType=
"com.yeejoin.amos.fas.core.common.response.RegionTreeResponse"
>
select
R.id,R.name,R.code,R.parent_id,R.ue4_location,R.ue4_rotation,R.ue4_extent,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation)) OR ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind
from f_risk_source R
where 1=1
<if
test=
"type == 'riskSource'"
>
</if>
<if
test=
"type == 'patrol'"
>
</if>
<if
test=
"type == 'impEquipment'"
>
</if>
<if
test=
"type == 'monitorEquipment'"
>
</if>
<if
test=
"type == 'fireEquipment'"
>
<choose>
<when
test=
"type == 'riskSource'"
>
select
R.id,R.name,R.code,R.parent_id,R.ue4_location,R.ue4_rotation,R.ue4_extent,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation)) OR ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
#{type} as type
from f_risk_source R
where 1=1
</when>
<when
test=
"type == 'patrol'"
>
select
R.id,R.parent_id,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation)) OR ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
#{type} as type,
B.name as name,B.point_no,B.ue4_location,B.ue4_rotation
from f_risk_source R
left join p_point B on B.risk_source_id = R.id AND R.is_region='TRUE'
where 1=1
AND B.id is not null
</when>
<when
test=
"type == 'impEquipment'"
>
select
R.id,R.parent_id,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation)) OR ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
#{type} as type,
B.name,B.code,B.ue4_location,B.ue4_rotation
from f_risk_source R
left join f_equipment B on B.risk_source_id = R.id AND R.is_region='TRUE'
where 1=1
AND B.id is not null
</when>
<when
test=
"type == 'monitorEquipment'"
>
select
R.id,R.parent_id,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation)) OR ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
#{type} as type,
B.name,B.code,B.ue4_location,B.ue4_rotation
from f_risk_source R
left join f_fire_equipment B on B.risk_source_id = R.id AND B.equip_classify = 0
where 1=1
AND B.id is not null
</when>
<when
test=
"type == 'video'"
>
select
R.id,R.parent_id,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation)) OR ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
#{type} as type,
B.name,B.code,B.ue4_location,B.ue4_rotation
from f_risk_source R
left join f_fire_equipment B on B.risk_source_id = R.id AND B.equip_classify = 2
where 1=1
AND B.id is not null
</when>
<when
test=
"type == 'fireEquipment'"
>
select
R.id,R.parent_id,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation)) OR ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind,
CASE
WHEN ISNULL(C.id) = 0 then 'fireCar'
WHEN ISNULL(E.id) = 0 then 'fireEquipment'
WHEN ISNULL(S.id) = 0 AND S.type = 1 then 'fireChamber'
WHEN ISNULL(S.id) = 0 AND S.type = 2 then 'fireFoamRoom'
WHEN ISNULL(W.id) = 0 AND W.type = 1 then 'hydrant'
WHEN ISNULL(W.id) = 0 AND W.type = 2 then 'pool'
END as type,
CASE
WHEN ISNULL(C.name) = 0 then C.name
WHEN ISNULL(E.name) = 0 then E.name
WHEN ISNULL(S.name) = 0 then S.name
WHEN ISNULL(W.name) = 0 then W.name
END as name,
CASE
WHEN ISNULL(C.name) = 0 then C.car_num
WHEN ISNULL(E.name) = 0 then E.code
WHEN ISNULL(S.name) = 0 then S.code
WHEN ISNULL(W.name) = 0 then W.code
END as code,
CASE
WHEN ISNULL(C.name) = 0 then C.ue4_location
WHEN ISNULL(E.name) = 0 then E.ue4_location
WHEN ISNULL(S.name) = 0 then S.ue4_location
WHEN ISNULL(W.name) = 0 then W.ue4_location
END as ue4_location,
CASE
WHEN ISNULL(C.name) = 0 then C.ue4_rotation
WHEN ISNULL(E.name) = 0 then E.ue4_rotation
WHEN ISNULL(S.name) = 0 then S.ue4_rotation
WHEN ISNULL(W.name) = 0 then W.ue4_rotation
END as code
from f_risk_source R
left join f_fire_car C on C.risk_source_id = R.id
left join f_fire_equipment E on E.risk_source_id = R.id AND equip_classify = 3
left join f_fire_station S on S.risk_source_id = R.id
left join f_water_resource W on W.risk_source_id = R.id
where 1=1
AND (C.id is not null OR E.id is not null OR S.id is not null OR w.id is not null)
</when>
</choose>
<if
test=
"orgCode != null"
>
AND R.org_code like CONCAT(#{orgCode},'%')
</if>
<if
test=
"type == 'video'"
>
</select>
<select
id=
"getPointDetailByTypeAndId"
resultType=
"java.util.HashMap"
>
<choose>
<when
test=
"type == 'riskSource'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from f_risk_source
where 1=1
</when>
<when
test=
"type == 'patrol'"
>
select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from p_point
where 1=1
</when>
<when
test=
"type == 'impEquipment'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from f_equipment
where 1=1
</when>
<when
test=
"type == 'monitorEquipment'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from f_fire_equipment
where equip_classify = 0
</when>
<when
test=
"type == 'video'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from f_fire_equipment
where equip_classify = 2
</when>
<when
test=
"type == 'hydrant'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from f_water_resource
where type = 1
</when>
<when
test=
"type == 'pool'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from f_water_resource
where type = 2
</when>
<when
test=
"type == 'fireCar'"
>
select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from f_fire_car
where 1=1
</when>
<when
test=
"type == 'fireEquipment'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from f_fire_equipment
where equip_classify = 3
</when>
<when
test=
"type == 'fireChamber'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from f_fire_station
where type = 2
</when>
<when
test=
"type == 'fireFoamRoom'"
>
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from f_fire_station
where type = 1
</when>
</choose>
<if
test=
"pointId != null"
>
AND id = #{pointId}
</if>
<if
test=
"orgCode != null"
>
AND org_code like CONCAT(#{orgCode},'%')
...
...
@@ -81,4 +223,19 @@
and a.org_code = #{orgCode}
and DATE_FORMAT(b.create_date,'%Y-%m-%d') = #{date}
</select>
<select
id=
"getAllErrorPatrolPoint"
resultType=
"com.yeejoin.amos.fas.business.bo.CheckErrorBo"
>
SELECT
a.id,
b.`name`,
a.`is_ok` as status,
a.check_time as changeDate
FROM
p_check a,
p_point b
WHERE
a.`is_ok` IN ('2', '3')
AND a.point_id = b.id
and DATE_FORMAT(a.check_time,'%Y-%m-%d') = #{date}
and a.org_code = #{orgCode}
</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