Commit 91b765a7 authored by maoying's avatar maoying

Merge branch 'dev_upgrade-1225' of 172.16.10.76:station/YeeAmosFireAutoSysRoot…

Merge branch 'dev_upgrade-1225' of 172.16.10.76:station/YeeAmosFireAutoSysRoot into dev_upgrade-1225
parents e6a00bfc d1e2b661
...@@ -281,6 +281,30 @@ public class View3dController extends BaseController { ...@@ -281,6 +281,30 @@ public class View3dController extends BaseController {
} }
@Permission @Permission
@PostMapping(value = "/retrieve3/all",produces = "application/json;charset=UTF-8")
@ApiOperation(value = "右侧边栏搜索", notes = "右侧边栏搜索")
public CommonResponse retrieve3All(
@RequestBody RetrieveParams params
) {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
String token = this.getToken();
String appKey = this.getAppKey();
String product = this.getProduct();
return view3dService.retrieve3All(params.getType(),
params.getRiskSourceId(),
params.getAreaId(),
params.getEquipmentId(),
params.getInputText(),
params.getCurrent(),
params.getPageSize(),
orgCode,
params.getDataLevel(),
token,appKey,product);
}
@Permission
@ApiOperation(value = "等级查询",notes = "等级查询") @ApiOperation(value = "等级查询",notes = "等级查询")
@GetMapping(value = "point/level") @GetMapping(value = "point/level")
public CommonResponse pointLevel(@ApiParam(value = "点类型") @RequestParam String type){ public CommonResponse pointLevel(@ApiParam(value = "点类型") @RequestParam String type){
......
...@@ -26,7 +26,7 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecificVo> ...@@ -26,7 +26,7 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecificVo>
int deletPointBuFmeaId(@Param("fmeaId")Long fmeaId,@Param("importantEquipId")Long importantEquipId); int deletPointBuFmeaId(@Param("fmeaId")Long fmeaId,@Param("importantEquipId")Long importantEquipId);
List<AssoEquipsVo>getAssoEquips(@Param("fmeaId")Long fmeaId, @Param("pageNumber")int pageNumber,@Param("pageSize") int pageSize); List<AssoEquipsVo>getAssoEquips(@Param("fmeaId")Long fmeaId, @Param("indexIds")List<Long> indexIds, @Param("pageNumber")int pageNumber,@Param("pageSize") int pageSize);
/** /**
* 查询设备指标 * 查询设备指标
* @param fmeaId * @param fmeaId
...@@ -83,4 +83,6 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecificVo> ...@@ -83,4 +83,6 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecificVo>
int getOneByQrcode(@Param("qrCode") String qrCode); int getOneByQrcode(@Param("qrCode") String qrCode);
EquipmentSpecific getSpecificById(@Param("id") Long id); EquipmentSpecific getSpecificById(@Param("id") Long id);
Long getIndexByIndexId(@Param("indexId") Long indexId);
} }
...@@ -32,4 +32,6 @@ public interface FmeaEquipmentPointMapper extends BaseMapper { ...@@ -32,4 +32,6 @@ public interface FmeaEquipmentPointMapper extends BaseMapper {
@Param("ids") List<Long> ids); @Param("ids") List<Long> ids);
List<FmeaEquipmentPoint> listFmeaByEquipIndexIdAndEquipId(@Param("specificIndexId") long specificIndexId, @Param("equipId") long equipId); List<FmeaEquipmentPoint> listFmeaByEquipIndexIdAndEquipId(@Param("specificIndexId") long specificIndexId, @Param("equipId") long equipId);
List<FmeaEquipmentPoint> getOneByFmeaId(@Param("fmeaId") Long fmeaId);
} }
package com.yeejoin.amos.fas.business.dao.mapper; 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.CheckErrorBo;
import com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo; import com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo;
import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo; import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo;
import com.yeejoin.amos.fas.business.vo.View3dNodeVo; import com.yeejoin.amos.fas.business.vo.View3dNodeVo;
import com.yeejoin.amos.fas.dao.entity.RiskSource;
import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.fas.core.common.response.Node3DVoResponse; import com.yeejoin.amos.fas.core.common.response.Node3DVoResponse;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse; import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import org.apache.ibatis.annotations.Param;
public interface View3dMapper extends BaseMapper{ import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface View3dMapper extends BaseMapper {
/** /**
* 按类型查询点 * 按类型查询点
*
* @param type * @param type
* @param orgCode * @param orgCode
* @return * @return
*/ */
List<RegionTreeResponse> getPointByType(@Param("type")String type,@Param("orgCode")String orgCode,@Param("channelType") String channelType); List<RegionTreeResponse> getPointByType(@Param("type") String type, @Param("orgCode") String orgCode, @Param("channelType") String channelType);
/** /**
* 获取点详情 * 获取点详情
*
* @param type * @param type
* @param pointId * @param pointId
* @return map * @return map
*/ */
HashMap<String, Object> getPointDetailByTypeAndId(@Param("type")String type, @Param("pointId")Long pointId); HashMap<String, Object> getPointDetailByTypeAndId(@Param("type") String type, @Param("pointId") Long pointId);
/** /**
* 统计风险上升异常数量(风险点)-日期+机构 * 统计风险上升异常数量(风险点)-日期+机构
*
* @param param:{type,orgCode} * @param param:{type,orgCode}
* @return Long * @return Long
*/ */
Long countUpperRiskPoint(Map<String,Object> param); Long countUpperRiskPoint(Map<String, Object> param);
/** /**
* 统计巡检异常数量(不合格、漏检)-日期+机构 * 统计巡检异常数量(不合格、漏检)-日期+机构
*
* @param param{} * @param param{}
* @return Long * @return Long
*/ */
Long countCheckException(Map<String,Object> param); Long countCheckException(Map<String, Object> param);
/** /**
* 统计故障告警数量(不合格、漏检)-日期+机构 * 统计故障告警数量(不合格、漏检)-日期+机构
*
* @param param * @param param
* @return * @return
*/ */
Long countFireException(Map<String,Object> param); Long countFireException(Map<String, Object> param);
/** /**
* 今日安全指数详情 * 今日安全指数详情
*
* @param params orgCode,date * @param params orgCode,date
* @return list * @return list
*/ */
...@@ -61,13 +65,15 @@ public interface View3dMapper extends BaseMapper{ ...@@ -61,13 +65,15 @@ public interface View3dMapper extends BaseMapper{
/** /**
* 一周安全指数趋势查询 * 一周安全指数趋势查询
*
* @param orgCode * @param orgCode
* @return * @return
*/ */
List<HashMap<String, Object>> getSafetyIndexWeek(@Param("orgCode")String orgCode); List<HashMap<String, Object>> getSafetyIndexWeek(@Param("orgCode") String orgCode);
/** /**
* 今日安全指数详情 * 今日安全指数详情
*
* @param params orgCode,date * @param params orgCode,date
* @return list * @return list
*/ */
...@@ -76,6 +82,7 @@ public interface View3dMapper extends BaseMapper{ ...@@ -76,6 +82,7 @@ public interface View3dMapper extends BaseMapper{
/** /**
* 今日安全指数故障告警详情 * 今日安全指数故障告警详情
*
* @param params orgCode,date * @param params orgCode,date
* @return list * @return list
*/ */
...@@ -83,6 +90,7 @@ public interface View3dMapper extends BaseMapper{ ...@@ -83,6 +90,7 @@ public interface View3dMapper extends BaseMapper{
/** /**
* 今日巡检统计接口 * 今日巡检统计接口
*
* @param orgCode * @param orgCode
* @return * @return
*/ */
...@@ -90,6 +98,7 @@ public interface View3dMapper extends BaseMapper{ ...@@ -90,6 +98,7 @@ public interface View3dMapper extends BaseMapper{
/** /**
* 风险异常显示最新5条 * 风险异常显示最新5条
*
* @param orgCode * @param orgCode
* @return * @return
*/ */
...@@ -97,6 +106,7 @@ public interface View3dMapper extends BaseMapper{ ...@@ -97,6 +106,7 @@ public interface View3dMapper extends BaseMapper{
/** /**
* 巡检异常示最新5条 * 巡检异常示最新5条
*
* @param orgCode * @param orgCode
* @return * @return
*/ */
...@@ -104,6 +114,7 @@ public interface View3dMapper extends BaseMapper{ ...@@ -104,6 +114,7 @@ public interface View3dMapper extends BaseMapper{
/** /**
* 火灾告警最新5条 * 火灾告警最新5条
*
* @param orgCode * @param orgCode
* @return * @return
*/ */
...@@ -111,6 +122,7 @@ public interface View3dMapper extends BaseMapper{ ...@@ -111,6 +122,7 @@ public interface View3dMapper extends BaseMapper{
/** /**
* 设备状态最新5条 * 设备状态最新5条
*
* @param orgCode * @param orgCode
* @return * @return
*/ */
...@@ -118,6 +130,7 @@ public interface View3dMapper extends BaseMapper{ ...@@ -118,6 +130,7 @@ public interface View3dMapper extends BaseMapper{
/** /**
* 按照类型查询点 * 按照类型查询点
*
* @param params {orgCode,type} * @param params {orgCode,type}
* @return 列表 * @return 列表
*/ */
...@@ -130,27 +143,34 @@ public interface View3dMapper extends BaseMapper{ ...@@ -130,27 +143,34 @@ public interface View3dMapper extends BaseMapper{
/** /**
* 重点模式设备 * 重点模式设备
*
* @return * @return
*/ */
List<View3dNodeVo> getImpEqu3dPoints(String orgCode); List<View3dNodeVo> getImpEqu3dPoints(String orgCode);
/** /**
* 异常点 * 异常点
*
* @param type * @param type
* @param orgCode * @param orgCode
* @param riskSourceId 区域id * @param riskSourceId 区域id
* @return * @return
*/ */
List<View3dNodeVo> initViewErrorNode(String type,Long riskSourceId, String orgCode); List<View3dNodeVo> initViewErrorNode(String type, Long riskSourceId, String orgCode);
List<Node3DVoResponse> findViewDataByType(@Param("type") String type, @Param("riskSourceId") Long riskSourceId, @Param("orgCode") String orgCode, @Param("abnormalStatus") Boolean abnormalStatus);
Long retrieveAllCount(String type, Long riskSourceId, String inputText, String orgCode, String dataLevel, String protectObjName);
List<Node3DVoResponse> findViewDataByType(@Param("type")String type,@Param("riskSourceId")Long riskSourceId,@Param("orgCode")String orgCode,@Param("abnormalStatus")Boolean abnormalStatus); List<HashMap<String, Object>> retrieveAll(String type, Long riskSourceId, String inputText, long start, int length, String orgCode, String dataLevel, String protectObjName);
Long retrieveAllCount(String type, Long riskSourceId, String inputText,String orgCode,String dataLevel,String protectObjName); Long retrieve3AllCount(String type, Long riskSourceId, Long areaId, Long equipmentId, String inputText, String orgCode, String dataLevel);
List<HashMap<String, Object>> retrieveAll(String type, Long riskSourceId, String inputText, long start, int length,String orgCode,String dataLevel,String protectObjName); List<HashMap<String, Object>> retrieve3All(String type, Long riskSourceId, Long areaId, Long equipmentId, String inputText, long start, int length, String orgCode, String dataLevel);
/** /**
* 查询区域下点 * 查询区域下点
*
* @param ids 区域ids * @param ids 区域ids
* @return list * @return list
*/ */
......
...@@ -9,6 +9,8 @@ public class RetrieveParams { ...@@ -9,6 +9,8 @@ public class RetrieveParams {
private String dataLevel; private String dataLevel;
private String protectObjName; private String protectObjName;
private String riskSourceId; private String riskSourceId;
private Long areaId;
private Long equipmentId;
public String getRiskSourceId() { public String getRiskSourceId() {
return riskSourceId; return riskSourceId;
...@@ -55,6 +57,19 @@ public class RetrieveParams { ...@@ -55,6 +57,19 @@ public class RetrieveParams {
this.protectObjName = protectObjName; this.protectObjName = protectObjName;
} }
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public Long getEquipmentId() {
return equipmentId;
}
public void setEquipmentId(Long equipmentId) {
this.equipmentId = equipmentId;
}
} }
package com.yeejoin.amos.fas.business.service.impl; package com.yeejoin.amos.fas.business.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificMapper; import com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaEquipmentPointMapper;
import com.yeejoin.amos.fas.business.param.FmeaBindParam; import com.yeejoin.amos.fas.business.param.FmeaBindParam;
import com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificService; import com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificService;
import com.yeejoin.amos.fas.business.service.intfc.IEquipmentCategoryService; import com.yeejoin.amos.fas.business.service.intfc.IEquipmentCategoryService;
import com.yeejoin.amos.fas.business.service.intfc.IFmeaService;
import com.yeejoin.amos.fas.business.util.TreeUtil; import com.yeejoin.amos.fas.business.util.TreeUtil;
import com.yeejoin.amos.fas.business.vo.AssoEquipsVo; import com.yeejoin.amos.fas.business.vo.AssoEquipsVo;
import com.yeejoin.amos.fas.business.vo.EquipmentPointVo; import com.yeejoin.amos.fas.business.vo.EquipmentPointVo;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificVo; import com.yeejoin.amos.fas.business.vo.EquipmentSpecificVo;
import com.yeejoin.amos.fas.dao.entity.EquipmentCategory; import com.yeejoin.amos.fas.dao.entity.EquipmentCategory;
import com.yeejoin.amos.fas.dao.entity.EquipmentSpecific;
import com.yeejoin.amos.fas.dao.entity.Fmea;
import com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint; import com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -29,6 +35,8 @@ public class EquipmentSpecificServiceImpl implements EquipmentSpecificService { ...@@ -29,6 +35,8 @@ public class EquipmentSpecificServiceImpl implements EquipmentSpecificService {
EquipmentSpecificMapper equipmentSpecificMapper; EquipmentSpecificMapper equipmentSpecificMapper;
@Autowired @Autowired
IEquipmentCategoryService categoryService; IEquipmentCategoryService categoryService;
@Autowired
FmeaEquipmentPointMapper equipmentPointMapper;
@Override @Override
public List<FmeaEquipmentPoint> upDateEquimentPoint(FmeaBindParam fmeaBindParam) { public List<FmeaEquipmentPoint> upDateEquimentPoint(FmeaBindParam fmeaBindParam) {
...@@ -53,7 +61,15 @@ public class EquipmentSpecificServiceImpl implements EquipmentSpecificService { ...@@ -53,7 +61,15 @@ public class EquipmentSpecificServiceImpl implements EquipmentSpecificService {
public Map<String, Object> getAssoEquips(Long fmeaId, int pageNumber, int pageSize) { public Map<String, Object> getAssoEquips(Long fmeaId, int pageNumber, int pageSize) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
pageNumber = pageNumber*pageSize; pageNumber = pageNumber*pageSize;
List<AssoEquipsVo> assoEquips = equipmentSpecificMapper.getAssoEquips(fmeaId, pageNumber, pageSize); List<FmeaEquipmentPoint> fmeas = equipmentPointMapper.getOneByFmeaId(fmeaId);
List<Long> indexIds = new ArrayList<>();
if (0 < fmeas.size()) {
for (FmeaEquipmentPoint point : fmeas) {
Long indexId = equipmentSpecificMapper.getIndexByIndexId(point.getEquipmentPointId());
indexIds.add(indexId);
}
}
List<AssoEquipsVo> assoEquips = equipmentSpecificMapper.getAssoEquips(fmeaId, indexIds, pageNumber, pageSize);
map.put("content",assoEquips); map.put("content",assoEquips);
return map; return map;
} }
......
...@@ -73,10 +73,9 @@ public class View3dServiceImpl implements IView3dService { ...@@ -73,10 +73,9 @@ public class View3dServiceImpl implements IView3dService {
private IRiskSourceDao iRiskSourceDao; private IRiskSourceDao iRiskSourceDao;
@Autowired @Autowired
private IEquipmentDao iEquipmentDao; private IEquipmentDao iEquipmentDao;
// @Autowired // @Autowired
// private IWaterResourceDao iWaterResourceDao; // private IWaterResourceDao iWaterResourceDao;
@Autowired @Autowired
private PatrolMapper patrolMapper; private PatrolMapper patrolMapper;
...@@ -101,17 +100,17 @@ public class View3dServiceImpl implements IView3dService { ...@@ -101,17 +100,17 @@ public class View3dServiceImpl implements IView3dService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public CommonResponse setPoint3dPosition(List<BindPointBo> pointBoList) { public CommonResponse setPoint3dPosition(List<BindPointBo> pointBoList) {
if (CollectionUtils.isEmpty(pointBoList)){ if (CollectionUtils.isEmpty(pointBoList)) {
return CommonResponseUtil.failure("点不能为空"); return CommonResponseUtil.failure("点不能为空");
} }
pointBoList.forEach(pointBo ->{ pointBoList.forEach(pointBo -> {
this.savePointPositionByType(pointBo.getPointType(),pointBo); this.savePointPositionByType(pointBo.getPointType(), pointBo);
}); });
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
public void savePointPositionByType(String pointType,BindPointBo pointBo){ public void savePointPositionByType(String pointType, BindPointBo pointBo) {
switch (pointType){ switch (pointType) {
case "riskSource": case "riskSource":
this.updateRiskSourcePosition(pointBo); this.updateRiskSourcePosition(pointBo);
break; break;
...@@ -199,16 +198,16 @@ public class View3dServiceImpl implements IView3dService { ...@@ -199,16 +198,16 @@ public class View3dServiceImpl implements IView3dService {
} }
public void updateEquipmentPosition(BindPointBo pointBo) { public void updateEquipmentPosition(BindPointBo pointBo) {
Optional<Equipment> data=iEquipmentDao.findById(pointBo.getPointId()); Optional<Equipment> data = iEquipmentDao.findById(pointBo.getPointId());
Equipment equipment = null; Equipment equipment = null;
if(data.isPresent()){ if (data.isPresent()) {
equipment = data.get(); equipment = data.get();
String ue4Location = pointBo.getUe4Location(); String ue4Location = pointBo.getUe4Location();
String ue4Rotation = pointBo.getUe4Rotation(); String ue4Rotation = pointBo.getUe4Rotation();
String position3d = pointBo.getPosition3d(); String position3d = pointBo.getPosition3d();
if(ue4Location != null) equipment.setUe4Location(ue4Location); if (ue4Location != null) equipment.setUe4Location(ue4Location);
if(ue4Rotation != null) equipment.setUe4Rotation(ue4Rotation); if (ue4Rotation != null) equipment.setUe4Rotation(ue4Rotation);
if(position3d != null) equipment.setPosition3d(position3d); if (position3d != null) equipment.setPosition3d(position3d);
iEquipmentDao.save(equipment); iEquipmentDao.save(equipment);
} }
} }
...@@ -219,14 +218,14 @@ public class View3dServiceImpl implements IView3dService { ...@@ -219,14 +218,14 @@ public class View3dServiceImpl implements IView3dService {
public void updateRiskSourcePosition(BindPointBo pointBo) { public void updateRiskSourcePosition(BindPointBo pointBo) {
Optional<RiskSource> data = iRiskSourceDao.findById(pointBo.getPointId()); Optional<RiskSource> data = iRiskSourceDao.findById(pointBo.getPointId());
if(data.isPresent()){ if (data.isPresent()) {
RiskSource riskSource = data.get(); RiskSource riskSource = data.get();
String ue4Location = pointBo.getUe4Location(); String ue4Location = pointBo.getUe4Location();
String ue4Rotation = pointBo.getUe4Rotation(); String ue4Rotation = pointBo.getUe4Rotation();
String position3d = pointBo.getPosition3d(); String position3d = pointBo.getPosition3d();
if(ue4Location != null) riskSource.setUe4Location(ue4Location); if (ue4Location != null) riskSource.setUe4Location(ue4Location);
if(ue4Rotation != null) riskSource.setUe4Rotation(pointBo.getUe4Rotation()); if (ue4Rotation != null) riskSource.setUe4Rotation(pointBo.getUe4Rotation());
if(position3d != null) riskSource.setPosition3d(position3d); if (position3d != null) riskSource.setPosition3d(position3d);
iRiskSourceDao.save(riskSource); iRiskSourceDao.save(riskSource);
} }
} }
...@@ -237,11 +236,11 @@ public class View3dServiceImpl implements IView3dService { ...@@ -237,11 +236,11 @@ public class View3dServiceImpl implements IView3dService {
} }
@Override @Override
public List<RegionTreeResponse> getPointTreeByType(String type,String orgCode,String channelType) { public List<RegionTreeResponse> getPointTreeByType(String type, String orgCode, String channelType) {
//查询点 //查询点
List<RegionTreeResponse> regionList = riskSourceMapper.getRegionList(channelType, orgCode); List<RegionTreeResponse> regionList = riskSourceMapper.getRegionList(channelType, orgCode);
//查询区域 //查询区域
List<RegionTreeResponse> pointByType = view3dMapper.getPointByType(type,orgCode,channelType); List<RegionTreeResponse> pointByType = view3dMapper.getPointByType(type, orgCode, channelType);
pointByType.addAll(regionList); pointByType.addAll(regionList);
return convertPointTree(pointByType); return convertPointTree(pointByType);
} }
...@@ -249,15 +248,15 @@ public class View3dServiceImpl implements IView3dService { ...@@ -249,15 +248,15 @@ public class View3dServiceImpl implements IView3dService {
//区域列表转树 //区域列表转树
private static List<RegionTreeResponse> convertPointTree(List<RegionTreeResponse> list) { private static List<RegionTreeResponse> convertPointTree(List<RegionTreeResponse> list) {
HashMap<Long, RegionTreeResponse> hashMap = new HashMap<>(); HashMap<Long, RegionTreeResponse> hashMap = new HashMap<>();
list.forEach( e -> hashMap.put(e.getId(), e)); list.forEach(e -> hashMap.put(e.getId(), e));
List<RegionTreeResponse> treeList = new ArrayList<RegionTreeResponse>(); List<RegionTreeResponse> treeList = new ArrayList<RegionTreeResponse>();
list.forEach( r -> { list.forEach(r -> {
Long parentId = r.getParentId(); Long parentId = r.getParentId();
if(parentId != null) { if (parentId != null) {
RegionTreeResponse pRegion = hashMap.get(parentId); RegionTreeResponse pRegion = hashMap.get(parentId);
if(pRegion != null) { if (pRegion != null) {
pRegion.getChildren().add(r); pRegion.getChildren().add(r);
}else { } else {
treeList.add(r); treeList.add(r);
} }
} }
...@@ -267,13 +266,13 @@ public class View3dServiceImpl implements IView3dService { ...@@ -267,13 +266,13 @@ public class View3dServiceImpl implements IView3dService {
@Override @Override
public HashMap<String, Object> getPointDetailByTypeAndId(String type, Long pointId) { public HashMap<String, Object> getPointDetailByTypeAndId(String type, Long pointId) {
HashMap<String, Object> detail = view3dMapper.getPointDetailByTypeAndId(type,pointId); HashMap<String, Object> detail = view3dMapper.getPointDetailByTypeAndId(type, pointId);
if(detail != null) { if (detail != null) {
String ue4Location = (String)detail.get("ue4Location"); String ue4Location = (String) detail.get("ue4Location");
detail.put("ue4Location", ue4Location == null ? new JSONArray() : JSON.parseArray(ue4Location)); detail.put("ue4Location", ue4Location == null ? new JSONArray() : JSON.parseArray(ue4Location));
String ue4Rotation = (String)detail.get("ue4Rotation"); String ue4Rotation = (String) detail.get("ue4Rotation");
detail.put("ue4Rotation", ue4Rotation == null ? new JSONArray() : JSON.parseArray(ue4Rotation)); detail.put("ue4Rotation", ue4Rotation == null ? new JSONArray() : JSON.parseArray(ue4Rotation));
String ue4Extent = (String)detail.get("ue4Extent"); String ue4Extent = (String) detail.get("ue4Extent");
detail.put("ue4Extent", ue4Location == null ? new JSONArray() : JSON.parseArray(ue4Extent)); detail.put("ue4Extent", ue4Location == null ? new JSONArray() : JSON.parseArray(ue4Extent));
detail.put("position3d", this.strPositionToArry(detail.get("position3d"))); detail.put("position3d", this.strPositionToArry(detail.get("position3d")));
} }
...@@ -281,13 +280,13 @@ public class View3dServiceImpl implements IView3dService { ...@@ -281,13 +280,13 @@ public class View3dServiceImpl implements IView3dService {
} }
@Override @Override
public TodaySafetyIndexVo getSafetyIndexInfoByDate(String orgCode,String date) { public TodaySafetyIndexVo getSafetyIndexInfoByDate(String orgCode, String date) {
if(!StringUtil.isNotEmpty(date)){ if (!StringUtil.isNotEmpty(date)) {
date = DateUtil.getDateFormat(new Date(),DateUtil.DATE_DEFAULT_FORMAT); date = DateUtil.getDateFormat(new Date(), DateUtil.DATE_DEFAULT_FORMAT);
} }
Optional<RiskSource> optional = iRiskSourceDao.findByOrgCodeAndParentId(orgCode,0L); Optional<RiskSource> optional = iRiskSourceDao.findByOrgCodeAndParentId(orgCode, 0L);
TodaySafetyIndexVo vo = new TodaySafetyIndexVo(); TodaySafetyIndexVo vo = new TodaySafetyIndexVo();
if(optional.isPresent()){ //1.按照等级进行转换rpn为分数-机构 if (optional.isPresent()) { //1.按照等级进行转换rpn为分数-机构
RiskSource riskSource = optional.get(); RiskSource riskSource = optional.get();
double safetyIndex = this.changeRpnToSafetyIndex(riskSource.getRpn()); double safetyIndex = this.changeRpnToSafetyIndex(riskSource.getRpn());
vo.setSafetyIndex(safetyIndex); vo.setSafetyIndex(safetyIndex);
...@@ -295,14 +294,14 @@ public class View3dServiceImpl implements IView3dService { ...@@ -295,14 +294,14 @@ public class View3dServiceImpl implements IView3dService {
Long upperNum = this.getRiskUpperNum(orgCode, date); Long upperNum = this.getRiskUpperNum(orgCode, date);
vo.setRiskExceptionNum(upperNum); vo.setRiskExceptionNum(upperNum);
//3.统计巡检异常数量(不合格、漏检)-日期+机构 //3.统计巡检异常数量(不合格、漏检)-日期+机构
Long checkExceptionNum = this.getCheckExceptionNum(orgCode,date); Long checkExceptionNum = this.getCheckExceptionNum(orgCode, date);
vo.setCheckExceptionNum(checkExceptionNum); vo.setCheckExceptionNum(checkExceptionNum);
//4.统计故障数量-日期+机构 //4.统计故障数量-日期+机构
vo.setFireExceptionNum(getFireExceptionNum(orgCode,date)); vo.setFireExceptionNum(getFireExceptionNum(orgCode, date));
//5.安全值提示 //5.安全值提示
if (riskSource.getRiskLevelId() != null){ if (riskSource.getRiskLevelId() != null) {
Optional<RiskLevel> opt = iRiskLevelDao.findById(riskSource.getRiskLevelId()); Optional<RiskLevel> opt = iRiskLevelDao.findById(riskSource.getRiskLevelId());
if(opt.isPresent()){ if (opt.isPresent()) {
Integer level = opt.get().getLevel(); Integer level = opt.get().getLevel();
String tips = RiskSourceLevelEum.getTipsByLevel(String.valueOf(level)); String tips = RiskSourceLevelEum.getTipsByLevel(String.valueOf(level));
vo.setSafetyTips(tips); vo.setSafetyTips(tips);
...@@ -310,51 +309,50 @@ public class View3dServiceImpl implements IView3dService { ...@@ -310,51 +309,50 @@ public class View3dServiceImpl implements IView3dService {
} }
} }
} else { } else {
throw new YeeException("机构:"+orgCode+" 不存在"); throw new YeeException("机构:" + orgCode + " 不存在");
} }
return vo; return vo;
} }
@Override @Override
public List<SafetyIndexDetailVo> getSafetyIndexDetail(String type,String orgCode) { public List<SafetyIndexDetailVo> getSafetyIndexDetail(String type, String orgCode) {
List<SafetyIndexDetailVo> resultList = Lists.newArrayList(); List<SafetyIndexDetailVo> resultList = Lists.newArrayList();
String dateStr = DateUtil.getDateFormat(new Date(),DateUtil.DATE_DEFAULT_FORMAT); String dateStr = DateUtil.getDateFormat(new Date(), DateUtil.DATE_DEFAULT_FORMAT);
Map<String,Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("orgCode",orgCode); params.put("orgCode", orgCode);
params.put("date",dateStr); params.put("date", dateStr);
if(StatisticsErrorTypeEum.risk.getCode().equals(type)){ if (StatisticsErrorTypeEum.risk.getCode().equals(type)) {
//1.按照日期+机构,查询出所有风险点 //1.按照日期+机构,查询出所有风险点
List<RiskPointRpnChangeBo> risks = view3dMapper.getAllErrorRiskPoint(params); List<RiskPointRpnChangeBo> risks = view3dMapper.getAllErrorRiskPoint(params);
//2.按照 风险等级id进行分组,加工数据 //2.按照 风险等级id进行分组,加工数据
Map<Long,List<RiskPointRpnChangeBo>> map = risks.stream().collect(Collectors.groupingBy(RiskPointRpnChangeBo::getRiskLevelId)); Map<Long, List<RiskPointRpnChangeBo>> map = risks.stream().collect(Collectors.groupingBy(RiskPointRpnChangeBo::getRiskLevelId));
List<RiskLevel> riskLevelList = iRiskLevelDao.findAll(); List<RiskLevel> riskLevelList = iRiskLevelDao.findAll();
Map<Long,RiskLevel> riskLevelMap = riskLevelList.stream().collect(Collectors.toMap(RiskLevel::getId, Function.identity())); Map<Long, RiskLevel> riskLevelMap = riskLevelList.stream().collect(Collectors.toMap(RiskLevel::getId, Function.identity()));
map.forEach((k,v)->{ map.forEach((k, v) -> {
SafetyIndexDetailVo safetyIndexDetailVo = new SafetyIndexDetailVo(); SafetyIndexDetailVo safetyIndexDetailVo = new SafetyIndexDetailVo();
safetyIndexDetailVo.setTypeCode(String.valueOf(riskLevelMap.get(k).getLevel())); safetyIndexDetailVo.setTypeCode(String.valueOf(riskLevelMap.get(k).getLevel()));
safetyIndexDetailVo.setTypeName(riskLevelMap.get(k).getName()); safetyIndexDetailVo.setTypeName(riskLevelMap.get(k).getName());
safetyIndexDetailVo.setContent(getErrorContentVos(v)); safetyIndexDetailVo.setContent(getErrorContentVos(v));
resultList.add(safetyIndexDetailVo); resultList.add(safetyIndexDetailVo);
}); });
} else if(StatisticsErrorTypeEum.check.getCode().equals(type)){ } else if (StatisticsErrorTypeEum.check.getCode().equals(type)) {
//1.按照日期+机构,查询出异常巡检 //1.按照日期+机构,查询出异常巡检
List<CheckErrorBo> checkErrorBoList = view3dMapper.getAllErrorPatrolPoint(params); List<CheckErrorBo> checkErrorBoList = view3dMapper.getAllErrorPatrolPoint(params);
//2.按照状态进行分组,加工返回数据 //2.按照状态进行分组,加工返回数据
Map<String,List<CheckErrorBo>> map = checkErrorBoList.stream().collect(Collectors.groupingBy(CheckErrorBo::getStatus)); Map<String, List<CheckErrorBo>> map = checkErrorBoList.stream().collect(Collectors.groupingBy(CheckErrorBo::getStatus));
map.forEach((k,v)->{ map.forEach((k, v) -> {
SafetyIndexDetailVo safetyIndexDetailVo = new SafetyIndexDetailVo(); SafetyIndexDetailVo safetyIndexDetailVo = new SafetyIndexDetailVo();
safetyIndexDetailVo.setTypeCode(k); safetyIndexDetailVo.setTypeCode(k);
safetyIndexDetailVo.setTypeName(CheckStatusEnum.getEnum(k).getName()); safetyIndexDetailVo.setTypeName(CheckStatusEnum.getEnum(k).getName());
safetyIndexDetailVo.setContent(getErrorContentVos(v)); safetyIndexDetailVo.setContent(getErrorContentVos(v));
resultList.add(safetyIndexDetailVo); resultList.add(safetyIndexDetailVo);
}); });
} else if(StatisticsErrorTypeEum.equip.getCode().equals(type)){ } else if (StatisticsErrorTypeEum.equip.getCode().equals(type)) {
//TODO:待毛颖确认调整完成后继续 //TODO:待毛颖确认调整完成后继续
List<CheckErrorBo> checkErrorBoList = view3dMapper.getAllFaultAlarm(params); List<CheckErrorBo> checkErrorBoList = view3dMapper.getAllFaultAlarm(params);
Map<String,List<CheckErrorBo>> map = checkErrorBoList.stream().collect(Collectors.groupingBy(CheckErrorBo::getStatus)); Map<String, List<CheckErrorBo>> map = checkErrorBoList.stream().collect(Collectors.groupingBy(CheckErrorBo::getStatus));
map.forEach((k,v)->{ map.forEach((k, v) -> {
SafetyIndexDetailVo safetyIndexDetailVo = new SafetyIndexDetailVo(); SafetyIndexDetailVo safetyIndexDetailVo = new SafetyIndexDetailVo();
safetyIndexDetailVo.setTypeCode(k); safetyIndexDetailVo.setTypeCode(k);
safetyIndexDetailVo.setTypeName(k); safetyIndexDetailVo.setTypeName(k);
...@@ -367,23 +365,23 @@ public class View3dServiceImpl implements IView3dService { ...@@ -367,23 +365,23 @@ public class View3dServiceImpl implements IView3dService {
private List<ErrorContentVo> getErrorContentVos(List<?> v) { private List<ErrorContentVo> getErrorContentVos(List<?> v) {
List<ErrorContentVo> errorContentVoList = new ArrayList<>(); List<ErrorContentVo> errorContentVoList = new ArrayList<>();
errorContentVoList = v.stream().map(e->{ errorContentVoList = v.stream().map(e -> {
ErrorContentVo errorContentVo = new ErrorContentVo(); ErrorContentVo errorContentVo = new ErrorContentVo();
BeanUtils.copyProperties(e,errorContentVo); BeanUtils.copyProperties(e, errorContentVo);
return errorContentVo; return errorContentVo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return errorContentVoList; return errorContentVoList;
} }
private Long getCheckExceptionNum(String orgCode, String date) { private Long getCheckExceptionNum(String orgCode, String date) {
Map<String,Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("orgCode", orgCode); params.put("orgCode", orgCode);
params.put("date", date); params.put("date", date);
return view3dMapper.countCheckException(params); return view3dMapper.countCheckException(params);
} }
private Long getRiskUpperNum(String orgCode, String date) { private Long getRiskUpperNum(String orgCode, String date) {
Map<String,Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("type", RpnChangeTypeEum.upper.getValue()); param.put("type", RpnChangeTypeEum.upper.getValue());
param.put("orgCode", orgCode); param.put("orgCode", orgCode);
param.put("date", date); param.put("date", date);
...@@ -391,7 +389,7 @@ public class View3dServiceImpl implements IView3dService { ...@@ -391,7 +389,7 @@ public class View3dServiceImpl implements IView3dService {
} }
private Long getFireExceptionNum(String orgCode, String date) { private Long getFireExceptionNum(String orgCode, String date) {
Map<String,Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("orgCode", orgCode); params.put("orgCode", orgCode);
params.put("date", date); params.put("date", date);
return view3dMapper.countFireException(params); return view3dMapper.countFireException(params);
...@@ -400,7 +398,7 @@ public class View3dServiceImpl implements IView3dService { ...@@ -400,7 +398,7 @@ public class View3dServiceImpl implements IView3dService {
private double changeRpnToSafetyIndex(BigDecimal rpn) { private double changeRpnToSafetyIndex(BigDecimal rpn) {
BigDecimal rpnBig = rpn == null ? new BigDecimal("0") : rpn; BigDecimal rpnBig = rpn == null ? new BigDecimal("0") : rpn;
//计算规则:除10 减100 求绝对值,结果保留1位小数 //计算规则:除10 减100 求绝对值,结果保留1位小数
return rpnBig.divide(new BigDecimal("10")).subtract(new BigDecimal("100")).abs().setScale(1,BigDecimal.ROUND_HALF_UP).doubleValue(); return rpnBig.divide(new BigDecimal("10")).subtract(new BigDecimal("100")).abs().setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
} }
@Override @Override
...@@ -410,17 +408,17 @@ public class View3dServiceImpl implements IView3dService { ...@@ -410,17 +408,17 @@ public class View3dServiceImpl implements IView3dService {
@Override @Override
public Map<String, Object> getSystemOnlineDate(String orgCode) { public Map<String, Object> getSystemOnlineDate(String orgCode) {
Date beginDate = DateUtil.formatDate(onLineDate,DateUtil.DATE_DEFAULT_FORMAT); Date beginDate = DateUtil.formatDate(onLineDate, DateUtil.DATE_DEFAULT_FORMAT);
Date now = DateUtil.getNow(); Date now = DateUtil.getNow();
return DateUtil.dayComparePrecise(beginDate,now); return DateUtil.dayComparePrecise(beginDate, now);
} }
@Override @Override
public List<ExceptionRegionVo> getExceptionRegion(String orgCode) { public List<ExceptionRegionVo> getExceptionRegion(String orgCode) {
Optional<RiskSource> optional = iRiskSourceDao.findByOrgCodeAndParentId(orgCode,0L); Optional<RiskSource> optional = iRiskSourceDao.findByOrgCodeAndParentId(orgCode, 0L);
List<ExceptionRegionVo> exceptionList = new ArrayList<>(); List<ExceptionRegionVo> exceptionList = new ArrayList<>();
if (optional.isPresent()) { if (optional.isPresent()) {
List<RiskSource> regionList = iRiskSourceDao.findByParentIdAndIsRegion(optional.get().getId(),RiskSourceRegionEum.TRUE.getCode()); List<RiskSource> regionList = iRiskSourceDao.findByParentIdAndIsRegion(optional.get().getId(), RiskSourceRegionEum.TRUE.getCode());
exceptionList = regionList.stream().filter(riskSource -> { exceptionList = regionList.stream().filter(riskSource -> {
BigDecimal rpn = riskSource.getRpn() == null ? new BigDecimal("0") : riskSource.getRpn(); BigDecimal rpn = riskSource.getRpn() == null ? new BigDecimal("0") : riskSource.getRpn();
BigDecimal rpni = riskSource.getRpni() == null ? new BigDecimal("0") : riskSource.getRpni(); BigDecimal rpni = riskSource.getRpni() == null ? new BigDecimal("0") : riskSource.getRpni();
...@@ -440,23 +438,23 @@ public class View3dServiceImpl implements IView3dService { ...@@ -440,23 +438,23 @@ public class View3dServiceImpl implements IView3dService {
return exceptionList; return exceptionList;
} }
private JSONArray getInitJSONArray(String str){ private JSONArray getInitJSONArray(String str) {
if(StringUtil.isNotEmpty(str)){ if (StringUtil.isNotEmpty(str)) {
return JSON.parseArray(str); return JSON.parseArray(str);
} else { } else {
return new JSONArray(); return new JSONArray();
} }
} }
private JSONObject changeStringToJson(String str){ private JSONObject changeStringToJson(String str) {
if(StringUtil.isNotEmpty(str)){ if (StringUtil.isNotEmpty(str)) {
return JSON.parseObject(str); return JSON.parseObject(str);
}else { } else {
return new JSONObject(); return new JSONObject();
} }
} }
private Boolean isBreakDown(Long id){ private Boolean isBreakDown(Long id) {
return true; return true;
} }
...@@ -465,13 +463,13 @@ public class View3dServiceImpl implements IView3dService { ...@@ -465,13 +463,13 @@ public class View3dServiceImpl implements IView3dService {
List<HashMap<String, Object>> statisticsCheck = view3dMapper.getStatisticsCheck(orgCode); List<HashMap<String, Object>> statisticsCheck = view3dMapper.getStatisticsCheck(orgCode);
List<Map<String, Object>> stateList = PlanTaskDetailStatusEnum.getEnumList(); List<Map<String, Object>> stateList = PlanTaskDetailStatusEnum.getEnumList();
stateList.forEach(s -> { stateList.forEach(s -> {
if(statisticsCheck !=null ) { if (statisticsCheck != null) {
Long value = 0L; Long value = 0L;
for(HashMap<String, Object> sc:statisticsCheck) { for (HashMap<String, Object> sc : statisticsCheck) {
String typeString = sc.get("type").toString(); String typeString = sc.get("type").toString();
String enumType = s.get("type").toString(); String enumType = s.get("type").toString();
if(typeString.equals(enumType)) { if (typeString.equals(enumType)) {
value = (Long)sc.get("value"); value = (Long) sc.get("value");
break; break;
} }
} }
...@@ -482,7 +480,7 @@ public class View3dServiceImpl implements IView3dService { ...@@ -482,7 +480,7 @@ public class View3dServiceImpl implements IView3dService {
} }
@Override @Override
public List<SafetyExecuteBo> getSafetyExecuteListTop5(String type,String orgCode) { public List<SafetyExecuteBo> getSafetyExecuteListTop5(String type, String orgCode) {
StatisticsErrorTypeEum.risk.getCode(); StatisticsErrorTypeEum.risk.getCode();
switch (type) { switch (type) {
case "risk"://风险异常 case "risk"://风险异常
...@@ -492,17 +490,17 @@ public class View3dServiceImpl implements IView3dService { ...@@ -492,17 +490,17 @@ public class View3dServiceImpl implements IView3dService {
case "fire"://火灾告警 case "fire"://火灾告警
return view3dMapper.getFireAlarmTop5(orgCode); return view3dMapper.getFireAlarmTop5(orgCode);
default: default:
throw new YeeException("不支持的类型 -->"+ type); throw new YeeException("不支持的类型 -->" + type);
} }
} }
@Override @Override
public CommonResponse getStatisticsDuty(String appKey,String product,String token, String orgCode) { public CommonResponse getStatisticsDuty(String appKey, String product, String token, String orgCode) {
Date curDate = new Date(); Date curDate = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("dutyDate", curDate); param.put("dutyDate", curDate);
return dutyModeServer.dutyListByDay(appKey,product,token,orgCode,param.toJSONString()); return dutyModeServer.dutyListByDay(appKey, product, token, orgCode, param.toJSONString());
} }
@Override @Override
...@@ -511,44 +509,44 @@ public class View3dServiceImpl implements IView3dService { ...@@ -511,44 +509,44 @@ public class View3dServiceImpl implements IView3dService {
} }
@Override @Override
public List<View3dNodeVo> initViewErrorNode(String type,Long riskSourceId, String orgCode) { public List<View3dNodeVo> initViewErrorNode(String type, Long riskSourceId, String orgCode) {
return view3dMapper.initViewErrorNode(type,riskSourceId,orgCode); return view3dMapper.initViewErrorNode(type, riskSourceId, orgCode);
} }
@Override @Override
public CommonResponse get3dPointsByModel(String orgCode,String model) { public CommonResponse get3dPointsByModel(String orgCode, String model) {
if(model.equals("grain")) { if (model.equals("grain")) {
List<HashMap<String, Object>> points = new ArrayList<>(); List<HashMap<String, Object>> points = new ArrayList<>();
return CommonResponseUtil.success(this.getPointsByType(orgCode,FasConstant.ALL_POINT)); return CommonResponseUtil.success(this.getPointsByType(orgCode, FasConstant.ALL_POINT));
}else if(model.equals("impEquipment")) { } else if (model.equals("impEquipment")) {
return CommonResponseUtil.success(view3dMapper.getImpEqu3dPoints(orgCode)); return CommonResponseUtil.success(view3dMapper.getImpEqu3dPoints(orgCode));
} }
log.error("模式暂不支持 --> " + model); log.error("模式暂不支持 --> " + model);
return CommonResponseUtil.failure("模式暂不支持 --> " + model); return CommonResponseUtil.failure("模式暂不支持 --> " + model);
} }
private List<HashMap<String, Object>> getPointsByType(String orgCode,String type){ private List<HashMap<String, Object>> getPointsByType(String orgCode, String type) {
//1.查询数据 //1.查询数据
List<HashMap<String, Object>> points = new ArrayList<>(); List<HashMap<String, Object>> points = new ArrayList<>();
Map<String,Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("orgCode",orgCode); params.put("orgCode", orgCode);
params.put("type", FasConstant.ALL_POINT.equalsIgnoreCase(type) ? null : type); params.put("type", FasConstant.ALL_POINT.equalsIgnoreCase(type) ? null : type);
points = view3dMapper.getPintsByType(params); points = view3dMapper.getPintsByType(params);
//2.坐标相关字段转json //2.坐标相关字段转json
points.forEach(point ->{ points.forEach(point -> {
JSONArray ue4Location = this.getInitJSONArray(String.valueOf(point.get("ue4Location"))); JSONArray ue4Location = this.getInitJSONArray(String.valueOf(point.get("ue4Location")));
JSONArray ue4Rotation = this.getInitJSONArray(String.valueOf(point.get("ue4Rotation"))); JSONArray ue4Rotation = this.getInitJSONArray(String.valueOf(point.get("ue4Rotation")));
String[] relationKeys = point.get("relationKeys") != null ? String.valueOf(point.get("relationKeys")).split(",") : null; String[] relationKeys = point.get("relationKeys") != null ? String.valueOf(point.get("relationKeys")).split(",") : null;
point.put("ue4Location",ue4Location); point.put("ue4Location", ue4Location);
point.put("ue4Rotation",ue4Rotation); point.put("ue4Rotation", ue4Rotation);
point.put("relationKeys",relationKeys); point.put("relationKeys", relationKeys);
}); });
return points; return points;
} }
@Override @Override
public void safetyIndexLogGenJob(String runData) { public void safetyIndexLogGenJob(String runData) {
Date collectDate = StringUtil.isNotEmpty(runData) ? DateUtil.formatDate(runData,DateUtil.DATE_DEFAULT_FORMAT) : DateUtil.getDayBefore(new Date()); Date collectDate = StringUtil.isNotEmpty(runData) ? DateUtil.formatDate(runData, DateUtil.DATE_DEFAULT_FORMAT) : DateUtil.getDayBefore(new Date());
//1.安全指数流水生成 //1.安全指数流水生成
try { try {
List<RiskSource> riskSources = iRiskSourceDao.findByParentId(0L); List<RiskSource> riskSources = iRiskSourceDao.findByParentId(0L);
...@@ -560,7 +558,8 @@ public class View3dServiceImpl implements IView3dService { ...@@ -560,7 +558,8 @@ public class View3dServiceImpl implements IView3dService {
safetyIndexChangeLog.setSafetyIndex(BigDecimal.valueOf(changeRpnToSafetyIndex)); safetyIndexChangeLog.setSafetyIndex(BigDecimal.valueOf(changeRpnToSafetyIndex));
safetyIndexChangeLog.setCollectDate(collectDate); safetyIndexChangeLog.setCollectDate(collectDate);
return safetyIndexChangeLog; return safetyIndexChangeLog;
}).collect(Collectors.toList());; }).collect(Collectors.toList());
;
iSafetyIndexChangeLogDao.saveAll(safetyIndexChangeLogs); iSafetyIndexChangeLogDao.saveAll(safetyIndexChangeLogs);
} catch (Exception e) { } catch (Exception e) {
log.error("安全指数流水生成失败: " + e.getMessage()); log.error("安全指数流水生成失败: " + e.getMessage());
...@@ -570,62 +569,86 @@ public class View3dServiceImpl implements IView3dService { ...@@ -570,62 +569,86 @@ public class View3dServiceImpl implements IView3dService {
} }
@Override @Override
public List<Node3DVoResponse> find3dViewDataByType(String type,Long riskSourceId,String orgCode,Boolean abnormalStatus) { public List<Node3DVoResponse> find3dViewDataByType(String type, Long riskSourceId, String orgCode, Boolean abnormalStatus) {
return view3dMapper.findViewDataByType(type,riskSourceId,orgCode,abnormalStatus); return view3dMapper.findViewDataByType(type, riskSourceId, orgCode, abnormalStatus);
} }
@Override @Override
public CommonResponse retrieveAll(String type, String riskSourceId, String inputText, int current, int pageSize,String orgCode,String dataLevel,String protectObjName,String token,String appKey,String product) { public CommonResponse retrieveAll(String type, String riskSourceId, String inputText, int current, int pageSize, String orgCode, String dataLevel, String protectObjName, String token, String appKey, String product) {
CommonPageable pageable = new CommonPageable( current, pageSize); CommonPageable pageable = new CommonPageable(current, pageSize);
Long riskSource = StringUtils.isEmpty(riskSourceId) ? null : Long.parseLong(riskSourceId); Long riskSource = StringUtils.isEmpty(riskSourceId) ? null : Long.parseLong(riskSourceId);
Long count = view3dMapper.retrieveAllCount(type,riskSource,inputText,orgCode,dataLevel,protectObjName); Long count = view3dMapper.retrieveAllCount(type, riskSource, inputText, orgCode, dataLevel, protectObjName);
List<HashMap<String, Object>> retrieveAll = view3dMapper.retrieveAll(type, riskSource,inputText,pageable.getOffset(),pageable.getPageSize(),orgCode,dataLevel,protectObjName); List<HashMap<String, Object>> retrieveAll = view3dMapper.retrieveAll(type, riskSource, inputText, pageable.getOffset(), pageable.getPageSize(), orgCode, dataLevel, protectObjName);
Set<Object> userIds = new HashSet<>(); Set<Object> userIds = new HashSet<>();
retrieveAll.forEach(action->{ retrieveAll.forEach(action -> {
if(!ObjectUtils.isEmpty(action.get("person"))){ if (!ObjectUtils.isEmpty(action.get("person"))) {
userIds.add(action.get("person").toString()); userIds.add(action.get("person").toString());
} }
}); });
Map<String,String> userMap = remoteSecurityService.getUserRealName(token, product, appKey, userIds); Map<String, String> userMap = remoteSecurityService.getUserRealName(token, product, appKey, userIds);
retrieveAll.stream().forEach(e->{ retrieveAll.stream().forEach(e -> {
String positionDTO = (String)e.get("positionDTO"); String positionDTO = (String) e.get("positionDTO");
JSONArray ue4Location = this.getInitJSONArray(String.valueOf(e.get("ue4Location"))); JSONArray ue4Location = this.getInitJSONArray(String.valueOf(e.get("ue4Location")));
JSONArray ue4Rotation = this.getInitJSONArray(String.valueOf(e.get("ue4Rotation"))); JSONArray ue4Rotation = this.getInitJSONArray(String.valueOf(e.get("ue4Rotation")));
if(!ObjectUtils.isEmpty(e.get("person"))){ if (!ObjectUtils.isEmpty(e.get("person"))) {
e.put("person", userMap.get(e.get("person").toString())); e.put("person", userMap.get(e.get("person").toString()));
} }
CoordDTO position = null; CoordDTO position = null;
if(positionDTO != null && !positionDTO.equals("")) { if (positionDTO != null && !positionDTO.equals("")) {
position = JSONObject.parseObject(positionDTO, CoordDTO.class); position = JSONObject.parseObject(positionDTO, CoordDTO.class);
} }
e.put("position",position); e.put("position", position);
e.put("ue4Location",ue4Location); e.put("ue4Location", ue4Location);
e.put("ue4Rotation",ue4Rotation); e.put("ue4Rotation", ue4Rotation);
e.put("showInfo",true); e.put("showInfo", true);
});
Page result = new PageImpl(retrieveAll, pageable, count);
return CommonResponseUtil.success(result);
}
@Override
public CommonResponse retrieve3All(String type, String riskSourceId, Long areaId, Long equipmentId, String inputText, int current, int pageSize, String orgCode, String dataLevel, String token, String appKey, String product) {
CommonPageable pageable = new CommonPageable(current, pageSize);
Long riskSource = StringUtils.isEmpty(riskSourceId) ? null : Long.parseLong(riskSourceId);
Long count = view3dMapper.retrieve3AllCount(type, riskSource, areaId, equipmentId, inputText, orgCode, dataLevel);
List<HashMap<String, Object>> retrieveAll = view3dMapper.retrieve3All(type, riskSource, areaId, equipmentId, inputText, pageable.getOffset(), pageable.getPageSize(), orgCode, dataLevel);
Set<Object> userIds = new HashSet<>();
retrieveAll.forEach(action -> {
if (!ObjectUtils.isEmpty(action.get("person"))) {
userIds.add(action.get("person").toString());
}
}); });
Page result = new PageImpl(retrieveAll,pageable,count); Map<String, String> userMap = remoteSecurityService.getUserRealName(token, product, appKey, userIds);
retrieveAll.stream().forEach(e -> {
String positionDTO = (String) e.get("positionDTO");
if (!ObjectUtils.isEmpty(e.get("person"))) {
e.put("person", userMap.get(e.get("person").toString()));
}
e.put("showInfo", true);
});
Page result = new PageImpl(retrieveAll, pageable, count);
return CommonResponseUtil.success(result); return CommonResponseUtil.success(result);
} }
@Override @Override
public List<Map<String,String>> pointLevelList(String type) { public List<Map<String, String>> pointLevelList(String type) {
switch (type) { switch (type) {
case "riskSource": case "riskSource":
return RiskSourceLevelEum.getLevelEnumList(); return RiskSourceLevelEum.getLevelEnumList();
case "patrol": case "patrol":
return PlanTaskDetailStatusEnum.getErrorLevelEnumList(); return PlanTaskDetailStatusEnum.getErrorLevelEnumList();
default: default:
throw new YeeException("不支持的类型 -->"+ type); throw new YeeException("不支持的类型 -->" + type);
} }
} }
@Override @Override
public List<Map<String, Object>> listPointsByRegionId(Long regionId, String type) { public List<Map<String, Object>> listPointsByRegionId(Long regionId, String type) {
List<Map<String, Object>> pointList = new ArrayList<>(); List<Map<String, Object>> pointList = new ArrayList<>();
if(FasConstant.ALL_POINT.equalsIgnoreCase(type)){//分支1:查询区域及子区域下所有点 if (FasConstant.ALL_POINT.equalsIgnoreCase(type)) {//分支1:查询区域及子区域下所有点
List<Long> regionIds = new ArrayList<>(); List<Long> regionIds = new ArrayList<>();
List<RiskSource> riskSourceList = iRiskSourceDao.findByParentId(regionId); List<RiskSource> riskSourceList = iRiskSourceDao.findByParentId(regionId);
this.getAllRiskRegion(regionIds,riskSourceList); this.getAllRiskRegion(regionIds, riskSourceList);
regionIds.add(regionId); regionIds.add(regionId);
pointList = this.getPointsByRegionIds(regionIds); pointList = this.getPointsByRegionIds(regionIds);
} else {//分支2:查询指定区域下所有点 } else {//分支2:查询指定区域下所有点
...@@ -635,12 +658,13 @@ public class View3dServiceImpl implements IView3dService { ...@@ -635,12 +658,13 @@ public class View3dServiceImpl implements IView3dService {
} }
private List<Map<String,Object>> getPointsByRegionIds(List<Long> ids){ private List<Map<String, Object>> getPointsByRegionIds(List<Long> ids) {
return view3dMapper.getAllPointInRegions(ids); return view3dMapper.getAllPointInRegions(ids);
} }
/** /**
* 获得子节点:区域 * 获得子节点:区域
*
* @param ids 返回 * @param ids 返回
* @param riskSourceList 风险点区域列表 * @param riskSourceList 风险点区域列表
*/ */
...@@ -656,9 +680,10 @@ public class View3dServiceImpl implements IView3dService { ...@@ -656,9 +680,10 @@ public class View3dServiceImpl implements IView3dService {
} }
} }
} }
private JSONArray strPositionToArry(Object position3d){
private JSONArray strPositionToArry(Object position3d) {
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();
if(StringUtil.isNotEmpty(position3d)){ if (StringUtil.isNotEmpty(position3d)) {
String[] arryStr = position3d.toString().split(","); String[] arryStr = position3d.toString().split(",");
List<Double> collect = Arrays.stream(arryStr).map(Double::parseDouble).collect(Collectors.toList()); List<Double> collect = Arrays.stream(arryStr).map(Double::parseDouble).collect(Collectors.toList());
jsonArray.addAll(collect); jsonArray.addAll(collect);
......
package com.yeejoin.amos.fas.business.service.intfc; package com.yeejoin.amos.fas.business.service.intfc;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam; import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.dao.entity.Fmea;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import java.util.HashMap; import java.util.HashMap;
...@@ -29,4 +30,5 @@ public interface IFmeaService { ...@@ -29,4 +30,5 @@ public interface IFmeaService {
* 查询关联的关联对象个数 * 查询关联的关联对象个数
*/ */
int queryControlObjCount(String[] ids); int queryControlObjCount(String[] ids);
} }
package com.yeejoin.amos.fas.business.service.intfc; package com.yeejoin.amos.fas.business.service.intfc;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.fas.business.bo.BindPointBo; import com.yeejoin.amos.fas.business.bo.BindPointBo;
import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo; import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo;
import com.yeejoin.amos.fas.business.vo.ExceptionRegionVo; import com.yeejoin.amos.fas.business.vo.ExceptionRegionVo;
...@@ -15,6 +11,10 @@ import com.yeejoin.amos.fas.core.common.response.Node3DVoResponse; ...@@ -15,6 +11,10 @@ import com.yeejoin.amos.fas.core.common.response.Node3DVoResponse;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse; import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @author DELL * @author DELL
*/ */
...@@ -160,11 +160,26 @@ public interface IView3dService { ...@@ -160,11 +160,26 @@ public interface IView3dService {
CommonResponse retrieveAll(String type, String riskRourceId, String inputText, int current, int pageSize,String orgCode,String dataLevel,String protectObjName,String token,String appKey,String product); CommonResponse retrieveAll(String type, String riskRourceId, String inputText, int current, int pageSize,String orgCode,String dataLevel,String protectObjName,String token,String appKey,String product);
/** /**
* 检索
*
* @param type 类型
* @param riskRourceId
* @param inputText 关键字
* @param dataLevel 风险等级
* @param current
* @param pageSize
* @param orgCode
* @return
*/
CommonResponse retrieve3All(String type, String riskRourceId, Long areaId, Long equipmentId, String inputText, int current, int pageSize, String orgCode, String dataLevel, String token, String appKey, String product);
/**
* 等级查询 * 等级查询
*
* @param type * @param type
* @return * @return
*/ */
List<Map<String,String>> pointLevelList(String type); List<Map<String, String>> pointLevelList(String type);
/** /**
* 查询区域下的各类点 * 查询区域下的各类点
......
...@@ -27,4 +27,7 @@ public class EquipmentSpecificVo { ...@@ -27,4 +27,7 @@ public class EquipmentSpecificVo {
//系统名称 //系统名称
private String systemName; private String systemName;
// 指标id
private String indexId;
} }
...@@ -56,7 +56,8 @@ ...@@ -56,7 +56,8 @@
left join wl_equipment_detail as det on sto.equipment_detail_id = det.id left join wl_equipment_detail as det on sto.equipment_detail_id = det.id
left join wl_equipment as equ on det.equipment_id = equ.id left join wl_equipment as equ on det.equipment_id = equ.id
left join wl_equipment_category as cate on equ.category_id = cate.id left join wl_equipment_category as cate on equ.category_id = cate.id
where sto.amount <![CDATA[>]]> 0 left join wl_stock_detail as wsd on wsd.equipment_detail_id = det.id
where sto.amount <![CDATA[>]]> 0 and wsd.status != 7
and spe.id is not null and spe.id is not null
<if test="name != null and name!='null' "> <if test="name != null and name!='null' ">
and (det.name like CONCAT('%',#{name},'%') or ware.full_name like CONCAT('%',#{name},'%') or spe.iot_code like CONCAT('%',#{name},'%') or spe.code like CONCAT('%',#{name},'%')) and (det.name like CONCAT('%',#{name},'%') or ware.full_name like CONCAT('%',#{name},'%') or spe.iot_code like CONCAT('%',#{name},'%') or spe.code like CONCAT('%',#{name},'%'))
...@@ -94,7 +95,8 @@ ...@@ -94,7 +95,8 @@
left join wl_equipment_detail as det on sto.equipment_detail_id = det.id left join wl_equipment_detail as det on sto.equipment_detail_id = det.id
left join wl_equipment as equ on det.equipment_id = equ.id left join wl_equipment as equ on det.equipment_id = equ.id
left join wl_equipment_category as cate on equ.category_id = cate.id left join wl_equipment_category as cate on equ.category_id = cate.id
where sto.amount <![CDATA[>]]> 0 left join wl_stock_detail as wsd on wsd.equipment_detail_id = det.id
where sto.amount <![CDATA[>]]> 0 and wsd.status != 7
and spe.id is not null and spe.id is not null
<if test="name != null and name!='null' "> <if test="name != null and name!='null' ">
and (det.name like CONCAT('%',#{name},'%') or ware.full_name like CONCAT('%',#{name},'%') or spe.iot_code like CONCAT('%',#{name},'%') or spe.code like CONCAT('%',#{name},'%')) and (det.name like CONCAT('%',#{name},'%') or ware.full_name like CONCAT('%',#{name},'%') or spe.iot_code like CONCAT('%',#{name},'%') or spe.code like CONCAT('%',#{name},'%'))
...@@ -113,8 +115,8 @@ ...@@ -113,8 +115,8 @@
</if> </if>
</select> </select>
<select id="getFireEquiments" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpeVo"> <select id="getFireEquiments" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpeVo">
select select DISTINCT
sto.equipment_specific_id as id , sto.equipment_specific_id as id,
spec.code as f_code, spec.code as f_code,
det.name as f_name det.name as f_name
from from
...@@ -164,12 +166,16 @@ ...@@ -164,12 +166,16 @@
</if> </if>
</select> </select>
<select id="getAssoEquips" resultType="com.yeejoin.amos.fas.business.vo.AssoEquipsVo"> <select id="getAssoEquips" resultType="com.yeejoin.amos.fas.business.vo.AssoEquipsVo">
select select DISTINCT
sto.id as equipmentId, sto.id as equipmentId,
spe.code as equipmentCode, spe.code as equipmentCode,
det.name as equipmentName , det.name as equipmentName ,
fqe.name as importantEquipName , fqe.name as importantEquipName ,
(select group_concat(concat( name, '##', state )) from wl_equipment_index as equindex where equip.id = equindex.equipment_id and type_code = 'BREAKDOWN' group by equindex.equipment_id) as equipmentPointNames, (select group_concat(concat( name, '##', state )) from wl_equipment_index as equindex where equip.id = equindex.equipment_id and type_code = 'BREAKDOWN' AND equindex.id IN
<foreach collection="indexIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
group by equindex.equipment_id) as equipmentPointNames,
poin.important_equipment_id as importantEquipId, poin.important_equipment_id as importantEquipId,
fmea_id as fmeaId fmea_id as fmeaId
from from
...@@ -248,4 +254,13 @@ ...@@ -248,4 +254,13 @@
wl_equipment_specific wes wl_equipment_specific wes
WHERE wes.id=#{id} WHERE wes.id=#{id}
</select> </select>
<select id="getIndexByIndexId" resultType="Long">
SELECT
equipment_index_id
FROM
wl_equipment_specific_index wesi
WHERE wesi.id=#{indexId}
limit 1
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -181,4 +181,17 @@ ...@@ -181,4 +181,17 @@
equipment_point_id = #{specificIndexId} and important_equipment_id = #{equipId} equipment_point_id = #{specificIndexId} and important_equipment_id = #{equipId}
</select> </select>
<select id="getOneByFmeaId" resultType="com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint">
select
id,
fmea_id as fmeaId,
equipment_point_id as equipmentPointId,
state,
important_equipment_id as importantEquipmentId
from
f_fmea_equipment_point
where
fmea_id = #{fmeaId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -3,323 +3,323 @@ ...@@ -3,323 +3,323 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.View3dMapper"> <mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.View3dMapper">
<!-- <select id="getPointByType" resultType="com.yeejoin.amos.fas.core.common.response.RegionTreeResponse">--> <!-- <select id="getPointByType" resultType="com.yeejoin.amos.fas.core.common.response.RegionTreeResponse">-->
<!-- <choose>--> <!-- <choose>-->
<!-- <when test="type == 'riskSource'">--> <!-- <when test="type == 'riskSource'">-->
<!-- select--> <!-- select-->
<!-- R.id,R.name,R.code,R.parent_id,R.ue4_location,R.ue4_rotation,R.ue4_extent,--> <!-- R.id,R.name,R.code,R.parent_id,R.ue4_location,R.ue4_rotation,R.ue4_extent,-->
<!-- <choose>--> <!-- <choose>-->
<!-- <when test="channelType == '3dpage'">--> <!-- <when test="channelType == '3dpage'">-->
<!-- IF(ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,--> <!-- IF(ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,-->
<!-- </when>--> <!-- </when>-->
<!-- <otherwise>--> <!-- <otherwise>-->
<!-- IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,R.ue4_rotation))--> <!-- IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,R.ue4_rotation))-->
<!-- AND ISNULL(IF(replace(trim(ue4_location),'[]','')='',NULL,R.ue4_location)),0,1) as is_bind,--> <!-- AND ISNULL(IF(replace(trim(ue4_location),'[]','')='',NULL,R.ue4_location)),0,1) as is_bind,-->
<!-- </otherwise>--> <!-- </otherwise>-->
<!-- </choose>--> <!-- </choose>-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- route_path,--> <!-- route_path,-->
<!-- rl.level,--> <!-- rl.level,-->
<!-- CONCAT('level_',rl.level) as level_str,--> <!-- CONCAT('level_',rl.level) as level_str,-->
<!-- 0 as is_region,--> <!-- 0 as is_region,-->
<!-- R.position3d--> <!-- R.position3d-->
<!-- from f_risk_source R--> <!-- from f_risk_source R-->
<!-- left join f_risk_level rl on rl.id = R.risk_level_id--> <!-- left join f_risk_level rl on rl.id = R.risk_level_id-->
<!-- where 1=1--> <!-- where 1=1-->
<!-- AND R.risk_level_id is not null--> <!-- AND R.risk_level_id is not null-->
<!-- AND R.is_region = 'FALSE'--> <!-- AND R.is_region = 'FALSE'-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'patrol'">--> <!-- <when test="type == 'patrol'">-->
<!-- select--> <!-- select-->
<!-- B.id,B.risk_source_id as parent_id,--> <!-- B.id,B.risk_source_id as parent_id,-->
<!-- <choose>--> <!-- <choose>-->
<!-- <when test="channelType == '3dpage'">--> <!-- <when test="channelType == '3dpage'">-->
<!-- IF(ISNULL(B.coordinates) || LENGTH(trim(B.coordinates)) <![CDATA[ <]]> 1,0,1) as is_bind,--> <!-- IF(ISNULL(B.coordinates) || LENGTH(trim(B.coordinates)) <![CDATA[ <]]> 1,0,1) as is_bind,-->
<!-- </when>--> <!-- </when>-->
<!-- <otherwise>--> <!-- <otherwise>-->
<!-- IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))--> <!-- IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))-->
<!-- AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,--> <!-- AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,-->
<!-- </otherwise>--> <!-- </otherwise>-->
<!-- </choose>--> <!-- </choose>-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- B.name as name,B.point_no as code,B.ue4_location,B.ue4_rotation,--> <!-- B.name as name,B.point_no as code,B.ue4_location,B.ue4_rotation,-->
<!-- 0 as is_region,--> <!-- 0 as is_region,-->
<!-- B.coordinates as position3d,--> <!-- B.coordinates as position3d,-->
<!-- B.status as level,--> <!-- B.status as level,-->
<!-- CONCAT('level_',B.status) as level_str--> <!-- CONCAT('level_',B.status) as level_str-->
<!-- from f_risk_source R--> <!-- from f_risk_source R-->
<!-- left join p_point B on B.risk_source_id = R.id AND R.is_region='TRUE'--> <!-- left join p_point B on B.risk_source_id = R.id AND R.is_region='TRUE'-->
<!-- where 1=1--> <!-- where 1=1-->
<!-- AND B.id is not null AND B.is_delete = 0--> <!-- AND B.id is not null AND B.is_delete = 0-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'impEquipment'">--> <!-- <when test="type == 'impEquipment'">-->
<!-- select--> <!-- select-->
<!-- B.id,B.risk_source_id as parent_id,--> <!-- B.id,B.risk_source_id as parent_id,-->
<!-- <choose>--> <!-- <choose>-->
<!-- <when test="channelType == '3dpage'">--> <!-- <when test="channelType == '3dpage'">-->
<!-- IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,--> <!-- IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,-->
<!-- </when>--> <!-- </when>-->
<!-- <otherwise>--> <!-- <otherwise>-->
<!-- IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))--> <!-- IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))-->
<!-- AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,--> <!-- AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,-->
<!-- </otherwise>--> <!-- </otherwise>-->
<!-- </choose>--> <!-- </choose>-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- B.name,B.code,B.ue4_location,B.ue4_rotation,--> <!-- B.name,B.code,B.ue4_location,B.ue4_rotation,-->
<!-- 0 as is_region,--> <!-- 0 as is_region,-->
<!-- B.position3d--> <!-- B.position3d-->
<!-- from f_risk_source R--> <!-- from f_risk_source R-->
<!-- left join f_equipment B on B.risk_source_id = R.id AND R.is_region='TRUE'--> <!-- left join f_equipment B on B.risk_source_id = R.id AND R.is_region='TRUE'-->
<!-- where 1=1--> <!-- where 1=1-->
<!-- AND B.id is not null--> <!-- AND B.id is not null-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'monitorEquipment'">--> <!-- <when test="type == 'monitorEquipment'">-->
<!-- select--> <!-- select-->
<!-- B.id,B.risk_source_id as parent_id,--> <!-- B.id,B.risk_source_id as parent_id,-->
<!-- <choose>--> <!-- <choose>-->
<!-- <when test="channelType == '3dpage'">--> <!-- <when test="channelType == '3dpage'">-->
<!-- IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,--> <!-- IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,-->
<!-- </when>--> <!-- </when>-->
<!-- <otherwise>--> <!-- <otherwise>-->
<!-- IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))--> <!-- IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))-->
<!-- AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,--> <!-- AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,-->
<!-- </otherwise>--> <!-- </otherwise>-->
<!-- </choose>--> <!-- </choose>-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- B.name,B.code,B.ue4_location,B.ue4_rotation,--> <!-- B.name,B.code,B.ue4_location,B.ue4_rotation,-->
<!-- 0 as is_region,--> <!-- 0 as is_region,-->
<!-- B.position3d--> <!-- B.position3d-->
<!-- from f_risk_source R--> <!-- from f_risk_source R-->
<!-- left join f_fire_equipment B on B.risk_source_id = R.id AND B.equip_classify = 0--> <!-- left join f_fire_equipment B on B.risk_source_id = R.id AND B.equip_classify = 0-->
<!-- where 1=1--> <!-- where 1=1-->
<!-- AND B.id is not null--> <!-- AND B.id is not null-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'video'">--> <!-- <when test="type == 'video'">-->
<!-- select--> <!-- select-->
<!-- B.id,B.risk_source_id as parent_id,--> <!-- B.id,B.risk_source_id as parent_id,-->
<!-- <choose>--> <!-- <choose>-->
<!-- <when test="channelType == '3dpage'">--> <!-- <when test="channelType == '3dpage'">-->
<!-- IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,--> <!-- IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,-->
<!-- </when>--> <!-- </when>-->
<!-- <otherwise>--> <!-- <otherwise>-->
<!-- IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))--> <!-- IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))-->
<!-- AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,--> <!-- AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,-->
<!-- </otherwise>--> <!-- </otherwise>-->
<!-- </choose>--> <!-- </choose>-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- B.name,B.code,B.ue4_location,B.ue4_rotation,--> <!-- B.name,B.code,B.ue4_location,B.ue4_rotation,-->
<!-- 0 as is_region,--> <!-- 0 as is_region,-->
<!-- B.position3d--> <!-- B.position3d-->
<!-- from f_risk_source R--> <!-- from f_risk_source R-->
<!-- left join f_fire_equipment B on B.risk_source_id = R.id AND B.equip_classify = 2--> <!-- left join f_fire_equipment B on B.risk_source_id = R.id AND B.equip_classify = 2-->
<!-- where 1=1--> <!-- where 1=1-->
<!-- AND B.id is not null--> <!-- AND B.id is not null-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'fireEquipment'">--> <!-- <when test="type == 'fireEquipment'">-->
<!-- select tmp.id,tmp.name,tmp.type,tmp.position3d,tmp.ue4_rotation,tmp.ue4_location,tmp.code,R.id as parent_id,--> <!-- select tmp.id,tmp.name,tmp.type,tmp.position3d,tmp.ue4_rotation,tmp.ue4_location,tmp.code,R.id as parent_id,-->
<!-- <choose>--> <!-- <choose>-->
<!-- <when test="channelType == '3dpage'">--> <!-- <when test="channelType == '3dpage'">-->
<!-- IF(ISNULL(tmp.position3d) || LENGTH(trim(tmp.position3d)) <![CDATA[ <]]> 1,0,1) as isBind--> <!-- IF(ISNULL(tmp.position3d) || LENGTH(trim(tmp.position3d)) <![CDATA[ <]]> 1,0,1) as isBind-->
<!-- </when>--> <!-- </when>-->
<!-- <otherwise>--> <!-- <otherwise>-->
<!-- IF(ISNULL(IF(replace(trim(tmp.ue4_rotation),'[]','')='',NULL,tmp.ue4_rotation))--> <!-- IF(ISNULL(IF(replace(trim(tmp.ue4_rotation),'[]','')='',NULL,tmp.ue4_rotation))-->
<!-- AND ISNULL(IF(replace(trim(tmp.ue4_location),'[]','')='',NULL,tmp.ue4_location)),0,1) as isBind--> <!-- AND ISNULL(IF(replace(trim(tmp.ue4_location),'[]','')='',NULL,tmp.ue4_location)),0,1) as isBind-->
<!-- </otherwise>--> <!-- </otherwise>-->
<!-- </choose>--> <!-- </choose>-->
<!-- from (--> <!-- from (-->
<!-- select id,name,'fireCar' as type,position3d,car_num as code,ue4_location,ue4_rotation,risk_source_id--> <!-- select id,name,'fireCar' as type,position3d,car_num as code,ue4_location,ue4_rotation,risk_source_id-->
<!-- from f_fire_car--> <!-- from f_fire_car-->
<!-- union all--> <!-- union all-->
<!-- select id,name,'fireEquipment' as type,position3d,code,ue4_location,ue4_rotation,risk_source_id--> <!-- select id,name,'fireEquipment' as type,position3d,code,ue4_location,ue4_rotation,risk_source_id-->
<!-- from f_fire_equipment--> <!-- from f_fire_equipment-->
<!-- where equip_classify =3--> <!-- where equip_classify =3-->
<!-- union all--> <!-- union all-->
<!-- select id,name,CASE--> <!-- select id,name,CASE-->
<!-- WHEN S.type = 1 then 'fireChamber'--> <!-- WHEN S.type = 1 then 'fireChamber'-->
<!-- WHEN S.type = 2 then 'fireFoamRoom'--> <!-- WHEN S.type = 2 then 'fireFoamRoom'-->
<!-- END as type,position3d,code,ue4_location,ue4_rotation,risk_source_id--> <!-- END as type,position3d,code,ue4_location,ue4_rotation,risk_source_id-->
<!-- from f_fire_station s--> <!-- from f_fire_station s-->
<!-- union all--> <!-- union all-->
<!-- select id,name,--> <!-- select id,name,-->
<!-- CASE--> <!-- CASE-->
<!-- WHEN W.type = 1 then 'hydrant'--> <!-- WHEN W.type = 1 then 'hydrant'-->
<!-- WHEN W.type = 2 then 'pool'--> <!-- WHEN W.type = 2 then 'pool'-->
<!-- END as type,position3d,code,ue4_location,ue4_rotation,risk_source_id--> <!-- END as type,position3d,code,ue4_location,ue4_rotation,risk_source_id-->
<!-- from f_water_resource w--> <!-- from f_water_resource w-->
<!-- ) tmp--> <!-- ) tmp-->
<!-- left join f_risk_source R on R.id = tmp.risk_source_id--> <!-- left join f_risk_source R on R.id = tmp.risk_source_id-->
<!-- </when>--> <!-- </when>-->
<!-- </choose>--> <!-- </choose>-->
<!-- <if test="orgCode != null">--> <!-- <if test="orgCode != null">-->
<!-- AND (R.org_code = #{orgCode} OR R.org_code like CONCAT(#{orgCode},'-%'))--> <!-- AND (R.org_code = #{orgCode} OR R.org_code like CONCAT(#{orgCode},'-%'))-->
<!-- </if>--> <!-- </if>-->
<!-- </select>--> <!-- </select>-->
<!-- <select id="getPointDetailByTypeAndId" resultType="java.util.HashMap">--> <!-- <select id="getPointDetailByTypeAndId" resultType="java.util.HashMap">-->
<!-- <choose>--> <!-- <choose>-->
<!-- <when test="type == 'riskSource'">--> <!-- <when test="type == 'riskSource'">-->
<!-- select rs.id,rs.name,rs.code,rs.ue4_location as ue4Location,rs.ue4_rotation as ue4Rotation,rs.position3d,--> <!-- select rs.id,rs.name,rs.code,rs.ue4_location as ue4Location,rs.ue4_rotation as ue4Rotation,rs.position3d,-->
<!-- rl.level,rl.name as levelStr,rs.floor3d ,rs.is_indoor as isIndoor,--> <!-- rl.level,rl.name as levelStr,rs.floor3d ,rs.is_indoor as isIndoor,-->
<!-- rs.flicker_frequency as frequency,--> <!-- rs.flicker_frequency as frequency,-->
<!-- true as 'showInfo',--> <!-- true as 'showInfo',-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- rs.rpn as title--> <!-- rs.rpn as title-->
<!-- from f_risk_source rs--> <!-- from f_risk_source rs-->
<!-- left join f_risk_level rl ON rl.id = rs.risk_level_id--> <!-- left join f_risk_level rl ON rl.id = rs.risk_level_id-->
<!-- where 1=1--> <!-- where 1=1-->
<!-- <if test="pointId != null">--> <!-- <if test="pointId != null">-->
<!-- AND rs.id = #{pointId}--> <!-- AND rs.id = #{pointId}-->
<!-- </if>--> <!-- </if>-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'patrol'">--> <!-- <when test="type == 'patrol'">-->
<!-- select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,coordinates as position3d,--> <!-- select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,coordinates as position3d,-->
<!-- status,floor as floor3d,is_indoor as isIndoor,--> <!-- status,floor as floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,--> <!-- 0 as frequency,-->
<!-- case p.status--> <!-- case p.status-->
<!-- when '0' then false--> <!-- when '0' then false-->
<!-- when '1' then false--> <!-- when '1' then false-->
<!-- else true--> <!-- else true-->
<!-- end as `showInfo`,--> <!-- end as `showInfo`,-->
<!-- case p.status--> <!-- case p.status-->
<!-- when '0' then '未计划'--> <!-- when '0' then '未计划'-->
<!-- when '1' then '合格'--> <!-- when '1' then '合格'-->
<!-- when '2' then '不合格'--> <!-- when '2' then '不合格'-->
<!-- when '3' then '漏检'--> <!-- when '3' then '漏检'-->
<!-- end as title,--> <!-- end as title,-->
<!-- case p.status--> <!-- case p.status-->
<!-- when '0' then '未计划'--> <!-- when '0' then '未计划'-->
<!-- when '1' then '合格'--> <!-- when '1' then '合格'-->
<!-- when '2' then '不合格'--> <!-- when '2' then '不合格'-->
<!-- when '3' then '漏检'--> <!-- when '3' then '漏检'-->
<!-- end as levelStr,--> <!-- end as levelStr,-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- status as level--> <!-- status as level-->
<!-- from p_point p--> <!-- from p_point p-->
<!-- where 1=1 and is_delete = 0--> <!-- where 1=1 and is_delete = 0-->
<!-- <if test="pointId != null">--> <!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}--> <!-- AND id = #{pointId}-->
<!-- </if>--> <!-- </if>-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'impEquipment'">--> <!-- <when test="type == 'impEquipment'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,--> <!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,--> <!-- 0 as frequency,-->
<!-- false as 'showInfo',--> <!-- false as 'showInfo',-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- name as 'title'--> <!-- name as 'title'-->
<!-- from f_equipment--> <!-- from f_equipment-->
<!-- where 1=1--> <!-- where 1=1-->
<!-- <if test="pointId != null">--> <!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}--> <!-- AND id = #{pointId}-->
<!-- </if>--> <!-- </if>-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'monitorEquipment'">--> <!-- <when test="type == 'monitorEquipment'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,--> <!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,--> <!-- 0 as frequency,-->
<!-- false as 'showInfo',--> <!-- false as 'showInfo',-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- name as 'title'--> <!-- name as 'title'-->
<!-- from f_fire_equipment--> <!-- from f_fire_equipment-->
<!-- where equip_classify = 0--> <!-- where equip_classify = 0-->
<!-- <if test="pointId != null">--> <!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}--> <!-- AND id = #{pointId}-->
<!-- </if>--> <!-- </if>-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'video'">--> <!-- <when test="type == 'video'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,--> <!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,--> <!-- 0 as frequency,-->
<!-- false as 'showInfo',--> <!-- false as 'showInfo',-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- name as 'title'--> <!-- name as 'title'-->
<!-- from f_fire_equipment--> <!-- from f_fire_equipment-->
<!-- where equip_classify = 2--> <!-- where equip_classify = 2-->
<!-- <if test="pointId != null">--> <!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}--> <!-- AND id = #{pointId}-->
<!-- </if>--> <!-- </if>-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'hydrant'">--> <!-- <when test="type == 'hydrant'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,--> <!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,--> <!-- 0 as frequency,-->
<!-- false as 'showInfo',--> <!-- false as 'showInfo',-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- name as 'title'--> <!-- name as 'title'-->
<!-- from f_water_resource--> <!-- from f_water_resource-->
<!-- where type = 1--> <!-- where type = 1-->
<!-- <if test="pointId != null">--> <!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}--> <!-- AND id = #{pointId}-->
<!-- </if>--> <!-- </if>-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'pool'">--> <!-- <when test="type == 'pool'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,--> <!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,--> <!-- 0 as frequency,-->
<!-- false as 'showInfo',--> <!-- false as 'showInfo',-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- name as 'title'--> <!-- name as 'title'-->
<!-- from f_water_resource--> <!-- from f_water_resource-->
<!-- where type = 2--> <!-- where type = 2-->
<!-- <if test="pointId != null">--> <!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}--> <!-- AND id = #{pointId}-->
<!-- </if>--> <!-- </if>-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'fireCar'">--> <!-- <when test="type == 'fireCar'">-->
<!-- select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,--> <!-- select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,--> <!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,--> <!-- 0 as frequency,-->
<!-- true as 'showInfo',--> <!-- true as 'showInfo',-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- name as 'title'--> <!-- name as 'title'-->
<!-- from f_fire_car--> <!-- from f_fire_car-->
<!-- where 1=1--> <!-- where 1=1-->
<!-- <if test="pointId != null">--> <!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}--> <!-- AND id = #{pointId}-->
<!-- </if>--> <!-- </if>-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'fireEquipment'">--> <!-- <when test="type == 'fireEquipment'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,--> <!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,--> <!-- 0 as frequency,-->
<!-- true as 'showInfo',--> <!-- true as 'showInfo',-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- name as 'title'--> <!-- name as 'title'-->
<!-- from f_fire_equipment--> <!-- from f_fire_equipment-->
<!-- where equip_classify = 3--> <!-- where equip_classify = 3-->
<!-- <if test="pointId != null">--> <!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}--> <!-- AND id = #{pointId}-->
<!-- </if>--> <!-- </if>-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'fireChamber'">--> <!-- <when test="type == 'fireChamber'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,--> <!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,--> <!-- 0 as frequency,-->
<!-- true as 'showInfo',--> <!-- true as 'showInfo',-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- name as 'title'--> <!-- name as 'title'-->
<!-- from f_fire_station--> <!-- from f_fire_station-->
<!-- where type = 1--> <!-- where type = 1-->
<!-- <if test="pointId != null">--> <!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}--> <!-- AND id = #{pointId}-->
<!-- </if>--> <!-- </if>-->
<!-- </when>--> <!-- </when>-->
<!-- <when test="type == 'fireFoamRoom'">--> <!-- <when test="type == 'fireFoamRoom'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,--> <!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,--> <!-- 0 as frequency,-->
<!-- true as 'showInfo',--> <!-- true as 'showInfo',-->
<!-- #{type} as type,--> <!-- #{type} as type,-->
<!-- name as 'title'--> <!-- name as 'title'-->
<!-- from f_fire_station--> <!-- from f_fire_station-->
<!-- where type = 2--> <!-- where type = 2-->
<!-- <if test="pointId != null">--> <!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}--> <!-- AND id = #{pointId}-->
<!-- </if>--> <!-- </if>-->
<!-- </when>--> <!-- </when>-->
<!-- </choose>--> <!-- </choose>-->
<!-- </select>--> <!-- </select>-->
<select id="getSafetyIndexWeek" resultType="java.util.HashMap"> <select id="getSafetyIndexWeek" resultType="java.util.HashMap">
<![CDATA[ <![CDATA[
...@@ -379,7 +379,7 @@ ...@@ -379,7 +379,7 @@
AND date_format(a.update_date, '%Y-%m-%d') = #{date} AND date_format(a.update_date, '%Y-%m-%d') = #{date}
</select> </select>
<select id="getAllErrorRiskPoint" resultType="com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo" > <select id="getAllErrorRiskPoint" resultType="com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo">
SELECT SELECT
rcl.id, rcl.id,
rcl.create_date AS changeDate, rcl.create_date AS changeDate,
...@@ -557,226 +557,226 @@ ...@@ -557,226 +557,226 @@
5 5
</select> </select>
<!-- <select id="getPintsByType" resultType="hashmap">--> <!-- <select id="getPintsByType" resultType="hashmap">-->
<!-- select CONCAT(type,'-',id) as `key`,sp.* from--> <!-- select CONCAT(type,'-',id) as `key`,sp.* from-->
<!-- (select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'riskSource' as type,org_code as orgCode,--> <!-- (select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'riskSource' as type,org_code as orgCode,-->
<!-- null as relationKeys--> <!-- null as relationKeys-->
<!-- from f_risk_source where is_region = 'FALSE'--> <!-- from f_risk_source where is_region = 'FALSE'-->
<!-- UNION all--> <!-- UNION all-->
<!-- select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'patrol' as type,org_code as orgCode,--> <!-- select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'patrol' as type,org_code as orgCode,-->
<!-- null as relationKeys--> <!-- null as relationKeys-->
<!-- from p_point WHERE is_delete = FALSE--> <!-- from p_point WHERE is_delete = FALSE-->
<!-- UNION all--> <!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'impEquipment' as type,org_code as orgCode,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'impEquipment' as type,org_code as orgCode,-->
<!-- tmp.relationKeys--> <!-- tmp.relationKeys-->
<!-- from f_equipment e--> <!-- from f_equipment e-->
<!-- LEFT JOIN--> <!-- LEFT JOIN-->
<!-- (select GROUP_CONCAT(fire_equipment_id) as relationKeys,equipment_id from f_equipment_fire_equipment GROUP BY equipment_id) tmp--> <!-- (select GROUP_CONCAT(fire_equipment_id) as relationKeys,equipment_id from f_equipment_fire_equipment GROUP BY equipment_id) tmp-->
<!-- ON TMP.equipment_id = e.id--> <!-- ON TMP.equipment_id = e.id-->
<!-- UNION all--> <!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'monitorEquipment' as type,org_code as orgCode,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'monitorEquipment' as type,org_code as orgCode,-->
<!-- null as relationKeys--> <!-- null as relationKeys-->
<!-- from f_fire_equipment where equip_classify = 0--> <!-- from f_fire_equipment where equip_classify = 0-->
<!-- UNION all--> <!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'video' as type,org_code as orgCode,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'video' as type,org_code as orgCode,-->
<!-- null as relationKeys--> <!-- null as relationKeys-->
<!-- from f_fire_equipment where equip_classify = 2--> <!-- from f_fire_equipment where equip_classify = 2-->
<!-- UNION all--> <!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'hydrant' as type,org_code as orgCode,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'hydrant' as type,org_code as orgCode,-->
<!-- null as relationKeys--> <!-- null as relationKeys-->
<!-- from f_water_resource where type = 1--> <!-- from f_water_resource where type = 1-->
<!-- UNION all--> <!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'pool' as type,org_code as orgCode,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'pool' as type,org_code as orgCode,-->
<!-- null as relationKeys--> <!-- null as relationKeys-->
<!-- from f_water_resource where type = 2--> <!-- from f_water_resource where type = 2-->
<!-- UNION all--> <!-- UNION all-->
<!-- select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation, 'fireCar' as type,org_code as orgCode,--> <!-- select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation, 'fireCar' as type,org_code as orgCode,-->
<!-- null as relationKeys--> <!-- null as relationKeys-->
<!-- from f_fire_car--> <!-- from f_fire_car-->
<!-- UNION all--> <!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'fireEquipment' as type,org_code as orgCode,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'fireEquipment' as type,org_code as orgCode,-->
<!-- null as relationKeys--> <!-- null as relationKeys-->
<!-- from f_fire_equipment where equip_classify = 3--> <!-- from f_fire_equipment where equip_classify = 3-->
<!-- UNION all--> <!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation , 'fireChamber' as type,org_code as orgCode,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation , 'fireChamber' as type,org_code as orgCode,-->
<!-- null as relationKeys--> <!-- null as relationKeys-->
<!-- from f_fire_station where type = 2--> <!-- from f_fire_station where type = 2-->
<!-- UNION all--> <!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'fireFoamRoom' as type,org_code as orgCode,--> <!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'fireFoamRoom' as type,org_code as orgCode,-->
<!-- null as relationKeys--> <!-- null as relationKeys-->
<!-- from f_fire_station where type = 1--> <!-- from f_fire_station where type = 1-->
<!-- ) as sp--> <!-- ) as sp-->
<!-- where--> <!-- where-->
<!-- sp.orgCode = #{orgCode}--> <!-- sp.orgCode = #{orgCode}-->
<!-- <if test="type!=null">and sp.type =#{type}</if>--> <!-- <if test="type!=null">and sp.type =#{type}</if>-->
<!-- </select>--> <!-- </select>-->
<!-- <select id="getImpEqu3dPoints" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo">--> <!-- <select id="getImpEqu3dPoints" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo">-->
<!-- SELECT id,name,code,ue4_location,ue4_rotation,--> <!-- SELECT id,name,code,ue4_location,ue4_rotation,-->
<!-- case--> <!-- case-->
<!-- when equip_classify= 0 then 'monitorEquipment'--> <!-- when equip_classify= 0 then 'monitorEquipment'-->
<!-- when equip_classify= 2 then 'video'--> <!-- when equip_classify= 2 then 'video'-->
<!-- when equip_classify= 3 then 'fireEquipment'--> <!-- when equip_classify= 3 then 'fireEquipment'-->
<!-- end as type,--> <!-- end as type,-->
<!-- case--> <!-- case-->
<!-- when equip_classify= 0 then 'monitorEquipment'--> <!-- when equip_classify= 0 then 'monitorEquipment'-->
<!-- when equip_classify= 2 then 'video'--> <!-- when equip_classify= 2 then 'video'-->
<!-- when equip_classify= 3 then 'fireEquipment'--> <!-- when equip_classify= 3 then 'fireEquipment'-->
<!-- end as level,--> <!-- end as level,-->
<!-- null as relationKeys,--> <!-- null as relationKeys,-->
<!-- CASE--> <!-- CASE-->
<!-- WHEN (--> <!-- WHEN (-->
<!-- ISNULL(fe.position3d) || LENGTH(trim(fe.position3d)) <![CDATA[ <]]> 1--> <!-- ISNULL(fe.position3d) || LENGTH(trim(fe.position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN--> <!-- ) THEN-->
<!-- NULL--> <!-- NULL-->
<!-- ELSE--> <!-- ELSE-->
<!-- CONCAT(--> <!-- CONCAT(-->
<!-- '{"x":',--> <!-- '{"x":',-->
<!-- substring_index(fe.position3d, ',', 1),--> <!-- substring_index(fe.position3d, ',', 1),-->
<!-- ',"y":',--> <!-- ',"y":',-->
<!-- substring_index(--> <!-- substring_index(-->
<!-- substring_index(fe.position3d, ',', - 2),--> <!-- substring_index(fe.position3d, ',', - 2),-->
<!-- ',',--> <!-- ',',-->
<!-- 1--> <!-- 1-->
<!-- ),--> <!-- ),-->
<!-- ',"z":',--> <!-- ',"z":',-->
<!-- substring_index(fe.position3d, ',', - 1),--> <!-- substring_index(fe.position3d, ',', - 1),-->
<!-- '}'--> <!-- '}'-->
<!-- )--> <!-- )-->
<!-- END position,--> <!-- END position,-->
<!-- concat('monitorEquipment-',fe.id) as `key`--> <!-- concat('monitorEquipment-',fe.id) as `key`-->
<!-- FROM f_fire_equipment fe--> <!-- FROM f_fire_equipment fe-->
<!-- WHERE fe.id IN (--> <!-- WHERE fe.id IN (-->
<!-- select fire_equipment_id from f_equipment_fire_equipment--> <!-- select fire_equipment_id from f_equipment_fire_equipment-->
<!-- ) AND (org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%'))--> <!-- ) AND (org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%'))-->
<!-- AND fe.equip_classify <![CDATA[ <> ]]> 1--> <!-- AND fe.equip_classify <![CDATA[ <> ]]> 1-->
<!-- UNION ALL--> <!-- UNION ALL-->
<!-- SELECT e.id,e.name,e.code,e.ue4_location,e.ue4_rotation,'impEquipment' as type,'impEquipment' as level,--> <!-- SELECT e.id,e.name,e.code,e.ue4_location,e.ue4_rotation,'impEquipment' as type,'impEquipment' as level,-->
<!-- TMP.relationKeys,--> <!-- TMP.relationKeys,-->
<!-- CASE--> <!-- CASE-->
<!-- WHEN (--> <!-- WHEN (-->
<!-- ISNULL(e.position3d) || LENGTH(trim(e.position3d)) <![CDATA[ <]]> 1--> <!-- ISNULL(e.position3d) || LENGTH(trim(e.position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN--> <!-- ) THEN-->
<!-- NULL--> <!-- NULL-->
<!-- ELSE--> <!-- ELSE-->
<!-- CONCAT(--> <!-- CONCAT(-->
<!-- '{"x":',--> <!-- '{"x":',-->
<!-- substring_index(e.position3d, ',', 1),--> <!-- substring_index(e.position3d, ',', 1),-->
<!-- ',"y":',--> <!-- ',"y":',-->
<!-- substring_index(--> <!-- substring_index(-->
<!-- substring_index(e.position3d, ',', - 2),--> <!-- substring_index(e.position3d, ',', - 2),-->
<!-- ',',--> <!-- ',',-->
<!-- 1--> <!-- 1-->
<!-- ),--> <!-- ),-->
<!-- ',"z":',--> <!-- ',"z":',-->
<!-- substring_index(e.position3d, ',', - 1),--> <!-- substring_index(e.position3d, ',', - 1),-->
<!-- '}'--> <!-- '}'-->
<!-- )--> <!-- )-->
<!-- END position,--> <!-- END position,-->
<!-- concat('impEquipment-',e.id) as `key`--> <!-- concat('impEquipment-',e.id) as `key`-->
<!-- FROM f_equipment e--> <!-- FROM f_equipment e-->
<!-- LEFT JOIN--> <!-- LEFT JOIN-->
<!-- (select GROUP_CONCAT(fire_equipment_id) as relationKeys,equipment_id from f_equipment_fire_equipment GROUP BY equipment_id) tmp--> <!-- (select GROUP_CONCAT(fire_equipment_id) as relationKeys,equipment_id from f_equipment_fire_equipment GROUP BY equipment_id) tmp-->
<!-- ON TMP.equipment_id = e.id--> <!-- ON TMP.equipment_id = e.id-->
<!-- WHERE e.org_code = #{orgCode} OR e.org_code like CONCAT(#{orgCode},'-%')--> <!-- WHERE e.org_code = #{orgCode} OR e.org_code like CONCAT(#{orgCode},'-%')-->
<!-- UNION ALL--> <!-- UNION ALL-->
<!-- SELECT id,name,code,ue4_location,ue4_rotation,--> <!-- SELECT id,name,code,ue4_location,ue4_rotation,-->
<!-- case type--> <!-- case type-->
<!-- when 1 then 'hydrant'--> <!-- when 1 then 'hydrant'-->
<!-- when 2 then 'pool'--> <!-- when 2 then 'pool'-->
<!-- end as type,--> <!-- end as type,-->
<!-- case type--> <!-- case type-->
<!-- when 1 then 'hydrant'--> <!-- when 1 then 'hydrant'-->
<!-- when 2 then 'pool'--> <!-- when 2 then 'pool'-->
<!-- end as level,--> <!-- end as level,-->
<!-- null as relationKeys,--> <!-- null as relationKeys,-->
<!-- CASE--> <!-- CASE-->
<!-- WHEN (--> <!-- WHEN (-->
<!-- ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1--> <!-- ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN--> <!-- ) THEN-->
<!-- NULL--> <!-- NULL-->
<!-- ELSE--> <!-- ELSE-->
<!-- CONCAT(--> <!-- CONCAT(-->
<!-- '{"x":',--> <!-- '{"x":',-->
<!-- substring_index(position3d, ',', 1),--> <!-- substring_index(position3d, ',', 1),-->
<!-- ',"y":',--> <!-- ',"y":',-->
<!-- substring_index(--> <!-- substring_index(-->
<!-- substring_index(position3d, ',', - 2),--> <!-- substring_index(position3d, ',', - 2),-->
<!-- ',',--> <!-- ',',-->
<!-- 1--> <!-- 1-->
<!-- ),--> <!-- ),-->
<!-- ',"z":',--> <!-- ',"z":',-->
<!-- substring_index(position3d, ',', - 1),--> <!-- substring_index(position3d, ',', - 1),-->
<!-- '}'--> <!-- '}'-->
<!-- )--> <!-- )-->
<!-- END position,--> <!-- END position,-->
<!-- case type--> <!-- case type-->
<!-- when 1 then concat('hydrant-',id)--> <!-- when 1 then concat('hydrant-',id)-->
<!-- when 2 then concat('pool-',id)--> <!-- when 2 then concat('pool-',id)-->
<!-- end as `key`--> <!-- end as `key`-->
<!-- FROM f_water_resource--> <!-- FROM f_water_resource-->
<!-- WHERE org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%')--> <!-- WHERE org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%')-->
<!-- UNION ALL--> <!-- UNION ALL-->
<!-- SELECT id,name,code,ue4_location,ue4_rotation,--> <!-- SELECT id,name,code,ue4_location,ue4_rotation,-->
<!-- case--> <!-- case-->
<!-- when type = 1 then 'fireChamber'--> <!-- when type = 1 then 'fireChamber'-->
<!-- when type = 2 then 'fireFoamRoom'--> <!-- when type = 2 then 'fireFoamRoom'-->
<!-- end as type,--> <!-- end as type,-->
<!-- case--> <!-- case-->
<!-- when type = 1 then 'fireChamber'--> <!-- when type = 1 then 'fireChamber'-->
<!-- when type = 2 then 'fireFoamRoom'--> <!-- when type = 2 then 'fireFoamRoom'-->
<!-- end as level,--> <!-- end as level,-->
<!-- null as relationKeys,--> <!-- null as relationKeys,-->
<!-- CASE--> <!-- CASE-->
<!-- WHEN (--> <!-- WHEN (-->
<!-- ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1--> <!-- ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN--> <!-- ) THEN-->
<!-- NULL--> <!-- NULL-->
<!-- ELSE--> <!-- ELSE-->
<!-- CONCAT(--> <!-- CONCAT(-->
<!-- '{"x":',--> <!-- '{"x":',-->
<!-- substring_index(position3d, ',', 1),--> <!-- substring_index(position3d, ',', 1),-->
<!-- ',"y":',--> <!-- ',"y":',-->
<!-- substring_index(--> <!-- substring_index(-->
<!-- substring_index(position3d, ',', - 2),--> <!-- substring_index(position3d, ',', - 2),-->
<!-- ',',--> <!-- ',',-->
<!-- 1--> <!-- 1-->
<!-- ),--> <!-- ),-->
<!-- ',"z":',--> <!-- ',"z":',-->
<!-- substring_index(position3d, ',', - 1),--> <!-- substring_index(position3d, ',', - 1),-->
<!-- '}'--> <!-- '}'-->
<!-- )--> <!-- )-->
<!-- END position,--> <!-- END position,-->
<!-- concat('fireChamber-',id) as `key`--> <!-- concat('fireChamber-',id) as `key`-->
<!-- FROM f_fire_station--> <!-- FROM f_fire_station-->
<!-- WHERE org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%')--> <!-- WHERE org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%')-->
<!-- UNION ALL--> <!-- UNION ALL-->
<!-- SELECT id,name,car_num as code,ue4_location,ue4_rotation,'fireCar' as type,'fireCar' as level,--> <!-- SELECT id,name,car_num as code,ue4_location,ue4_rotation,'fireCar' as type,'fireCar' as level,-->
<!-- null as relationKeys,--> <!-- null as relationKeys,-->
<!-- CASE--> <!-- CASE-->
<!-- WHEN (--> <!-- WHEN (-->
<!-- ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1--> <!-- ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN--> <!-- ) THEN-->
<!-- NULL--> <!-- NULL-->
<!-- ELSE--> <!-- ELSE-->
<!-- CONCAT(--> <!-- CONCAT(-->
<!-- '{"x":',--> <!-- '{"x":',-->
<!-- substring_index(position3d, ',', 1),--> <!-- substring_index(position3d, ',', 1),-->
<!-- ',"y":',--> <!-- ',"y":',-->
<!-- substring_index(--> <!-- substring_index(-->
<!-- substring_index(position3d, ',', - 2),--> <!-- substring_index(position3d, ',', - 2),-->
<!-- ',',--> <!-- ',',-->
<!-- 1--> <!-- 1-->
<!-- ),--> <!-- ),-->
<!-- ',"z":',--> <!-- ',"z":',-->
<!-- substring_index(position3d, ',', - 1),--> <!-- substring_index(position3d, ',', - 1),-->
<!-- '}'--> <!-- '}'-->
<!-- )--> <!-- )-->
<!-- END position,--> <!-- END position,-->
<!-- concat('fireCar-',id) as `key`--> <!-- concat('fireCar-',id) as `key`-->
<!-- FROM f_fire_car--> <!-- FROM f_fire_car-->
<!-- WHERE org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%')--> <!-- WHERE org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%')-->
<!-- </select>--> <!-- </select>-->
<select id="initViewErrorNode" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo"> <select id="initViewErrorNode" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo">
select * from ( select * from (
...@@ -1841,7 +1841,7 @@ ...@@ -1841,7 +1841,7 @@
where s.instanceId = r.source_id where s.instanceId = r.source_id
) as tmp ) as tmp
<where> <where>
<if test="inputText!=null and inputText != ''" > <if test="inputText!=null and inputText != ''">
AND ( AND (
tmp.code LIKE '%${inputText}%' tmp.code LIKE '%${inputText}%'
OR tmp.name LIKE '%${inputText}%' OR tmp.name LIKE '%${inputText}%'
...@@ -1859,54 +1859,309 @@ ...@@ -1859,54 +1859,309 @@
</where> </where>
LIMIT ${start},${length} LIMIT ${start},${length}
</select> </select>
<!-- <select id="getAllPointInRegions" resultType="java.util.Map">--> <select id="retrieve3AllCount" resultType="long">
<!-- select--> SELECT COUNT(1) FROM (
<!-- CONCAT(type,'-',id) as `key`,--> SELECT
<!-- id as pointId,--> concat( 'riskSource-', r.id ) AS id,
<!-- name,--> concat( r.id ) AS originId,
<!-- type,--> r.NAME,
<!-- risk_source_id as regionId,--> r.CODE,
<!-- position3d--> 'riskSource' AS type,
<!-- from--> r.org_code as orgCode,
<!-- (select id,name,'riskSource' as type, parent_id as risk_source_id,position3d--> rl.LEVEL AS LEVEL,
<!-- from f_risk_source where is_region = 'FALSE'--> rl.NAME AS levelStr,
<!-- UNION all--> r.is_indoor AS isIndoor,
<!-- select id,name,'patrol' as type,risk_source_id,coordinates as position3d--> '风险点' AS typeName,
<!-- from p_point WHERE is_delete = FALSE--> 'riskSource' AS typeCode,
<!-- UNION all--> r.NAME AS label,
<!-- select id,name ,'impEquipment' as type,risk_source_id,position3d--> '' AS routeName,
<!-- from f_equipment e--> '' AS person,
<!-- UNION all--> r.rpn AS title,
<!-- select id,name,'monitorEquipment' as type,risk_source_id,position3d--> CONCAT( 'riskSource-', r.id ) AS `key`,
<!-- from f_fire_equipment where equip_classify = 0--> r.id AS riskSourceId,
<!-- UNION all--> null AS areaId,
<!-- select id,name,'video' as type,risk_source_id,position3d--> '' AS room
<!-- from f_fire_equipment where equip_classify = 2--> FROM
<!-- UNION all--> f_risk_source r
<!-- select id,name ,'hydrant' as type,risk_source_id,position3d--> LEFT JOIN f_risk_level rl ON rl.id = r.risk_level_id
<!-- from f_water_resource where type = 1--> WHERE
<!-- UNION all--> r.is_region = 'FALSE'
<!-- select id,name,'pool' as type,risk_source_id,position3d--> <if test="dataLevel != null and dataLevel != ''">
<!-- from f_water_resource where type = 2--> AND rl.level = #{dataLevel}
<!-- UNION all--> </if>
<!-- select id,name,'fireCar' as type,risk_source_id,position3d--> UNION ALL
<!-- from f_fire_car--> SELECT
<!-- UNION all--> concat( 'patrol-', p.id ) AS id,
<!-- select id,name,'fireEquipment' as type,risk_source_id,position3d--> concat( p.id ) AS originId,
<!-- from f_fire_equipment where equip_classify = 3--> p.NAME,
<!-- UNION all--> p.point_no AS CODE,
<!-- select id,name,'fireChamber' as type,risk_source_id,position3d--> 'patrol' AS type,
<!-- from f_fire_station where type = 2--> p.org_code as orgCode,
<!-- UNION all--> p.STATUS AS LEVEL,
<!-- select id,name,'fireFoamRoom' as type,risk_source_id,position3d--> CONCAT( 'level_', p.STATUS ) AS levelStr,
<!-- from f_fire_station where type = 1--> p.is_indoor AS isIndoor,
<!-- ) as sp--> '巡检点' AS typeName,
<!-- where--> 'patrol' AS typeCode,
<!-- position3d <![CDATA[<>]]> '' and--> p.NAME AS label,
<!-- risk_source_id in--> p.route_name AS routeName,
<!-- <foreach collection="ids" open="(" separator="," close=")" item="id">--> p.charge_person_id AS person,
<!-- #{id}--> CASE
<!-- </foreach>-->
<!-- order by regionId--> WHEN p.STATUS = '0' THEN
<!-- </select>--> '未执行'
WHEN p.STATUS = '1' THEN
'合格'
WHEN p.STATUS = '2' THEN
'不合格'
WHEN p.STATUS = '3' THEN
'漏检'
END AS title,
concat( 'patrol-', p.id ) AS `key`,
p.risk_source_id AS riskSourceId,
p.area_id AS areaId,
r.NAME AS room
FROM
p_point p
LEFT JOIN f_risk_source r ON r.id = p.risk_source_id
<where>
is_delete = FALSE
<if test="areaId != null">
AND p.area_id = #{areaId}
</if>
</where>
UNION ALL
SELECT
concat( 'fireEquipment-', m.id ) AS id,
concat( m.id ) AS originId,
det.NAME,
m.CODE AS CODE,
'fireEquipment' AS type,
m.org_code as orgCode,
NULL AS LEVEL,
concat( 'level_', NULL ) AS levelStr,
NULL AS isIndoor,
'消防设备' AS typeName,
'fireEquipment' AS typeCode,
det.NAME AS label,
'' AS routeName,
'' AS person,
det.NAME AS title,
concat( 'fireEquipment-', m.id ) AS `key`,
risk.id AS riskSourceId,
m.area_id AS areaId,
str.full_name AS room
FROM
wl_equipment_specific m
LEFT JOIN wl_equipment_detail AS det ON m.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS equ ON det.equipment_id = equ.id
LEFT JOIN wl_equipment_category AS cat ON equ.category_id = cat.id
LEFT JOIN wl_stock_detail AS sto ON sto.qr_code = m.qr_code
LEFT JOIN wl_warehouse_structure AS str ON sto.warehouse_structure_id = str.source_id
LEFT JOIN f_risk_source AS risk ON str.source_id = risk.source_id
<where>
<if test="areaId != null">
m.area_id = #{areaId}
</if>
<if test="equipmentId != null">
AND equ.id = #{equipmentId}
</if>
</where>
GROUP BY
m.CODE) as tmp
<where>
<if test="inputText!=null and inputText != ''">
AND (
tmp.code LIKE '%${inputText}%'
OR tmp.name LIKE '%${inputText}%'
)
</if>
<if test="type!=null and type!=''">
AND tmp.typeCode = #{type}
</if>
<if test="riskSourceId != null">
AND tmp.riskSourceId = #{riskSourceId}
</if>
<if test="orgCode!=null">
AND (tmp.orgCode = #{orgCode} OR tmp.orgCode like CONCAT(#{orgCode},'-%') )
</if>
</where>
</select>
<select id="retrieve3All" resultType="java.util.HashMap">
SELECT * FROM (
SELECT
concat( 'riskSource-', r.id ) AS id,
concat( r.id ) AS originId,
r.NAME,
r.CODE,
'riskSource' AS type,
r.org_code as orgCode,
rl.LEVEL AS LEVEL,
rl.NAME AS levelStr,
r.is_indoor AS isIndoor,
'风险点' AS typeName,
'riskSource' AS typeCode,
r.NAME AS label,
'' AS routeName,
'' AS person,
r.rpn AS title,
CONCAT( 'riskSource-', r.id ) AS `key`,
r.id AS riskSourceId,
null AS areaId,
'' AS room
FROM
f_risk_source r
LEFT JOIN f_risk_level rl ON rl.id = r.risk_level_id
WHERE
r.is_region = 'FALSE'
<if test="dataLevel != null and dataLevel != ''">
AND rl.level = #{dataLevel}
</if>
UNION ALL
SELECT
concat( 'patrol-', p.id ) AS id,
concat( p.id ) AS originId,
p.NAME,
p.point_no AS CODE,
'patrol' AS type,
p.org_code as orgCode,
p.STATUS AS LEVEL,
CONCAT( 'level_', p.STATUS ) AS levelStr,
p.is_indoor AS isIndoor,
'巡检点' AS typeName,
'patrol' AS typeCode,
p.NAME AS label,
p.route_name AS routeName,
p.charge_person_id AS person,
CASE
WHEN p.STATUS = '0' THEN
'未执行'
WHEN p.STATUS = '1' THEN
'合格'
WHEN p.STATUS = '2' THEN
'不合格'
WHEN p.STATUS = '3' THEN
'漏检'
END AS title,
concat( 'patrol-', p.id ) AS `key`,
p.risk_source_id AS riskSourceId,
p.area_id AS areaId,
r.NAME AS room
FROM
p_point p
LEFT JOIN f_risk_source r ON r.id = p.risk_source_id
<where>
is_delete = FALSE
<if test="areaId != null">
AND p.area_id = #{areaId}
</if>
</where>
UNION ALL
SELECT
concat( 'fireEquipment-', m.id ) AS id,
concat( m.id ) AS originId,
det.NAME,
m.CODE AS CODE,
'fireEquipment' AS type,
m.org_code as orgCode,
NULL AS LEVEL,
concat( 'level_', NULL ) AS levelStr,
NULL AS isIndoor,
'消防设备' AS typeName,
'fireEquipment' AS typeCode,
det.NAME AS label,
'' AS routeName,
'' AS person,
det.NAME AS title,
concat( 'fireEquipment-', m.id ) AS `key`,
risk.id AS riskSourceId,
m.area_id AS areaId,
str.full_name AS room
FROM
wl_equipment_specific m
LEFT JOIN wl_equipment_detail AS det ON m.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS equ ON det.equipment_id = equ.id
LEFT JOIN wl_equipment_category AS cat ON equ.category_id = cat.id
LEFT JOIN wl_stock_detail AS sto ON sto.qr_code = m.qr_code
LEFT JOIN wl_warehouse_structure AS str ON sto.warehouse_structure_id = str.source_id
LEFT JOIN f_risk_source AS risk ON str.source_id = risk.source_id
<where>
<if test="areaId != null">
m.area_id = #{areaId}
</if>
<if test="equipmentId != null">
AND equ.id = #{equipmentId}
</if>
</where>
GROUP BY
m.CODE) as tmp
<where>
<if test="inputText!=null and inputText != ''">
AND (
tmp.code LIKE '%${inputText}%'
OR tmp.name LIKE '%${inputText}%'
)
</if>
<if test="type!=null and type!=''">
AND tmp.typeCode = #{type}
</if>
<if test="riskSourceId != null">
AND tmp.riskSourceId = #{riskSourceId}
</if>
<if test="orgCode!=null">
AND (tmp.orgCode = #{orgCode} OR tmp.orgCode like CONCAT(#{orgCode},'-%') )
</if>
</where>
LIMIT ${start},${length}
</select>
<!-- <select id="getAllPointInRegions" resultType="java.util.Map">-->
<!-- select-->
<!-- CONCAT(type,'-',id) as `key`,-->
<!-- id as pointId,-->
<!-- name,-->
<!-- type,-->
<!-- risk_source_id as regionId,-->
<!-- position3d-->
<!-- from-->
<!-- (select id,name,'riskSource' as type, parent_id as risk_source_id,position3d-->
<!-- from f_risk_source where is_region = 'FALSE'-->
<!-- UNION all-->
<!-- select id,name,'patrol' as type,risk_source_id,coordinates as position3d-->
<!-- from p_point WHERE is_delete = FALSE-->
<!-- UNION all-->
<!-- select id,name ,'impEquipment' as type,risk_source_id,position3d-->
<!-- from f_equipment e-->
<!-- UNION all-->
<!-- select id,name,'monitorEquipment' as type,risk_source_id,position3d-->
<!-- from f_fire_equipment where equip_classify = 0-->
<!-- UNION all-->
<!-- select id,name,'video' as type,risk_source_id,position3d-->
<!-- from f_fire_equipment where equip_classify = 2-->
<!-- UNION all-->
<!-- select id,name ,'hydrant' as type,risk_source_id,position3d-->
<!-- from f_water_resource where type = 1-->
<!-- UNION all-->
<!-- select id,name,'pool' as type,risk_source_id,position3d-->
<!-- from f_water_resource where type = 2-->
<!-- UNION all-->
<!-- select id,name,'fireCar' as type,risk_source_id,position3d-->
<!-- from f_fire_car-->
<!-- UNION all-->
<!-- select id,name,'fireEquipment' as type,risk_source_id,position3d-->
<!-- from f_fire_equipment where equip_classify = 3-->
<!-- UNION all-->
<!-- select id,name,'fireChamber' as type,risk_source_id,position3d-->
<!-- from f_fire_station where type = 2-->
<!-- UNION all-->
<!-- select id,name,'fireFoamRoom' as type,risk_source_id,position3d-->
<!-- from f_fire_station where type = 1-->
<!-- ) as sp-->
<!-- where-->
<!-- position3d <![CDATA[<>]]> '' and-->
<!-- risk_source_id in-->
<!-- <foreach collection="ids" open="(" separator="," close=")" item="id">-->
<!-- #{id}-->
<!-- </foreach>-->
<!-- order by regionId-->
<!-- </select>-->
</mapper> </mapper>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment