소스 검색

井盖管理接口

zhj 2 년 전
부모
커밋
f9e91e5cd5

+ 90 - 0
src/main/java/com/welampiot/controller/ManholeController.java

@@ -0,0 +1,90 @@
+package com.welampiot.controller;
+
+import com.welampiot.common.BaseResult;
+import com.welampiot.dto.ManholeDTO;
+import com.welampiot.service.ManholeService;
+import com.welampiot.utils.ToolUtils;
+import com.welampiot.vo.ManholeVO;
+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: ManholeController
+ * Package: com.welampiot.controller
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/4/10 - 11:40
+ * @Version: v1.0
+ */
+@RestController
+@CrossOrigin
+@RequestMapping("/api/manholeController")
+public class ManholeController {
+
+    @Autowired
+    private ManholeService manholeService;
+
+    @Autowired
+    private ToolUtils toolUtils;
+
+    /**
+     * 获取井盖设备统计信息
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/data", method = RequestMethod.POST)
+    public BaseResult<ManholeDTO> data(HttpServletRequest request){
+        ManholeVO vo = manholeService.getDevTotalBySectionList(toolUtils.getSectionList(request));
+        return BaseResult.success(vo);
+    }
+
+    /**
+     * 获取井盖设备信息列表
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/getList", method = RequestMethod.POST)
+    public BaseResult<ManholeDTO> getList(HttpServletRequest request){
+        int version = request.getParameter("version") == null ? 0 : Integer.parseInt(request.getParameter("version"));
+        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 keywords = request.getParameter("keywords") == null ? "" : request.getParameter("keywords");
+
+        ManholeDTO dto = new ManholeDTO();
+        dto.setPage(count * (page - 1));
+        dto.setCount(count);
+        dto.setKeywords(keywords);
+        dto.setSectionList(toolUtils.getSectionList(request));
+
+        ManholeVO vo = manholeService.getListByDTO(dto, version);
+        if (vo == null) return toolUtils.response("0001",version);
+        return BaseResult.success(vo);
+    }
+
+    /**
+     * 获取井盖设备日志
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/historyList", method = RequestMethod.POST)
+    public BaseResult<ManholeDTO> historyList(HttpServletRequest request){
+        Integer id = request.getParameter("id") == null ? 0 : Integer.parseInt(request.getParameter("id"));
+        Integer page = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page"));
+        Integer count = request.getParameter("count") == null ? 16 : Integer.parseInt(request.getParameter("count"));
+
+        ManholeDTO dto = new ManholeDTO();
+        dto.setId(id);
+        dto.setPage(count * (page - 1));
+        dto.setCount(count);
+        dto.setSectionList(toolUtils.getSectionList(request));
+
+        ManholeVO vo = manholeService.getHistoryListByDTO(dto);
+        return BaseResult.success(vo);
+    }
+}

+ 31 - 0
src/main/java/com/welampiot/dao/ManholeDao.java

@@ -0,0 +1,31 @@
+package com.welampiot.dao;
+
+import com.welampiot.dto.ManholeDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * ClassName: ManholeDao
+ * Package: com.welampiot.dao
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/4/10 - 10:35
+ * @Version: v1.0
+ */
+public interface ManholeDao {
+    Integer getTotalBySectionList(@Param("sectionList") List<ManholeDTO> sectionList);
+
+    Integer getOnlineTotalBySectionList(@Param("sectionList") List<ManholeDTO> sectionList);
+
+    Integer getAlarmTotalBySectionList(@Param("sectionList") List<ManholeDTO> sectionList);
+
+    Integer getNormalTotalBySectionList(@Param("sectionList") List<ManholeDTO> sectionList);
+
+    List<ManholeDTO> getNewTotalBySectionList(@Param("sectionList") List<ManholeDTO> sectionList);
+
+    List<ManholeDTO> getListByDTO(ManholeDTO dto);
+
+    List<ManholeDTO> getHistoryListByDTO(ManholeDTO dto);
+}

+ 152 - 0
src/main/java/com/welampiot/dto/ManholeDTO.java

@@ -0,0 +1,152 @@
+package com.welampiot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * ClassName: ManholeDTO
+ * Package: com.welampiot.dto
+ * Description: 井盖信息表
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/4/10 - 10:01
+ * @Version: v1.0
+ */
+@Data
+public class ManholeDTO implements Serializable {
+    /** 主键 **/
+    private Integer id;
+
+    /** 路段、街道id **/
+    private Integer sectionId;
+
+    /** 设备地址 **/
+    private String address;
+
+    /** 设备创建时间(0时区时间)**/
+    private String createTime;
+
+    /** 设备名称 **/
+    private String name;
+
+    /** 设备在线状态(0 离线,1 在线) **/
+    private Integer online;
+
+    /** 设备倾斜角度 **/
+    private Integer angle;
+
+    /** x轴方向上倾斜角度 **/
+    private Float angleX;
+
+    /** y轴方向上倾斜角度 **/
+    private Float angleY;
+
+    /** z轴方向上倾斜角度 **/
+    private Float angleZ;
+
+    /** 经度 **/
+    private Double longitude;
+
+    /** 纬度 **/
+    private Double latitude;
+
+    /** 电池电压 **/
+    private Float batteryVol;
+
+    /** 故障状态(0 正常,1 故障) **/
+    private Integer alarmStatus;
+
+    /** 故障信息内容 **/
+    private String alarmInfo;
+
+    /** 设备状态信息更新时间(0时区时间)**/
+    private String updateTime;
+
+    /** 设备型号(0 WE-3001-ZHJG) **/
+    private Integer model;
+
+    /** 设备信号值 **/
+    private Integer signal;
+
+    /** 定位状态(0未定位,1定位)**/
+    private Integer status;
+
+    /** 0 打开恢复,1 打开告警 **/
+    private Integer openAlarm;
+
+    /** 0 满溢恢复,1 满溢告警 **/
+    private Integer overAlarm;
+
+    /** 0 气体恢复,1 气体告警 **/
+    private Integer airAlarm;
+
+    /** 拆除恢复,1 拆除告警 **/
+    private Integer disManAlarm;
+
+    /** 设备类型(0 井盖,1 灯杆倾斜监测)**/
+    private Integer type;
+
+    /** 协议(0:nb,1:rs485,2:gprs)**/
+    private Integer protocolType;
+
+    /** 云盒端口(0=3号串口,1=2号串口,2=1号串口)**/
+    private Integer port;
+
+    /** 设备号 **/
+    private String macNumber;
+
+    /** sim卡号 **/
+    private String simNumber;
+
+    /** 安装时间 **/
+    private String installDate;
+
+    /** 过期时间 **/
+    private String expirationDate;
+
+    /** 获取路段id **/
+    private List<ManholeDTO> sectionList;
+
+    /** 页码 **/
+    private Integer page;
+
+    /** 一页显示数量 **/
+    private Integer count;
+
+    /** 关键字搜索(可搜索设备名称跟设备地址) **/
+    private String keywords;
+
+    /** 时区 **/
+    private Integer timezone;
+
+    /** 区域名称 **/
+    private String area;
+
+    private String chArea;
+
+    private String enArea;
+
+    private String ruArea;
+
+    /** 路段名称 **/
+    private String section;
+
+    /** 城市名称 **/
+    private String city;
+
+    private String chCity;
+
+    private String enCity;
+
+    private String ruCity;
+
+    /** 设备位置信息 **/
+    private String location;
+
+    /** 设备总数 **/
+    private Integer total;
+
+    private static final long serialVersionUID = 1L;
+}

+ 23 - 0
src/main/java/com/welampiot/service/ManholeService.java

@@ -0,0 +1,23 @@
+package com.welampiot.service;
+
+import com.welampiot.dto.ManholeDTO;
+import com.welampiot.vo.ManholeVO;
+
+import java.util.List;
+
+/**
+ * ClassName: ManholeService
+ * Package: com.welampiot.service
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/4/10 - 10:55
+ * @Version: v1.0
+ */
+public interface ManholeService {
+    ManholeVO getDevTotalBySectionList(List<ManholeDTO> sectionList);
+
+    ManholeVO getListByDTO(ManholeDTO dto, Integer version);
+
+    ManholeVO getHistoryListByDTO(ManholeDTO dto);
+}

+ 225 - 0
src/main/java/com/welampiot/service/impl/ManholeServiceImpl.java

@@ -0,0 +1,225 @@
+package com.welampiot.service.impl;
+
+import com.welampiot.dao.ManholeDao;
+import com.welampiot.dto.ManholeDTO;
+import com.welampiot.service.ManholeService;
+import com.welampiot.vo.ManholeVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * ClassName: ManholeServiceImpl
+ * Package: com.welampiot.service.impl
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/4/10 - 10:55
+ * @Version: v1.0
+ */
+@Service
+public class ManholeServiceImpl implements ManholeService {
+
+    @Autowired
+    private ManholeDao manholeDao;
+
+    @Override
+    public ManholeVO getDevTotalBySectionList(List<ManholeDTO> sectionList) {
+        ManholeVO vo = new ManholeVO();
+        vo.setTotal(manholeDao.getTotalBySectionList(sectionList));
+        vo.setOnlineCount(manholeDao.getOnlineTotalBySectionList(sectionList));
+        vo.setAlarmCount(manholeDao.getAlarmTotalBySectionList(sectionList));
+        vo.setNormalCount(manholeDao.getNormalTotalBySectionList(sectionList));
+        List<ManholeDTO> newTotalList = manholeDao.getNewTotalBySectionList(sectionList);
+        List<ManholeDTO> totalList = new ArrayList<>();
+        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        LocalDateTime startTime = LocalDate.now().atTime(0, 0, 0);
+        LocalDateTime endTime = LocalDate.now().atTime(23, 59, 59);
+        newTotalList.forEach(manholeDTO -> {
+            if (manholeDTO.getCreateTime() != null && !manholeDTO.getCreateTime().equals("")){
+                LocalDateTime localDateTime = LocalDateTime.parse(manholeDTO.getCreateTime(), dtf);
+                if (localDateTime.isAfter(startTime) && localDateTime.isBefore(endTime)){
+                    totalList.add(manholeDTO);
+                }
+            }
+        });
+        int size = totalList.size();
+        vo.setNewCount(size);
+        return vo;
+    }
+
+    @Override
+    public ManholeVO getListByDTO(ManholeDTO dto, Integer version) {
+        ManholeVO vo = new ManholeVO();
+        List<ManholeDTO> listByDTO = manholeDao.getListByDTO(dto);
+        List<ManholeDTO> list = new ArrayList<>();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        if (listByDTO != null && !listByDTO.isEmpty()){
+            listByDTO.forEach(manholeDTO ->{
+                if (manholeDTO.getId() != null) {
+                    if (manholeDTO.getOnline() != null && manholeDTO.getOnline() == 1){
+                        manholeDTO.setOnline(1);
+                    }else {
+                        manholeDTO.setOnline(0);
+                    }
+                    if (manholeDTO.getAlarmStatus() != null && manholeDTO.getAlarmStatus() == 1){
+                        manholeDTO.setAlarmStatus(1);
+                    }else {
+                        manholeDTO.setAirAlarm(0);
+                    }
+                    if (manholeDTO.getAlarmInfo() == null && manholeDTO.getAlarmStatus() == 0){
+                        manholeDTO.setAlarmInfo("");
+                    }
+                    //获取设备更新时间
+                    if (manholeDTO.getUpdateTime() != null && !manholeDTO.getUpdateTime().equals("")){
+                        Date cmdTime;
+                        try {
+                            cmdTime = simpleDateFormat.parse(manholeDTO.getUpdateTime());
+                        } catch (ParseException e) {
+                            throw new RuntimeException(e);
+                        }
+                        //判断时区,为null默认东八区
+                        long timezone = manholeDTO.getTimezone() == null ? 8 : manholeDTO.getTimezone();
+                        long l = cmdTime.getTime() + timezone * 3600 * 1000;
+                        cmdTime = new Date(l);
+                        manholeDTO.setUpdateTime(simpleDateFormat.format(cmdTime));
+                    }else {
+                        manholeDTO.setUpdateTime("");
+                    }
+                    //获取设备创建时间
+                    if (manholeDTO.getCreateTime() == null){
+                        manholeDTO.setCreateTime("");
+                    }else {
+                        try {
+                            manholeDTO.setCreateTime(simpleDateFormat.format(simpleDateFormat.parse(manholeDTO.getCreateTime())));
+                        } catch (ParseException e) {
+                            throw new RuntimeException(e);
+                        }
+                    }
+                    //获取设备安装时间
+                    if (manholeDTO.getInstallDate() == null){
+                        manholeDTO.setInstallDate("");
+                    }else {
+                        try {
+                            manholeDTO.setInstallDate(simpleDateFormat.format(simpleDateFormat.parse(manholeDTO.getInstallDate())));
+                        } catch (ParseException e) {
+                            throw new RuntimeException(e);
+                        }
+                    }
+                    //获取设备过期时间
+                    if (manholeDTO.getExpirationDate() == null){
+                        manholeDTO.setExpirationDate("");
+                    }else {
+                        try {
+                            manholeDTO.setExpirationDate(simpleDateFormat.format(simpleDateFormat.parse(manholeDTO.getExpirationDate())));
+                        } catch (ParseException e) {
+                            throw new RuntimeException(e);
+                        }
+                    }
+                    //获取设备位置信息
+                    if (version == 0){
+                        if (manholeDTO.getChCity() != null && !manholeDTO.getChCity().equals("")){
+                            manholeDTO.setCity(manholeDTO.getChCity());
+                        }else {
+                            manholeDTO.setCity("");
+                        }
+                        if (manholeDTO.getChArea() != null && !manholeDTO.getChArea().equals("")){
+                            manholeDTO.setArea(manholeDTO.getChArea());
+                        }else {
+                            manholeDTO.setArea("");
+                        }
+                        if (manholeDTO.getSection() == null){
+                            manholeDTO.setSection("");
+                        }
+                        manholeDTO.setLocation(manholeDTO.getCity() + " " + manholeDTO.getArea() + " " + manholeDTO.getSection());
+                    }else if (version == 1){
+                        if (manholeDTO.getEnCity() != null && !manholeDTO.getEnCity().equals("")){
+                            manholeDTO.setCity(manholeDTO.getEnCity());
+                        }else {
+                            manholeDTO.setCity("");
+                        }
+                        if (manholeDTO.getEnArea() != null && !manholeDTO.getEnArea().equals("")){
+                            manholeDTO.setArea(manholeDTO.getEnArea());
+                        }else {
+                            manholeDTO.setArea("");
+                        }
+                        if (manholeDTO.getSection() == null){
+                            manholeDTO.setSection("");
+                        }
+                        manholeDTO.setLocation(manholeDTO.getCity() + " " + manholeDTO.getArea() + " " + manholeDTO.getSection());
+                    }else {
+                        if (manholeDTO.getRuCity() != null && !manholeDTO.getRuCity().equals("")){
+                            manholeDTO.setCity(manholeDTO.getRuCity());
+                        }else {
+                            manholeDTO.setCity("");
+                        }
+                        if (manholeDTO.getRuArea() != null && !manholeDTO.getRuArea().equals("")){
+                            manholeDTO.setArea(manholeDTO.getRuArea());
+                        }else {
+                            manholeDTO.setArea("");
+                        }
+                        if (manholeDTO.getSection() == null){
+                            manholeDTO.setSection("");
+                        }
+                        manholeDTO.setLocation(manholeDTO.getCity() + " " + manholeDTO.getArea() + " " + manholeDTO.getSection());
+                    }
+                    list.add(manholeDTO);
+                }
+            });
+            vo.setList(list);
+            return vo;
+        }else {
+            return null;
+        }
+    }
+
+    @Override
+    public ManholeVO getHistoryListByDTO(ManholeDTO dto) {
+        ManholeVO vo = new ManholeVO();
+        List<ManholeDTO> historyList = manholeDao.getHistoryListByDTO(dto);
+        List<ManholeDTO> list = new ArrayList<>();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        historyList.forEach(manholeDTO ->{
+            if (manholeDTO.getAlarmStatus() != null && manholeDTO.getAlarmStatus() == 1){
+                manholeDTO.setAlarmStatus(1);
+            }else {
+                manholeDTO.setAlarmStatus(0);
+            }
+            if (manholeDTO.getAlarmInfo() == null && manholeDTO.getAlarmStatus() == 0){
+                manholeDTO.setAlarmInfo("");
+            }
+            //获取设备更新时间
+            if (manholeDTO.getUpdateTime() != null && !manholeDTO.getUpdateTime().equals("")){
+                Date cmdTime;
+                try {
+                    cmdTime = simpleDateFormat.parse(manholeDTO.getUpdateTime());
+                } catch (ParseException e) {
+                    throw new RuntimeException(e);
+                }
+                //判断时区,为null默认东八区
+                long timezone = manholeDTO.getTimezone() == null ? 8 : manholeDTO.getTimezone();
+                long l = cmdTime.getTime() + timezone * 3600 * 1000;
+                cmdTime = new Date(l);
+                manholeDTO.setUpdateTime(simpleDateFormat.format(cmdTime));
+            }else {
+                manholeDTO.setUpdateTime("");
+            }
+            if (manholeDTO.getStatus() != null && manholeDTO.getStatus() == 1){
+                manholeDTO.setStatus(1);
+            }else {
+                manholeDTO.setStatus(0);
+            }
+            list.add(manholeDTO);
+        });
+        vo.setList(list);
+        return vo;
+    }
+}

+ 50 - 0
src/main/java/com/welampiot/vo/ManholeVO.java

@@ -0,0 +1,50 @@
+package com.welampiot.vo;
+
+import com.welampiot.dto.ManholeDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * ClassName: ManholeVO
+ * Package: com.welampiot.vo
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/4/10 - 10:36
+ * @Version: v1.0
+ */
+@Data
+public class ManholeVO implements Serializable {
+    /** 设备总数 **/
+    private Integer total;
+
+    /** 正常设备数 **/
+    private Integer normalCount;
+
+    /** 在线设备数 **/
+    private Integer onlineCount;
+
+    /** 报警数 **/
+    private Integer alarmCount;
+
+    /** 故障数 **/
+    private Integer faultCount;
+
+    /** 已完成故障数 **/
+    private Integer finishFaultCount;
+
+    /** 处理中故障数 **/
+    private Integer ingFaultCount;
+
+    /** 未指派故障数 **/
+    private Integer notFaultCount;
+
+    /** 新建设备数 **/
+    private Integer newCount;
+
+    private List<ManholeDTO> list;
+
+    private static final long serialVersionUID = 1L;
+}

+ 98 - 0
src/main/resources/mapper/ManholeMapper.xml

@@ -0,0 +1,98 @@
+<?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.ManholeDao">
+
+    <select id="getTotalBySectionList" resultType="Integer">
+        select count(m.id) as total from manhole m
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            where m.sectionid in
+            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                #{dto}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="getOnlineTotalBySectionList" resultType="Integer">
+        select count(m.id) as onlineTotal from manhole m
+        where m.online = 1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and m.sectionid in
+            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                #{dto}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="getAlarmTotalBySectionList" resultType="Integer">
+        select count(m.id) as alarmTotal from manhole m
+        where m.online = 1 and (m.openAlarm = 1 or m.overAlarm = 1 or m.airAlarm = 1 or m.dismanAlarm = 1)
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and m.sectionid in
+            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                #{dto}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="getNormalTotalBySectionList" resultType="Integer">
+        select count(m.id) as normalTotal from manhole m
+        where m.online = 1 and m.overAlarm = 0 and m.openAlarm = 0 and m.airAlarm = 0 and m.dismanAlarm = 0
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and m.sectionid in
+            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                #{dto}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="getNewTotalBySectionList" resultType="ManholeDTO">
+        select m.id,m.createTime from manhole m
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            where m.sectionid in
+            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                #{dto}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="getListByDTO" resultType="com.welampiot.dto.ManholeDTO" parameterType="com.welampiot.dto.ManholeDTO">
+        select m.id,m.name,m.areaid as areaId,m.sectionid as sectionId,m.model,m.address,
+               m.online,m.angle,m.longitude,m.latitude,m.batteryVol,m.alarmStatus,m.alarmInfo,
+               m.updateTime,m.createTime,m.status,m.install_date installDate,count(m.id) as total,
+               m.expiration_date expirationDate,g.chinese_name chArea,g.english_name enArea,g.ru_name ruArea,
+               p.chinese_name chCity,p.english_name enCity,p.ru_name ruCity,s.timezone,s.name as section
+        from manhole m left join section s on m.sectionid = s.id
+            left join global_location g on m.areaid = g.id
+            left join global_location p on g.pid = p.id
+        where 1=1 <if test="sectionList != null and !sectionList.isEmpty()">
+                    and m.sectionid in
+                    <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                        #{dto}
+                    </foreach>
+            </if>
+            <if test="keywords != null and keywords != ''">
+                and (m.name like '%${keywords}%' or m.address like '%${keywords}%')
+            </if>
+            order by convert(m.name using gbk) asc,m.id desc
+            <if test="page >= 0 and count > 0">
+                limit #{page},#{count}
+            </if>
+    </select>
+    
+    <select id="getHistoryListByDTO" resultType="ManholeDTO">
+        select m.angle,m.batteryVol,m.alarmStatus,m.alarmInfo,
+               m.updateTime,m.status,count(m.id) as total,s.timezone
+        from manhole m left join section s on m.sectionid = s.id
+        where m.id = #{id}
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and m.sectionid in
+            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
+                #{dto}
+            </foreach>
+        </if>
+        <if test="page >= 0 and count > 0">
+            limit #{page},#{count}
+        </if>
+    </select>
+
+</mapper>

+ 1 - 1
src/main/resources/mapper/TranshInfoMapper.xml

@@ -36,7 +36,7 @@
 
     <select id="getNormalTotalBySectionList" resultType="Integer">
         select count(t.id) as normalTotal from transh_info t
-        where t.full = 1 and t.state = 1 and t.online = 1
+        where t.full = 0 and t.state = 0 and t.online = 1
         <if test="sectionList != null and !sectionList.isEmpty()">
             and t.sectionid in
             <foreach collection="sectionList" item="dto" open="(" separator="," close=")">