Parcourir la source

电缆信息列表、电缆概览信息

zhj il y a 2 ans
Parent
commit
2877e7155d

+ 70 - 0
src/main/java/com/welampiot/controller/CableController.java

@@ -0,0 +1,70 @@
+package com.welampiot.controller;
+
+import com.welampiot.common.BaseResult;
+import com.welampiot.dto.CableDTO;
+import com.welampiot.service.CableService;
+import com.welampiot.utils.ToolUtils;
+import com.welampiot.vo.CableVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * ClassName: CableController
+ * Package: com.welampiot.controller
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/4/21 - 11:42
+ * @Version: v1.0
+ */
+@RestController
+@CrossOrigin
+@RequestMapping("/api/cable")
+public class CableController {
+    @Autowired
+    private CableService cableService;
+
+    @Autowired
+    private ToolUtils toolUtils;
+
+    /**
+     * 获取电缆信息列表
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/devList", method = RequestMethod.POST)
+    public BaseResult<CableDTO> devList(HttpServletRequest request){
+        int page = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page"));
+        int count = request.getParameter("count") == null ? 16 : Integer.parseInt(request.getParameter("count"));
+        String keyword = request.getParameter("keyword") == null ? "" : request.getParameter("keyword");
+
+        CableDTO dto = new CableDTO();
+        dto.setPage(count * (page - 1));
+        dto.setCount(count);
+        dto.setKeyword(keyword);
+        dto.setSectionList(toolUtils.getSectionList(request));
+
+        CableVO vo = cableService.getDevListByCableDTO(dto);
+        return BaseResult.success(vo);
+    }
+
+    /**
+     * 获取电缆概览信息
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/data", method = RequestMethod.POST)
+    public BaseResult<CableDTO> data(HttpServletRequest request){
+        String keyword = request.getParameter("keyword") == null ? "" : request.getParameter("keyword");
+        CableDTO dto = new CableDTO();
+        dto.setKeyword(keyword);
+        dto.setSectionList(toolUtils.getSectionList(request));
+        CableVO vo = cableService.getDataByCableDTO(dto);
+        return BaseResult.success(vo);
+    }
+}

+ 36 - 0
src/main/java/com/welampiot/dao/CableDao.java

@@ -0,0 +1,36 @@
+package com.welampiot.dao;
+
+import com.welampiot.dto.CableDTO;
+
+import java.util.List;
+
+/**
+ * ClassName: CableDao
+ * Package: com.welampiot.dao
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/4/21 - 10:43
+ * @Version: v1.0
+ */
+public interface CableDao {
+    List<CableDTO> getDevListByCableDTO(CableDTO dto);
+
+    Integer getTotalByCableDTO(CableDTO dto);
+
+    Integer getOnlineTotalByCableDTO(CableDTO dto);
+
+    Integer getTempAlarmTotalByCableDTO(CableDTO dto);
+
+    Integer getWaterAlarmTotalByCableDTO(CableDTO dto);
+
+    Integer getManholeAlarmTotalByCableDTO(CableDTO dto);
+
+    Integer getCh4AlarmTotalByCableDTO(CableDTO dto);
+
+    Integer getCo2AlarmTotalByCableDTO(CableDTO dto);
+
+    Integer getH2sAlarmTotalByCableDTO(CableDTO dto);
+
+    Integer getO2AlarmTotalByCableDTO(CableDTO dto);
+}

+ 177 - 0
src/main/java/com/welampiot/dto/CableDTO.java

@@ -0,0 +1,177 @@
+package com.welampiot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * ClassName: CableDTO
+ * Package: com.welampiot.dto
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/4/21 - 10:24
+ * @Version: v1.0
+ */
+@Data
+public class CableDTO implements Serializable {
+    /** 主键 **/
+    private Integer id;
+
+    /** 灯杆id **/
+    private Integer lampPoleId;
+
+    /** 设备地址 **/
+    private String address;
+
+    /** 设备名称 **/
+    private String name;
+
+    /** 网络类型(0 485,1 nb,2 4G)**/
+    private Integer type;
+
+    /** 在线状态(0 离线,1 在线)**/
+    private Integer online;
+
+    /** 井盖1X轴角度 **/
+    private  String manhole1X;
+
+    /** 井盖1Y轴角度 **/
+    private  String manhole1Y;
+
+    /** 井盖1Z轴角度 **/
+    private  String manhole1Z;
+
+    /** 井盖1电池电压 **/
+    private String manhole1V;
+
+    /** 井盖1故障状态 **/
+    private Integer manhole1A;
+
+    /** 井盖2X轴角度 **/
+    private  String manhole2X;
+
+    /** 井盖2Y轴角度 **/
+    private  String manhole2Y;
+
+    /** 井盖2Z轴角度 **/
+    private  String manhole2Z;
+
+    /** 井盖2电池电压 **/
+    private String manhole2V;
+
+    /** 井盖2故障状态 **/
+    private Integer manhole2A;
+
+    /** 井盖3X轴角度 **/
+    private  String manhole3X;
+
+    /** 井盖3Y轴角度 **/
+    private  String manhole3Y;
+
+    /** 井盖3Z轴角度 **/
+    private  String manhole3Z;
+
+    /** 井盖3电池电压 **/
+    private String manhole3V;
+
+    /** 井盖3故障状态 **/
+    private Integer manhole3A;
+
+    /** 井盖4X轴角度 **/
+    private  String manhole4X;
+
+    /** 井盖4Y轴角度 **/
+    private  String manhole4Y;
+
+    /** 井盖4Z轴角度 **/
+    private  String manhole4Z;
+
+    /** 井盖4电池电压 **/
+    private String manhole4V;
+
+    /** 井盖4故障状态 **/
+    private Integer manhole4A;
+
+    /** 井盖5X轴角度 **/
+    private  String manhole5X;
+
+    /** 井盖5Y轴角度 **/
+    private  String manhole5Y;
+
+    /** 井盖5Z轴角度 **/
+    private  String manhole5Z;
+
+    /** 井盖5电池电压 **/
+    private String manhole5V;
+
+    /** 井盖5故障状态 **/
+    private Integer manhole5A;
+
+    /** 1号温度值 **/
+    private String temperature1T;
+
+    /** 1号温度电池电压 **/
+    private String temperature1V;
+
+    /** 1号温度告警状态 **/
+    private Integer temperature1A;
+
+    /** 2号温度值 **/
+    private String temperature2T;
+
+    /** 2号温度电池电压 **/
+    private String temperature2V;
+
+    /** 2号温度告警状态 **/
+    private Integer temperature2A;
+
+    /** 3号温度值 **/
+    private String temperature3T;
+
+    /** 3号温度电池电压 **/
+    private String temperature3V;
+
+    /** 3号温度告警状态 **/
+    private Integer temperature3A;
+
+    /** 水浸值 **/
+    private Integer waterW;
+
+    /** 水浸电池电压 **/
+    private String waterV;
+
+    /** 水浸告警状态 **/
+    private Integer waterA;
+
+    private Integer ch4;
+
+    private Integer co;
+
+    private Integer h2s;
+
+    private String o2;
+
+    private String gasV;
+
+    private Integer gasA;
+
+    private String updateTime;
+
+    private String installTime;
+
+    private String expirationDate;
+
+    private List<Integer> sectionList;
+
+    private Integer page;
+
+    private Integer count;
+
+    private Integer timezone;
+
+    private String keyword;
+
+    private static final long serialVersionUID = 1L;
+}

+ 19 - 0
src/main/java/com/welampiot/service/CableService.java

@@ -0,0 +1,19 @@
+package com.welampiot.service;
+
+import com.welampiot.dto.CableDTO;
+import com.welampiot.vo.CableVO;
+
+/**
+ * ClassName: CableService
+ * Package: com.welampiot.service
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/4/21 - 11:24
+ * @Version: v1.0
+ */
+public interface CableService {
+    CableVO getDevListByCableDTO(CableDTO dto);
+
+    CableVO getDataByCableDTO(CableDTO dto);
+}

+ 201 - 0
src/main/java/com/welampiot/service/impl/CableServiceImpl.java

@@ -0,0 +1,201 @@
+package com.welampiot.service.impl;
+
+import com.welampiot.dao.CableDao;
+import com.welampiot.dto.CableDTO;
+import com.welampiot.service.CableService;
+import com.welampiot.vo.CableVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * ClassName: CableServiceImpl
+ * Package: com.welampiot.service.impl
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/4/21 - 11:25
+ * @Version: v1.0
+ */
+@Service
+public class CableServiceImpl implements CableService {
+    @Autowired
+    private CableDao cableDao;
+
+    @Override
+    public CableVO getDevListByCableDTO(CableDTO dto) {
+        CableVO vo = new CableVO();
+        List<CableDTO> devList = cableDao.getDevListByCableDTO(dto);
+        List<CableDTO> list = new ArrayList<>();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        devList.forEach(cableDTO ->{
+            if (cableDTO.getOnline() != null && cableDTO.getOnline() == 1){
+                cableDTO.setOnline(1);
+            }else {
+                cableDTO.setOnline(0);
+            }
+            if (cableDTO.getType() != null && cableDTO.getType() == 2){
+                cableDTO.setType(2);
+            }else if (cableDTO.getType() != null && cableDTO.getType() == 1){
+                cableDTO.setType(1);
+            }else {
+                cableDTO.setType(0);
+            }
+            if (cableDTO.getManhole1A() != null && cableDTO.getManhole1A() == 0){
+                cableDTO.setManhole1A(0);
+            }
+            if (cableDTO.getManhole2A() != null && cableDTO.getManhole2A() == 0){
+                cableDTO.setManhole2A(0);
+            }
+            if (cableDTO.getManhole2A() != null && cableDTO.getManhole2A() == 0){
+                cableDTO.setManhole2A(0);
+            }
+            if (cableDTO.getManhole3A() != null && cableDTO.getManhole3A() == 0){
+                cableDTO.setManhole3A(0);
+            }
+            if (cableDTO.getManhole4A() != null && cableDTO.getManhole4A() == 0){
+                cableDTO.setManhole4A(0);
+            }
+            if (cableDTO.getManhole5A() != null && cableDTO.getManhole5A() == 0){
+                cableDTO.setManhole5A(0);
+            }
+            if (cableDTO.getTemperature1A() != null && cableDTO.getTemperature1A() == 0){
+                cableDTO.setTemperature1A(0);
+            }
+            if (cableDTO.getTemperature2A() != null && cableDTO.getTemperature2A() == 0){
+                cableDTO.setTemperature2A(0);
+            }
+            if (cableDTO.getTemperature3A() != null && cableDTO.getTemperature3A() == 0){
+                cableDTO.setTemperature3A(0);
+            }
+            if (cableDTO.getGasA() != null && cableDTO.getGasA() == 0){
+                cableDTO.setGasA(0);
+            }
+            if (cableDTO.getUpdateTime() != null && !cableDTO.getUpdateTime().equals("")){
+                Date cmdTime;
+                try {
+                    cmdTime = simpleDateFormat.parse(cableDTO.getUpdateTime());
+                } catch (ParseException e) {
+                    throw new RuntimeException(e);
+                }
+                //判断时区,为null默认东八区
+                long timezone = cableDTO.getTimezone() == null ? 8 : cableDTO.getTimezone();
+                long l = cmdTime.getTime() + timezone * 3600 * 1000;
+                cmdTime = new Date(l);
+                cableDTO.setUpdateTime(simpleDateFormat.format(cmdTime));
+            }else {
+                cableDTO.setUpdateTime("");
+            }
+            if (cableDTO.getManhole1V() == null || cableDTO.getManhole1V().equals("0.0")){
+                cableDTO.setManhole1V("0");
+            }
+            if (cableDTO.getManhole1X() == null || cableDTO.getManhole1X().equals("0.0")){
+                cableDTO.setManhole1X("0");
+            }
+            if (cableDTO.getManhole1Y() == null || cableDTO.getManhole1Y().equals("0.0")){
+                cableDTO.setManhole1Y("0");
+            }
+            if (cableDTO.getManhole1Z() == null || cableDTO.getManhole1Z().equals("0.0")){
+                cableDTO.setManhole1Z("0");
+            }
+            if (cableDTO.getManhole2V() == null || cableDTO.getManhole2V().equals("0.0")){
+                cableDTO.setManhole2V("0");
+            }
+            if (cableDTO.getManhole2X() == null || cableDTO.getManhole2X().equals("0.0")){
+                cableDTO.setManhole2X("0");
+            }
+            if (cableDTO.getManhole2Y() == null || cableDTO.getManhole2Y().equals("0.0")){
+                cableDTO.setManhole2Y("0");
+            }
+            if (cableDTO.getManhole2Z() == null || cableDTO.getManhole2Z().equals("0.0")){
+                cableDTO.setManhole2Z("0");
+            }
+            if (cableDTO.getManhole3V() == null || cableDTO.getManhole3V().equals("0.0")){
+                cableDTO.setManhole3V("0");
+            }
+            if (cableDTO.getManhole3X() == null || cableDTO.getManhole3X().equals("0.0")){
+                cableDTO.setManhole3X("0");
+            }
+            if (cableDTO.getManhole3Y() == null || cableDTO.getManhole3Y().equals("0.0")){
+                cableDTO.setManhole3Y("0");
+            }
+            if (cableDTO.getManhole3Z() == null || cableDTO.getManhole3Z().equals("0.0")){
+                cableDTO.setManhole3Z("0");
+            }
+            if (cableDTO.getManhole4V() == null || cableDTO.getManhole4V().equals("0.0")){
+                cableDTO.setManhole4V("0");
+            }
+            if (cableDTO.getManhole4X() == null || cableDTO.getManhole4X().equals("0.0")){
+                cableDTO.setManhole4X("0");
+            }
+            if (cableDTO.getManhole4Y() == null || cableDTO.getManhole4Y().equals("0.0")){
+                cableDTO.setManhole4Y("0");
+            }
+            if (cableDTO.getManhole4Z() == null || cableDTO.getManhole4Z().equals("0.0")){
+                cableDTO.setManhole4Z("0");
+            }
+            if (cableDTO.getManhole5V() == null || cableDTO.getManhole5V().equals("0.0")){
+                cableDTO.setManhole5V("0");
+            }
+            if (cableDTO.getManhole5X() == null || cableDTO.getManhole5X().equals("0.0")){
+                cableDTO.setManhole5X("0");
+            }
+            if (cableDTO.getManhole5Y() == null || cableDTO.getManhole5Y().equals("0.0")){
+                cableDTO.setManhole5Y("0");
+            }
+            if (cableDTO.getManhole5Z() == null || cableDTO.getManhole5Z().equals("0.0")){
+                cableDTO.setManhole5Z("0");
+            }
+            if (cableDTO.getTemperature1T() == null || cableDTO.getTemperature1T().equals("0.0")){
+                cableDTO.setTemperature1T("0");
+            }
+            if (cableDTO.getTemperature1V() == null || cableDTO.getTemperature1V().equals("0.0")){
+                cableDTO.setTemperature1V("0");
+            }
+            if (cableDTO.getTemperature2T() == null || cableDTO.getTemperature2T().equals("0.0")){
+                cableDTO.setTemperature2T("0");
+            }
+            if (cableDTO.getTemperature2V() == null || cableDTO.getTemperature2V().equals("0.0")){
+                cableDTO.setTemperature2V("0");
+            }
+            if (cableDTO.getTemperature3T() == null || cableDTO.getTemperature3T().equals("0.0")){
+                cableDTO.setTemperature3T("0");
+            }
+            if (cableDTO.getTemperature3V() == null || cableDTO.getTemperature3V().equals("0.0")){
+                cableDTO.setTemperature3V("0");
+            }
+            if (cableDTO.getWaterV() == null || cableDTO.getWaterV().equals("0.0")){
+                cableDTO.setWaterV("0");
+            }
+            if (cableDTO.getGasV() == null || cableDTO.getGasV().equals("0.0")){
+                cableDTO.setGasV("0");
+            }
+            if (cableDTO.getO2() == null || cableDTO.getO2().equals("0.0")){
+                cableDTO.setO2("0");
+            }
+            list.add(cableDTO);
+        });
+        vo.setList(list);
+        return vo;
+    }
+
+    @Override
+    public CableVO getDataByCableDTO(CableDTO dto) {
+        CableVO vo = new CableVO();
+        vo.setTotal(cableDao.getTotalByCableDTO(dto));
+        vo.setOnlineCount(cableDao.getOnlineTotalByCableDTO(dto));
+        vo.setTempAlarmCount(cableDao.getTempAlarmTotalByCableDTO(dto));
+        vo.setWaterAlarmCount(cableDao.getWaterAlarmTotalByCableDTO(dto));
+        vo.setManholeAlarmCount(cableDao.getManholeAlarmTotalByCableDTO(dto));
+        vo.setCh4AlarmCount(cableDao.getCh4AlarmTotalByCableDTO(dto));
+        vo.setCo2AlarmCount(cableDao.getCo2AlarmTotalByCableDTO(dto));
+        vo.setH2sAlarmCount(cableDao.getH2sAlarmTotalByCableDTO(dto));
+        vo.setO2AlarmCount(cableDao.getO2AlarmTotalByCableDTO(dto));
+        return vo;
+    }
+}

+ 42 - 0
src/main/java/com/welampiot/vo/CableVO.java

@@ -0,0 +1,42 @@
+package com.welampiot.vo;
+
+import com.welampiot.dto.CableDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * ClassName: CableVO
+ * Package: com.welampiot.vo
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/4/21 - 11:21
+ * @Version: v1.0
+ */
+@Data
+public class CableVO implements Serializable {
+
+    private Integer total;//设备总数
+
+    private Integer onlineCount;//在线数
+
+    private Integer tempAlarmCount;//高温告警数
+
+    private Integer waterAlarmCount;//水浸告警数
+
+    private Integer manholeAlarmCount;//井盖位移告警数
+
+    private Integer ch4AlarmCount;//ch4告警数
+
+    private Integer co2AlarmCount;//co2告警数
+
+    private Integer h2sAlarmCount;//h2s告警数
+
+    private Integer o2AlarmCount;//o2告警数
+
+    private List<CableDTO> list;
+
+    private static final long serialVersionUID = 1L;
+}

+ 177 - 0
src/main/resources/mapper/CableMapper.xml

@@ -0,0 +1,177 @@
+<?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.welampiot.dao.CableDao">
+
+    <select id="getDevListByCableDTO" resultType="CableDTO">
+        select c.id,c.name,c.online,c.type,c.manhole1_X manhole1X,c.manhole1_Y manhole1Y,c.manhole1_Z manhole1Z,
+               c.manhole1_V manhole1V,c.manhole1_A manhole1A,c.manhole2_X manhole2X,c.manhole2_Y manhole2Y,c.manhole2_Z manhole2Z,
+               c.manhole2_V manhole2V,c.manhole2_A manhole2A,c.manhole3_X manhole3X,c.manhole3_Y manhole3Y,c.manhole3_Z manhole3Z,
+               c.manhole3_V manhole3V,c.manhole3_A manhole3A,c.manhole4_X manhole4X,c.manhole4_Y manhole4Y,c.manhole4_Z manhole4Z,
+               c.manhole4_V manhole4V,c.manhole4_A manhole4A,c.manhole5_X manhole5X,c.manhole5_Y manhole5Y,c.manhole5_Z manhole5Z,
+               c.manhole5_V manhole5V,c.manhole5_A manhole5A,c.temperature1_T temperature1T,c.temperature1_V temperature1V,
+               c.temperature1_A temperature1A,c.temperature2_T temperature2T,c.temperature2_V temperature2V,c.temperature2_A temperature2A,
+               c.temperature3_T temperature3T,c.temperature3_V temperature3V,c.temperature3_A temperature3A,c.water_W waterW,c.water_V waterV,
+               c.water_A waterA,c.ch4,c.co,c.h2s,c.o2,c.gas_V gasV,c.gas_A gasA,c.updatetime as updateTime,s.timezone
+        from cable c left join lamp_pole lp on lp.id = c.lamp_pole_id
+                     left join section s on lp.sectionid = s.id
+        where 1=1
+            <if test="keyword != null and keyword != ''">
+                and (c.name like '%${keyword}%' or c.address like '%${keyword}%')
+            </if>
+            <if test="sectionList != null and !sectionList.isEmpty()">
+                and lp.sectionid in
+                <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                    #{dto}
+                </foreach>
+            </if>
+            order by convert(c.name using gbk) asc,c.id desc
+            <if test="page >= 0 and count > 0">
+                limit #{page},#{count}
+            </if>
+    </select>
+
+    <!-- 设备总数 -->
+    <select id="getTotalByCableDTO" resultType="Integer">
+        select count(c.id) as total
+        from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
+        where 1=1
+            <if test="sectionList != null and !sectionList.isEmpty()">
+                and lp.sectionid in
+                <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                    #{dto}
+                </foreach>
+            </if>
+            <if test="keyword != null and keyword != ''">
+                and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
+            </if>
+    </select>
+
+    <!-- 在线数 -->
+    <select id="getOnlineTotalByCableDTO" resultType="Integer">
+        select count(c.id) as total
+        from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
+        where c.online = 1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and lp.sectionid in
+            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                #{dto}
+            </foreach>
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
+        </if>
+    </select>
+
+    <!-- 高温告警数 -->
+    <select id="getTempAlarmTotalByCableDTO" resultType="Integer">
+        select count(c.id) as total
+        from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
+        where c.online = 1 and (c.temperature1_A != 0 or c.temperature2_A != 0 or c.temperature3_A != 0)
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and lp.sectionid in
+            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                #{dto}
+            </foreach>
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
+        </if>
+    </select>
+
+    <!-- 水浸告警数 -->
+    <select id="getWaterAlarmTotalByCableDTO" resultType="Integer">
+        select count(c.id) as total
+        from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
+        where c.online = 1 and c.water_A != 0
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and lp.sectionid in
+            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                #{dto}
+            </foreach>
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
+        </if>
+    </select>
+
+    <!-- 井盖位移告警数 -->
+    <select id="getManholeAlarmTotalByCableDTO" resultType="Integer">
+        select count(c.id) as total
+        from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
+        where c.online = 1 and (c.manhole1_A != 0 or c.manhole2_A != 0 or c.manhole3_A != 0 or c.manhole4_A != 0 or c.manhole5_A != 0)
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and lp.sectionid in
+            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                #{dto}
+            </foreach>
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
+        </if>
+    </select>
+
+    <!-- ch4告警数 -->
+    <select id="getCh4AlarmTotalByCableDTO" resultType="Integer">
+        select count(c.id) as total
+        from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
+        where c.online = 1 and c.gas_A = 1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and lp.sectionid in
+            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                #{dto}
+            </foreach>
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
+        </if>
+    </select>
+
+    <!-- co2告警数 -->
+    <select id="getCo2AlarmTotalByCableDTO" resultType="Integer">
+        select count(c.id) as total
+        from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
+        where c.online = 1 and c.gas_A = 2
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and lp.sectionid in
+            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                #{dto}
+            </foreach>
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
+        </if>
+    </select>
+
+    <!-- h2s告警数 -->
+    <select id="getH2sAlarmTotalByCableDTO" resultType="Integer">
+        select count(c.id) as total
+        from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
+        where c.online = 1 and c.gas_A = 4
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and lp.sectionid in
+            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                #{dto}
+            </foreach>
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
+        </if>
+    </select>
+
+    <!-- o2告警数 -->
+    <select id="getO2AlarmTotalByCableDTO" resultType="Integer">
+        select count(c.id) as total
+        from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
+        where c.online = 1 and c.gas_A = 8
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and lp.sectionid in
+            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                #{dto}
+            </foreach>
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
+        </if>
+    </select>
+
+</mapper>