Commit 0889b12c authored by KeYong's avatar KeYong

Merge remote-tracking branch 'origin/develop_dl_plan6' into develop_dl_plan6

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EmergencyController.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EmergencyMapper.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEmergencyService.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EmergencyServiceImpl.java # amos-boot-system-equip/src/main/resources/mapper/EmergencyMapper.xml
parents a57f56bc 0d88ddc8
......@@ -205,13 +205,25 @@ public class EquipmentSpecificAlarm extends BaseEntity {
/**
* 机构/部门名称
*/
@TableField(exist = false)
@TableField(value = "biz_org_name")
private String bizOrgName;
/**
* 机构编码
*/
@TableField(exist = false)
@TableField(value = "biz_org_code")
private String bizOrgCode;
/**
* 机构code
*/
@TableField(value = "station_code")
private String stationCode;
/**
* 机构名称
*/
@TableField(value = "station_name")
private String stationName;
}
\ No newline at end of file
package com.yeejoin.equipmanage.common.entity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
@Data
@Accessors(chain = true)
@TableName("cb_org_usr")
@ApiModel(value="OrgUsr对象", description="部门信息")
public class OrgUsr {
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "机构/部门名称")
private String bizOrgName;
@ApiModelProperty(value = "机构编码")
private String bizOrgCode;
@ApiModelProperty(value = "amos中公司/部门ID")
private String amosOrgId;
@ApiModelProperty(value = "amos中公司/部门编码")
private String amosOrgCode;
@ApiModelProperty(value = "机构类型`")
private String bizOrgType;
@ApiModelProperty(value = "所属建筑名称")
private String buildName;
@ApiModelProperty(value = "所属建筑ID")
private String buildId;
@ApiModelProperty(value = "归属机构/部门/人员")
private String parentId;
@ApiModelProperty(value = "扩展属性1")
private String orgExpandAttr1;
@ApiModelProperty(value = "扩展属性2")
private String orgExpandAttr2;
@ApiModelProperty(value = "扩展属性3")
private String orgExpandAttr3;
@ApiModelProperty(value = "扩展属性4")
private String orgExpandAttr4;
private String orgExpandAttr5;
private String orgExpandAttr6;
private String orgExpandAttr7;
private String orgExpandAttr8;
@ApiModelProperty(value = "省市区code,用逗号分隔")
private String pczCode;
@ApiModelProperty(value = "省市区名称,用逗号分隔")
private String pczName;
@ApiModelProperty(value = "唯一编号")
private String code;
@ApiModelProperty(value = "数量")
@TableField(exist = false)
private Long total;
@ApiModelProperty(value = "管理类别")
@TableField(exist = false)
private String managementType;
@TableId(value = "sequence_nbr", type = IdType.ID_WORKER)
protected Long sequenceNbr;
@TableField(value = "rec_date", fill = FieldFill.INSERT_UPDATE)
protected Date recDate;
@TableField(value = "rec_user_id", fill = FieldFill.INSERT_UPDATE)
protected String recUserId;
@TableField(value = "rec_user_name", fill = FieldFill.INSERT_UPDATE)
protected String recUserName;
/**
* 是否删除
*/
@TableField(value = "is_delete")
public Boolean isDelete=false;
@ApiModelProperty(value = "是否可以点击")
@TableField(exist = false)
public Boolean canClick;
}
\ No newline at end of file
package com.yeejoin.equipmanage.common.entity.dto;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
@Data
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value="OrgUsrDto", description="树菜单")
public class OrgUsrDto {
private String id;
private String name;
private String parentId;
private List<OrgUsrDto> children;
private String bizOrgCode;
private String code;
public Boolean canClick;
public OrgUsrDto(String id, String name, String parentId, String bizOrgCode, String code, Boolean canClick) {
super();
this.id = id;
this.name = name;
this.parentId = parentId;
this.bizOrgCode = bizOrgCode;
this.code = code;
this.canClick = canClick;
}
public OrgUsrDto() {
}
}
\ No newline at end of file
......@@ -2,12 +2,14 @@ package com.yeejoin.equipmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.entity.dto.OrgUsrDto;
import com.yeejoin.equipmanage.common.utils.*;
import com.yeejoin.equipmanage.config.PersonIdentify;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import com.yeejoin.equipmanage.service.IOrgUsrService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
......@@ -48,6 +50,9 @@ public class DCenterController extends AbstractBaseController {
@Autowired
IEquipmentSpecificSerivce specificService;
@Autowired
IOrgUsrService iOrgUsrService;
/**
* 直流中心告警列表分页,用于直流中心大数据查询分页,不建议再扩展联表查询
*/
......@@ -131,4 +136,34 @@ public class DCenterController extends AbstractBaseController {
return CommonResponseUtil.success(fireFightingSystemMapper.getCenterWaterInfo(page, bizOrgCode));
}
/**
* 换流站接入情况总览
*
* @return
*/
@GetMapping(value = "/station/connect/state")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel getStationConnectStatus() {
return CommonResponseUtil.success(fireFightingSystemService.getStationConnectStatus());
}
/**
* 换流站接入状态统计
*
* @return
*/
@GetMapping(value = "/station/status/statistics")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel getStationStatusStatistics() {
return CommonResponseUtil.success(fireFightingSystemService.getStationStatusStatistics());
}
@RequestMapping(value = "/companyTree", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "电力公司树", notes = "电力公司树")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel<List<OrgUsrDto>> companyTreeByUserAndType() {
List<OrgUsrDto> menus = iOrgUsrService.getCompanyTree();
return CommonResponseUtil.success(menus);
}
}
package com.yeejoin.equipmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.entity.publics.CommonResponse;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.utils.ResponseUtils;
import com.yeejoin.equipmanage.common.vo.UnitAreaTreeVo;
import com.yeejoin.equipmanage.service.IEmergencyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.tomcat.util.http.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
/**
*
......@@ -34,6 +33,8 @@ public class EmergencyController extends AbstractBaseController {
@Autowired
IEmergencyService iEmergencyService;
@Autowired
IEmergencyService iEmergencyService;
/**
* 通过bizOrgCode过滤
*/
......@@ -58,4 +59,86 @@ public class EmergencyController extends AbstractBaseController {
return CommonResponseUtil.success(iEmergencyService.getCAFSWaterTankInfo(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("应急物资")
@GetMapping(value = "/emergencyMaterials")
public Map<String, Object> emergencyMaterials(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode ) {
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.emergencyMaterials(bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("应急物资-详情")
@GetMapping(value = "/emergencyMaterialsDetails")
public Page<Map<String, Object>> emergencyMaterialsDetails(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode ,
@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageSize") int pageSize) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.emergencyMaterialsDetails(page, bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防炮列表")
@GetMapping(value = "/fireMonitor")
public Page<Map<String, Object>> selectFireMonitor(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageSize") int pageSize) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.selectFireMonitor(page, bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("泡沫罐列表")
@GetMapping(value = "/selectFoamTank")
public Page<Map<String, Object>> selectFoamTank(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageSize") int pageSize
) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.selectFoamTank(page, bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("排油系统列表")
@GetMapping(value = "/selectOilDrainage")
public Page<Map<String, Object>> selectOilDrainage(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode ,
@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageSize") int pageSize) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.selectOilDrainage(page, bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("压力流量")
@GetMapping(value = "/selectPressureFlow")
public Page<Map<String, Object>> selectPressureFlow(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode ,
@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageSize") int pageSize) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.selectPressureFlow(page, bizOrgCode);
}
}
package com.yeejoin.equipmanage.mapper;
import liquibase.pro.packaged.M;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import java.util.Map;
......@@ -10,7 +11,51 @@ import java.util.Map;
* Mapper 接口
*
*/
public interface EmergencyMapper {
public interface EmergencyMapper extends BaseMapper{
/**
* 应急物资列表
* @param bizOrgCode
* @return
*/
Map<String, Object> selectEmergencyMaterials(@Param("bizOrgCode") String bizOrgCode);
/**
* 应急物资详情
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> selectEmergencyMaterialsDetails(Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode);
/**
* 消防炮列表
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> selectFireMonitor(Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode);
/**
* 泡沫罐
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> selectFoamTank(Page<Map<String, Object>> page , @Param("bizOrgCode") String bizOrgCode);
/**
* 排油系统
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page , @Param("bizOrgCode") String bizOrgCode);
/**
* 压力流量
* @param page
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page , @Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getSystemState(@Param("bizOrgCode") String bizOrgCode);
......
......@@ -634,4 +634,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Map<String, Object> getWaterlevelUnit();
Map<String, Object> getStationConnectStatus();
List<Map<String, Object>> getStationStatusStatistics();
}
package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.OrgUsr;
import java.util.List;
public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<OrgUsr> getCompanyTree();
}
\ No newline at end of file
package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import java.util.Map;
......@@ -19,4 +21,16 @@ public interface IEmergencyService {
* @return
*/
List<Map<String, Object>> getCAFSWaterTankInfo(String bizOrgCode);
Map<String, Object> emergencyMaterials(String bizOrgCode);
Page<Map<String, Object>> emergencyMaterialsDetails(Page<Map<String, Object>> page, String bizOrgCode);
Page<Map<String, Object>> selectFireMonitor(Page<Map<String, Object>> page, String bizOrgCode);
Page<Map<String, Object>> selectFoamTank(Page<Map<String, Object>> page, String bizOrgCode);
Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page, String bizOrgCode);
Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode);
}
......@@ -302,4 +302,8 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Map<String, Object> getSystemDetailByCode(String systemCode);
Map<String, Object> getStationConnectStatus();
List<Map<String, Object>> getStationStatusStatistics();
}
package com.yeejoin.equipmanage.service;
import com.yeejoin.equipmanage.common.entity.dto.OrgUsrDto;
import java.util.List;
/**
* 机构/部门/人员表 服务类
*
* @author tb
* @date 2021-06-18
*/
public interface IOrgUsrService {
List<OrgUsrDto> getCompanyTree();
}
package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.mapper.EmergencyMapper;
import com.yeejoin.equipmanage.service.IEmergencyService;
import org.apache.commons.compress.utils.Lists;
......@@ -32,4 +33,34 @@ public class EmergencyServiceImpl implements IEmergencyService {
List<Map<String, Object>> list = emergencyMapper.getCAFSWaterTankInfo(bizOrgCode);
return Optional.ofNullable(list).orElse(Lists.newArrayList());
}
@Override
public Map<String, Object> emergencyMaterials(String bizOrgCode) {
return emergencyMapper.selectEmergencyMaterials(bizOrgCode);
}
@Override
public Page<Map<String, Object>> emergencyMaterialsDetails(Page<Map<String, Object>> page, String bizOrgCode) {
return emergencyMapper.selectEmergencyMaterialsDetails(page , bizOrgCode);
}
@Override
public Page<Map<String, Object>> selectFireMonitor(Page<Map<String, Object>> page, String bizOrgCode) {
return emergencyMapper.selectFireMonitor(page, bizOrgCode);
}
@Override
public Page<Map<String, Object>> selectFoamTank(Page<Map<String, Object>> page, String bizOrgCode) {
return emergencyMapper.selectFoamTank(page, bizOrgCode);
}
@Override
public Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page, String bizOrgCode) {
return emergencyMapper.selectOilDrainage(page, bizOrgCode);
}
@Override
public Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode) {
return emergencyMapper.selectPressureFlow(page, bizOrgCode);
}
}
......@@ -2173,4 +2173,20 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
});
return result;
}
@Override
public Map<String, Object> getStationConnectStatus() {
Map<String, Object> map = new HashMap<>();
Map<String, Object> resultMap = fireFightingSystemMapper.getStationConnectStatus();
map.put("online", resultMap.get("online"));
map.put("notOnline", resultMap.get("notOnline"));
return map;
}
@Override
public List<Map<String, Object>> getStationStatusStatistics() {
return fireFightingSystemMapper.getStationStatusStatistics();
}
}
......@@ -899,6 +899,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipmentSpecificAlarm.setEmergencyLevelDescribe(equipmentSpecificIndex.getEmergencyLevelDescribe());
equipmentSpecificAlarm.setBizOrgCode(equipmentSpecificIndex.getBizOrgCode());
equipmentSpecificAlarm.setBizOrgName(equipmentSpecificIndex.getBizOrgName());
equipmentSpecificAlarm.setStationCode(stationCode);
equipmentSpecificAlarm.setStationName(stationName);
equipmentSpecificAlarms.add(equipmentSpecificAlarm);
return equipmentSpecificAlarms;
}
......@@ -1392,7 +1394,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
public void updateNodeDateByEquipId(List<EquipmentSpecificIndex> indexList) {
if (!ObjectUtils.isEmpty(indexList)) {
EquipmentVo equipmentVo = equipmentService.getEquipBySpecific(indexList.get(0).getEquipmentSpecificId());
if (equipmentVo.getIsIot().equals("1")) {
if ("1".equals(equipmentVo.getIsIot())) {
List<EquipmentSpecificAlarm> alarmList = equipmentSpecificAlarmService.getEquipListBySpecific(true,
indexList.get(0).getEquipmentSpecificId());
topographyService.updateNodeDateByEquipId(indexList.get(0).getEquipmentSpecificId(), indexList,
......
package com.yeejoin.equipmanage.service.impl;
import com.yeejoin.equipmanage.common.entity.OrgUsr;
import com.yeejoin.equipmanage.common.entity.dto.OrgUsrDto;
import com.yeejoin.equipmanage.mapper.OrgUsrMapper;
import com.yeejoin.equipmanage.service.IOrgUsrService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class OrgUsrServiceImpl implements IOrgUsrService {
private final Logger logger = LoggerFactory.getLogger(OrgUsrServiceImpl.class);
@Autowired
OrgUsrMapper orgUsrMapper;
@Override
public List<OrgUsrDto> getCompanyTree(){
List<OrgUsr> list = orgUsrMapper.getCompanyTree();
return buildCompanyTree(list);
}
public static List<OrgUsrDto> buildCompanyTree(List<OrgUsr> list) {
List<OrgUsrDto> menuList = list.stream()
.map(o -> new OrgUsrDto(String.valueOf(o.getSequenceNbr()), o.getBizOrgName(),
ObjectUtils.isEmpty(o.getParentId()) ? "0" : String.valueOf(o.getParentId()),
o.getBizOrgCode(), o.getCode(), o.getCanClick())).collect(Collectors.toList());
List<OrgUsrDto> result = new ArrayList<>();
Map<String, OrgUsrDto> map = new HashMap<>(menuList.size());
menuList.forEach(e -> map.put(e.getId(), e));
Set<? extends Map.Entry<String, ? extends OrgUsrDto>> entries = map.entrySet();
entries.forEach(entry -> {
OrgUsrDto value = entry.getValue();
if (value != null) {
OrgUsrDto treeDto = map.get(value.getParentId());
if (treeDto != null) {
List<OrgUsrDto> children = treeDto.getChildren();
if (children == null) {
children = new ArrayList<>();
treeDto.setChildren(children);
}
children.add(value);
} else {
result.add(value);
}
}
});
return result;
}
}
\ No newline at end of file
......@@ -284,9 +284,10 @@
wlesal.equipment_specific_name as equipmentSpecificName,
wlesal.location,
wlesal.station_code AS stationCode,
wlesal.station_name AS stationName
wlesal.biz_org_name AS stationName
FROM wl_equipment_specific_alarm_log wlesal
<where>
wlesal.clean_time IS NULL
<if test="param.alarmType == 'BREAKDOWN'">AND wlesal.type = #{param.alarmType}</if>
<if test="param.alarmType == 'FIREALARM'">AND wlesal.type = #{param.alarmType}</if>
<if test="param.isFireAlarm == 'false'">AND wlesal.type != 'FIREALARM'</if>
......
......@@ -5440,4 +5440,53 @@
<select id="getWaterlevelUnit" resultType="java.util.Map">
SELECT unit FROM `wl_equipment_index` WHERE name_key = 'FHS_FirePoolDevice_WaterLevel'
</select>
<select id="getStationConnectStatus" resultType="java.util.Map">
SELECT
SUM(a.`online`) AS `online`,
SUM(a.`notOnline`) AS `notOnline`
FROM
(
SELECT
IF(si.`online` = 1, 1, 0) 'online',
IF(si.`online` !=1, 1, 0) 'notOnline'
FROM
idx_biz_station_info si
GROUP BY
si.`code`
) a
</select>
<select id="getStationStatusStatistics" resultType="java.util.Map">
SELECT
s.`code`,
s.`name`,
IF
( s.total > 0, 1, 0 ) AS `status`
FROM
(
SELECT
si.id,
si.`code`,
si.`name`,
SUM(
IF
(
( wesa.`status` = 1 AND wesa.equipment_specific_index_value = 'true' ),
1,
0
)
) AS total
FROM
idx_biz_station_info si
LEFT JOIN wl_equipment_specific_alarm wesa ON si.`code` = wesa.station_code
WHERE
si.ONLINE = 1
GROUP BY
si.id
) s
GROUP BY
s.id
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.equipmanage.mapper.OrgUsrMapper">
<select id="getCompanyTree" resultType="com.yeejoin.equipmanage.common.entity.OrgUsr">
SELECT
usr.sequence_nbr,
usr.biz_org_name,
usr.biz_org_code,
usr.parent_id,
usr.`code`,
CASE
WHEN ibsi.`code` = usr.`code` THEN
1 ELSE 0
END AS canClick
FROM
cb_org_usr usr
LEFT JOIN idx_biz_station_info ibsi ON ibsi.`code` = usr.`code`
WHERE
usr.biz_org_type = 'COMPANY'
AND usr.is_delete = 0
</select>
</mapper>
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