Selaa lähdekoodia

智诺云智慧灯杆概览信息

zhj 2 vuotta sitten
vanhempi
commit
09d2163c56
40 muutettua tiedostoa jossa 917 lisäystä ja 36 poistoa
  1. 2 0
      src/main/java/com/welampiot/controller/MapController.java
  2. 275 5
      src/main/java/com/welampiot/controller/NewLampPoleController2.java
  3. 2 0
      src/main/java/com/welampiot/dao/ChargeDao.java
  4. 1 0
      src/main/java/com/welampiot/dao/LampDao.java
  5. 4 0
      src/main/java/com/welampiot/dao/LampInfoCacheByDayDao.java
  6. 9 0
      src/main/java/com/welampiot/dao/LampPoleDao.java
  7. 1 0
      src/main/java/com/welampiot/dao/OperationLogDao.java
  8. 2 0
      src/main/java/com/welampiot/dao/VideoMonitorDao.java
  9. 1 0
      src/main/java/com/welampiot/dao/WifiDao.java
  10. 4 0
      src/main/java/com/welampiot/dto/ChargeDTO.java
  11. 1 1
      src/main/java/com/welampiot/dto/LampInfoCacheByDayDTO.java
  12. 2 1
      src/main/java/com/welampiot/dto/LampInfoDTO.java
  13. 1 1
      src/main/java/com/welampiot/dto/LampPoleDTO.java
  14. 50 0
      src/main/java/com/welampiot/dto/LampPoleDataDTO.java
  15. 1 0
      src/main/java/com/welampiot/dto/OperationLogDTO.java
  16. 2 0
      src/main/java/com/welampiot/service/ChargeService.java
  17. 4 0
      src/main/java/com/welampiot/service/LampInfoCacheByDayService.java
  18. 6 0
      src/main/java/com/welampiot/service/LampPoleService.java
  19. 1 0
      src/main/java/com/welampiot/service/LampService.java
  20. 1 0
      src/main/java/com/welampiot/service/OperationLogService.java
  21. 1 0
      src/main/java/com/welampiot/service/VideoMonitorService.java
  22. 1 0
      src/main/java/com/welampiot/service/WifiService.java
  23. 5 0
      src/main/java/com/welampiot/service/impl/ChargeServiceImpl.java
  24. 11 1
      src/main/java/com/welampiot/service/impl/LampInfoCacheByDayServiceImpl.java
  25. 43 0
      src/main/java/com/welampiot/service/impl/LampPoleServiceImpl.java
  26. 5 0
      src/main/java/com/welampiot/service/impl/LampServiceImpl.java
  27. 5 0
      src/main/java/com/welampiot/service/impl/OperationLogServiceImpl.java
  28. 5 0
      src/main/java/com/welampiot/service/impl/VideoMonitorServiceImpl.java
  29. 5 0
      src/main/java/com/welampiot/service/impl/WifiServiceImpl.java
  30. 16 0
      src/main/java/com/welampiot/vo/LampPoleDataVO.java
  31. 6 0
      src/main/java/com/welampiot/vo/LampPoleInfoVO.java
  32. 4 18
      src/main/resources/mapper/AllAlarmInfoLogMapper.xml
  33. 22 0
      src/main/resources/mapper/ChargeMapper.xml
  34. 46 0
      src/main/resources/mapper/LampInfoCacheByDayMapper.xml
  35. 2 1
      src/main/resources/mapper/LampInfoLogNewMapper.xml
  36. 55 0
      src/main/resources/mapper/LampMapper.xml
  37. 262 8
      src/main/resources/mapper/LampPoleMapper.xml
  38. 11 0
      src/main/resources/mapper/OperationLogMapper.xml
  39. 20 0
      src/main/resources/mapper/VideoMonitorMapper.xml
  40. 22 0
      src/main/resources/mapper/WifiMapper.xml

+ 2 - 0
src/main/java/com/welampiot/controller/MapController.java

@@ -1059,9 +1059,11 @@ public class MapController{
         Integer areaId = (Integer) toolUtils.getRequestContent(request,"areaId",1);
         List<Integer> sectionList = toolUtils.getSectionList(request);
         LampPoleDTO lampPoleDTO = new LampPoleDTO();
+        lampPoleDTO.setSectionId(null);
         lampPoleDTO.setAreaId(areaId);
         lampPoleDTO.setSectionList(sectionList);
         LampInfoDTO lampInfoDTO = new LampInfoDTO();
+        lampInfoDTO.setSectionId(null);
         lampInfoDTO.setAreaId(areaId);
         lampInfoDTO.setSectionList(sectionList);
         LampPoleInfoVO lampPoleCount = lampPoleService.getLampPoleCount(lampPoleDTO, lampInfoDTO);

+ 275 - 5
src/main/java/com/welampiot/controller/NewLampPoleController2.java

@@ -3,13 +3,10 @@ package com.welampiot.controller;
 import com.welampiot.common.BaseResult;
 import com.welampiot.common.InterfaceResultEnum;
 import com.welampiot.dto.*;
-import com.welampiot.service.EmergencyInfoLogService;
-import com.welampiot.service.LampPoleService;
-import com.welampiot.service.WifiService;
+import com.welampiot.service.*;
 import com.welampiot.utils.ToolUtils;
 import com.welampiot.utils.WeatherUtil;
-import com.welampiot.vo.EmergencyInfoLogVO;
-import com.welampiot.vo.LampPoleVO;
+import com.welampiot.vo.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -18,6 +15,10 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
 import java.text.DecimalFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -41,6 +42,22 @@ public class NewLampPoleController2 {
     private EmergencyInfoLogService emergencyInfoLogService;
     @Autowired
     private WifiService wifiService;
+    @Autowired
+    private ChargeService chargeService;
+    @Autowired
+    private VideoMonitorService videoMonitorService;
+    @Autowired
+    private LampService lampService;
+    @Autowired
+    private LampInfoLogNewService lampInfoLogNewService;
+    @Autowired
+    private AllAlarmInfoLogService allAlarmInfoLogService;
+    @Autowired
+    private LampInfoCacheByDayService lampInfoCacheByDayService;
+    @Autowired
+    private OperationLogService operationLogService;
+    @Autowired
+    private UserService userService;
 
     /**
      * 智诺云智慧灯杆列表
@@ -242,4 +259,257 @@ public class NewLampPoleController2 {
         }
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,dto);
     }
+
+    /**
+     * 概览页面信息
+     * @param request type,areaId,sectionId
+     * @return 概览页面信息
+     */
+    @RequestMapping(value = "/data", method = RequestMethod.POST)
+    public BaseResult<?> data(HttpServletRequest request) throws ParseException {
+        Integer version = (Integer) toolUtils.getRequestContent(request, "version", 1);
+        Integer type = (Integer) toolUtils.getRequestContent(request, "type", 1);
+        Integer areaId = (Integer) toolUtils.getRequestContent(request, "areaId", 1);
+        Integer sectionId = (Integer) toolUtils.getRequestContent(request, "sectionId", 1);
+        String username = (String) toolUtils.getRequestContent(request, "username", 2);
+
+        LampPoleDataDTO lampPoleDataDTO = new LampPoleDataDTO();
+        DecimalFormat decimalFormat = new DecimalFormat("0.00");
+        if (type == 0) { // 概览信息
+            ChargeDTO chargeDTO = new ChargeDTO(); // 充电桩
+            chargeDTO.setAreaId(areaId);
+            chargeDTO.setSectionId(sectionId);
+            chargeDTO.setSectionList(toolUtils.getSectionList(request));
+            ChargeDTO eleAndFree = chargeService.getTotalChargeEleAndFree(chargeDTO);
+            if (eleAndFree == null) {
+                lampPoleDataDTO.setChargeMoney("0");
+                lampPoleDataDTO.setChargeCount("0");
+            } else {
+                Float eleTotal = eleAndFree.getEquipmentElectricity(); // 充电量
+                Float free = eleAndFree.getFree(); // 充电金额
+                if (eleTotal == 0.0) {
+                    lampPoleDataDTO.setChargeCount("0");
+                } else {
+                    String ele = decimalFormat.format(eleTotal);
+                    lampPoleDataDTO.setChargeCount(ele);
+                }
+                if (free == 0.0) {
+                    lampPoleDataDTO.setChargeMoney("0");
+                } else {
+                    String freeTotal = decimalFormat.format(free);
+                    lampPoleDataDTO.setChargeMoney(freeTotal);
+                }
+            }
+
+            VideoMonitorVO videoMonitorVO = new VideoMonitorVO(); // 视屏监控
+            videoMonitorVO.setAreaId(areaId);
+            videoMonitorVO.setSectionId(sectionId);
+            videoMonitorVO.setSectionList(toolUtils.getSectionList(request));
+            VideoMonitorDTO carAndPeople = videoMonitorService.getTotalCarAndPeople(videoMonitorVO);
+            Integer peopleCount = carAndPeople.getPeopleCountTotal(); // 人流量
+            Integer carCount = carAndPeople.getCarCountTotal(); // 车流量
+            lampPoleDataDTO.setPerCount(peopleCount);
+            lampPoleDataDTO.setCarCount(carCount);
+
+            WifiDTO wifiDTO = new WifiDTO(); // wifi
+            wifiDTO.setAreaId(areaId);
+            wifiDTO.setSectionId(sectionId);
+            wifiDTO.setSectionList(toolUtils.getSectionList(request));
+            WifiDTO countAndFlow = wifiService.getTotalWifiCountAndFlow(wifiDTO);
+            Float flow = countAndFlow.getFlow(); // wifi连接人数
+            Integer deviceCount = countAndFlow.getDeviceCount(); // 消耗流量
+            lampPoleDataDTO.setWifiCount(deviceCount);
+            if (flow == 0.0) {
+                lampPoleDataDTO.setFlow("0");
+            } else {
+                String flowTotal = decimalFormat.format(flow);
+                lampPoleDataDTO.setFlow(flowTotal);
+            }
+
+            AllAlarmInfoLogVO allAlarmInfoLogVO = new AllAlarmInfoLogVO(); // 报警次数
+            allAlarmInfoLogVO.setAreaId(areaId);
+            allAlarmInfoLogVO.setSectionId(sectionId);
+            allAlarmInfoLogVO.setSectionList(toolUtils.getSectionList(request));
+            allAlarmInfoLogVO.setCityId(null);
+            allAlarmInfoLogVO.setProvinceId(null);
+            allAlarmInfoLogVO.setAlarmType(null);
+            allAlarmInfoLogVO.setKeyword(null);
+            Integer alarmTotal = allAlarmInfoLogService.getLampPoleAlarmTotal(allAlarmInfoLogVO);
+            lampPoleDataDTO.setAlarmCount(alarmTotal);
+
+            LampInfoDTO lampInfoDTO = new LampInfoDTO(); // 灯控数
+            lampInfoDTO.setType(null);
+            lampInfoDTO.setSectionId(sectionId);
+            lampInfoDTO.setAreaId(areaId);
+            lampInfoDTO.setSectionList(toolUtils.getSectionList(request));
+            Integer lampCount = lampService.getLampInstallTotalByDTO(lampInfoDTO);
+            lampPoleDataDTO.setLampCount(lampCount);
+            LampInfoLogNewDTO sumEle = lampInfoLogNewService.getSumEleByDTO(lampInfoDTO);
+            String workTimeTotal = sumEle.getWorkTimeTotal(); // 亮灯时长
+            lampPoleDataDTO.setLightTime(workTimeTotal);
+
+            LampPoleVO lampPoleVO = new LampPoleVO(); // 灯杆数
+            lampPoleVO.setAreaId(areaId);
+            lampPoleVO.setSectionId(sectionId);
+            lampPoleVO.setSectionList(toolUtils.getSectionList(request));
+            Integer lampPoleCount = lampPoleService.getLampPoleInstallTotal(lampPoleVO);
+            lampPoleDataDTO.setLampPoleCount(lampPoleCount);
+
+        } else if (type == 1) { // 地图信息
+            LampPoleVO lampPoleVO = new LampPoleVO();
+            lampPoleVO.setAreaId(areaId);
+            lampPoleVO.setSectionId(sectionId);
+            lampPoleVO.setSectionList(toolUtils.getSectionList(request));
+            // 灯杆总数
+            Integer lampPoleCount = lampPoleService.getLampPoleInstallTotal(lampPoleVO);
+            lampPoleDataDTO.setLampPoleCount(lampPoleCount);
+            // 灯杆列表
+            List<LampPoleDTO> list = lampPoleService.getLampPoleInstallList(lampPoleVO);
+            lampPoleDataDTO.setLampPoleList(list);
+            // 灯杆亮灯数
+            Integer lightCount = lampPoleService.getLampPoleLightCount(lampPoleVO);
+            lampPoleDataDTO.setLampPoleLightCount(lightCount);
+            // 灯杆亮灯列表
+            List<LampPoleDTO> lightList = lampPoleService.getLampPoleLightList(lampPoleVO);
+            lampPoleDataDTO.setLampPoleLightList(lightList);
+            // 灯杆故障数
+            Integer alarmTotal = lampPoleService.getLampPoleAlarmTotal(lampPoleVO);
+            lampPoleDataDTO.setLampPoleAlarmCount(alarmTotal);
+            // 灯杆故障列表
+            List<LampPoleDTO> alarmList = lampPoleService.getAlarmLampPoleList(lampPoleVO);
+            lampPoleDataDTO.setLampPoleAlarmList(alarmList);
+
+        } else if (type == 2) { // 7天用电量
+            long l = System.currentTimeMillis();
+            Date date1 = new Date(l);
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(date1);
+            int year = calendar.get(Calendar.YEAR); // 获取年份
+            int month = calendar.get(Calendar.MONTH) + 1; // 获取月份
+
+            String startDate;
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            String endDate = simpleDateFormat.format(l);
+            LampInfoCacheByDayDTO dto = new LampInfoCacheByDayDTO();
+            dto.setAreaId(areaId);
+            dto.setSectionId(sectionId);
+            dto.setSectionList(toolUtils.getSectionList(request));
+
+            // 7天用电量列表
+            long startTime = l - 24 * 3600 * 1000 * 6;
+            startDate = simpleDateFormat.format(startTime);
+            dto.setStartDate(startDate);
+            dto.setEndDate(endDate);
+            List<LampInfoCacheByDayDTO> nearDayConSumList = lampInfoCacheByDayService.getNearDayConSumList(dto);
+            lampPoleDataDTO.setComList(nearDayConSumList);
+
+            // 当天
+            LampInfoCacheByDayDTO dayConSum = lampInfoCacheByDayService.getOneDayConSum(dto);
+            if (dayConSum != null && dayConSum.getConSum() != null) { // 当天用电量
+                String conSum = dayConSum.getConSum();
+                String format = decimalFormat.format(Float.parseFloat(conSum));
+                lampPoleDataDTO.setDayCom(format);
+            } else {
+                lampPoleDataDTO.setDayCom("0");
+            }
+
+            // 当月
+            if (month < 10) {
+                startDate = year + "-0" + month + "-01";
+            } else {
+                startDate = year + "-" + month + "-01";
+            }
+            dto.setStartDate(startDate);
+            dto.setEndDate(endDate);
+            LampInfoCacheByDayDTO monthCom = lampInfoCacheByDayService.getAreaOrSectionOfConSum(dto);
+            if (monthCom != null && monthCom.getConSum() != null) { // 当月用电量
+                String conSum = monthCom.getConSum();
+                String format = decimalFormat.format(Float.parseFloat(conSum));
+                lampPoleDataDTO.setMonthCom(format);
+            } else {
+                lampPoleDataDTO.setMonthCom("0");
+            }
+
+            // 当年
+            month = 1;
+            startDate = year + "-0" + month + "-01";
+            dto.setStartDate(startDate);
+            dto.setEndDate(endDate);
+            LampInfoCacheByDayDTO yearCom = lampInfoCacheByDayService.getAreaOrSectionOfConSum(dto);
+            if (yearCom != null && yearCom.getConSum() != null) { // 当年用电量
+                String conSum = yearCom.getConSum();
+                String format = decimalFormat.format(Float.parseFloat(conSum));
+                lampPoleDataDTO.setYearCom(format);
+            } else {
+                lampPoleDataDTO.setYearCom("0");
+            }
+
+            // 全部
+            startDate = "2022-01-01";
+            dto.setStartDate(startDate);
+            dto.setEndDate(endDate);
+            LampInfoCacheByDayDTO totalCom = lampInfoCacheByDayService.getAreaOrSectionOfConSum(dto);
+            if (totalCom != null && totalCom.getConSum() != null) { // 累计用电量
+                String conSum = totalCom.getConSum();
+                String format = decimalFormat.format(Float.parseFloat(conSum));
+                lampPoleDataDTO.setTotalCom(format);
+            } else {
+                lampPoleDataDTO.setTotalCom("0");
+            }
+        } else if (type == 3) { // 全国灯控故障数排名TOP10
+            LampVO lampVO = new LampVO();
+            lampVO.setAreaId(areaId);
+            lampVO.setSectionId(sectionId);
+            lampVO.setSectionList(toolUtils.getSectionList(request));
+            List<LampInfoDTO> lampCountList = lampService.getLampSectionAlarmCountTop(lampVO);
+            lampPoleDataDTO.setAlarmList(lampCountList);
+        } else if (type == 4) { // 故障信息列表
+            LampPoleVO lampPoleVO = new LampPoleVO();
+            lampPoleVO.setAreaId(areaId);
+            lampPoleVO.setSectionId(sectionId);
+            lampPoleVO.setSectionList(toolUtils.getSectionList(request));
+            List<LampPoleDTO> lampPoleAlarmInfoList = lampPoleService.getLampPoleAlarmInfoList(lampPoleVO);
+            lampPoleDataDTO.setAlarmList(lampPoleAlarmInfoList);
+        } else if (type == 5) { // 日志信息列表
+            UserDTO userDTO = userService.queryUserIdByUsername(username);
+            if (userDTO == null) return toolUtils.response(InterfaceResultEnum.PARAM_FAIL,version);
+            OperationLogVO operationLogVO = new OperationLogVO();
+            operationLogVO.setUserId(userDTO.getId());
+            operationLogVO.setRole(userDTO.getRole());
+            List<OperationLogDTO> logList = operationLogService.getNewOperationLogList(operationLogVO);
+            lampPoleDataDTO.setLogList(logList);
+        } else if (type == 6) { // 设备数量信息
+            LampPoleDTO dto = new LampPoleDTO();
+            dto.setSectionId(sectionId);
+            dto.setAreaId(areaId);
+            dto.setSectionList(toolUtils.getSectionList(request));
+            LampPoleInfoVO lampPoleDevCount = lampPoleService.getLampPoleDevCount(dto);
+            lampPoleDataDTO.setDataDevCount(lampPoleDevCount);
+        }
+
+        LampPoleDataVO lampPoleDataVO = new LampPoleDataVO();
+        if (type == 0) { // 概览信息
+            lampPoleDataVO.setDataType("dataData");
+            lampPoleDataVO.setDataData(lampPoleDataDTO);
+        } else if (type == 1) { // 地图信息
+            lampPoleDataVO.setDataType("dataMap");
+            lampPoleDataVO.setDataMap(lampPoleDataDTO);
+        } else if (type == 2) { // 7天用电量
+            lampPoleDataVO.setDataType("data7Day");
+            lampPoleDataVO.setData7Day(lampPoleDataDTO);
+        } else if (type == 3) { // 全国故障排名
+            lampPoleDataVO.setDataType("dataAlarmControl");
+            lampPoleDataVO.setDataAlarmControl(lampPoleDataDTO);
+        } else if (type == 4) { // 故障信息列表
+            lampPoleDataVO.setDataType("dataAlarmList");
+            lampPoleDataVO.setDataAlarmList(lampPoleDataDTO);
+        } else if (type == 5) { // 日志信息列表
+            lampPoleDataVO.setDataType("dataLogList");
+            lampPoleDataVO.setDataLogList(lampPoleDataDTO);
+        } else if (type == 6) { // 设备信息数量
+            lampPoleDataVO.setDataType("dataDevCount");
+            lampPoleDataVO.setDataDevCount(lampPoleDataDTO.getDataDevCount());
+        }
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,lampPoleDataVO);
+    }
 }

+ 2 - 0
src/main/java/com/welampiot/dao/ChargeDao.java

@@ -42,4 +42,6 @@ public interface ChargeDao {
     void updateLampPoleChargeData(ChargeDTO chargeDTO);
 
     Integer checkChargeData(ChargeDTO chargeDTO);
+
+    ChargeDTO getTotalChargeEleAndFree(ChargeDTO dto);
 }

+ 1 - 0
src/main/java/com/welampiot/dao/LampDao.java

@@ -56,4 +56,5 @@ public interface LampDao {
     List<LampInfoDTO> getLampAlarmTotal(LampInfoDTO dto);
     int getAlarmCountByVO(LampVO lampVO);
     int getOnlineCountByVO(LampVO lampVO);
+    List<LampInfoDTO> getLampSectionAlarmCountTop(LampVO vo);
 }

+ 4 - 0
src/main/java/com/welampiot/dao/LampInfoCacheByDayDao.java

@@ -34,4 +34,8 @@ public interface LampInfoCacheByDayDao {
     List<LampInfoCacheByDayDTO> getEleConsumptionSaveList(LampInfoCacheByDayDTO dto);
 
     void deleteLampInfoCacheByDayData(LampInfoCacheByDayDTO dto);
+
+    LampInfoCacheByDayDTO getOneDayConSum(LampInfoCacheByDayDTO dto);
+
+    List<LampInfoCacheByDayDTO> getNearDayConSumList(LampInfoCacheByDayDTO dto);
 }

+ 9 - 0
src/main/java/com/welampiot/dao/LampPoleDao.java

@@ -22,6 +22,10 @@ public interface LampPoleDao {
     Integer deleteById(@Param("id")Integer id);
     List<LampPoleDTO> getLampPoleListByDTO(LampPoleDTO dto);
     Integer getLampPoleInstallTotalByDTO(LampPoleDTO dto);
+    Integer getLoopCount(LampPoleDTO dto);
+    Integer getTrashCount(LampPoleDTO dto);
+    Integer getManholeCount(LampPoleDTO dto);
+    Integer getLampInfoCount(LampPoleDTO dto);
     Integer getVideoCount(LampPoleDTO dto);
     Integer getScreenCount(LampPoleDTO dto);
     Integer getWifiCount(LampPoleDTO dto);
@@ -34,8 +38,12 @@ public interface LampPoleDao {
     void changeLampPoleLocationById(LampPoleDTO dto);
     LampPoleDTO getLampPoleDTOById(@Param("id") Integer id);
     Integer getLampPoleAlarmTotal(LampPoleVO vo);
+    List<LampPoleDTO> getAlarmLampPoleList(LampPoleVO vo);
+    Integer getLampPoleLightCount(LampPoleVO vo);
+    List<LampPoleDTO> getLampPoleLightList(LampPoleVO vo);
     Integer getNewCreateLampPoleCount(LampPoleVO vo);
     Integer getLampPoleInstallTotal(LampPoleVO vo);
+    List<LampPoleDTO> getLampPoleInstallList(LampPoleVO vo);
     void updateLampPoleDevType(LampPoleDTO dto);
     List<LampPoleDTO> getSectionLampPoleList(LampPoleVO vo);
     List<LampPoleDTO> getLampPoleByLampIds(@Param("lampIds") List<String> lampIds);
@@ -44,4 +52,5 @@ public interface LampPoleDao {
     List<LampPoleDTO> getNewLampPoleList2(LampPoleVO vo);
     LampPoleDTO getLampPoleDetails(LampPoleVO vo);
     List<LampPoleDTO> getLampPoleDevList(LampPoleVO vo);
+    List<LampPoleDTO> getLampPoleAlarmInfoList(LampPoleVO vo);
 }

+ 1 - 0
src/main/java/com/welampiot/dao/OperationLogDao.java

@@ -21,4 +21,5 @@ public interface OperationLogDao {
 
     List<OperationLogDTO> getOperationLogList(OperationLogVO vo);
     int add(OperationLogDTO operationLogDTO);
+    List<OperationLogDTO> getNewOperationLogList(OperationLogVO vo);
 }

+ 2 - 0
src/main/java/com/welampiot/dao/VideoMonitorDao.java

@@ -41,4 +41,6 @@ public interface VideoMonitorDao {
     void updateVideoMonitorData(VideoMonitorDTO dto);
 
     Integer checkVideoDevId(VideoMonitorDTO dto);
+
+    VideoMonitorDTO getTotalCarAndPeople(VideoMonitorVO vo);
 }

+ 1 - 0
src/main/java/com/welampiot/dao/WifiDao.java

@@ -32,4 +32,5 @@ public interface WifiDao {
     void updateWifiByLampPoleId(WifiDTO dto);
     Integer checkWifiData(WifiDTO dto);
     WifiDTO getWifiInfoDetails(WifiDTO dto);
+    WifiDTO getTotalWifiCountAndFlow(WifiDTO dto);
 }

+ 4 - 0
src/main/java/com/welampiot/dto/ChargeDTO.java

@@ -130,6 +130,10 @@ public class ChargeDTO implements Serializable {
 
     private String keyword;
 
+    private Integer areaId;
+
+    private Integer sectionId;
+
     private List<Integer> sectionList;
 
     private static final long serialVersionUID = 1L;

+ 1 - 1
src/main/java/com/welampiot/dto/LampInfoCacheByDayDTO.java

@@ -31,7 +31,7 @@ public class LampInfoCacheByDayDTO {
 
     private String powerSaveTotal;
 
-    private Integer lightTime; // 当天亮灯时间
+    private Long lightTime; // 当天亮灯时间
 
     private String updateTime; // 更新时间
 

+ 2 - 1
src/main/java/com/welampiot/dto/LampInfoDTO.java

@@ -74,7 +74,7 @@ public class LampInfoDTO {
     private Integer loopId;
     private String colourVal;
     private String keyword;
-    private List<Integer> sectionList;
+    private List<?> sectionList;
     private Integer alarmCount;
     private Integer type;
     private Integer alarmType;
@@ -85,4 +85,5 @@ public class LampInfoDTO {
     private Integer count;
     private String startDate;
     private String endDate;
+    private Integer total;
 }

+ 1 - 1
src/main/java/com/welampiot/dto/LampPoleDTO.java

@@ -38,7 +38,7 @@ public class LampPoleDTO {
     private Integer lampId;
     private Integer videoId;
     private Integer alarmType;
-    private List<Integer> sectionList;
+    private List<?> sectionList;
     private Integer version;
     private Integer faultstatus;
     private String alarmStatusStr;

+ 50 - 0
src/main/java/com/welampiot/dto/LampPoleDataDTO.java

@@ -0,0 +1,50 @@
+package com.welampiot.dto;
+
+import com.welampiot.vo.LampPoleInfoVO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * ClassName: LampPoleDataDTO
+ * Package: com.welampiot.dto
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/5 - 11:02
+ * @Version: v1.0
+ */
+@Data
+public class LampPoleDataDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Integer perCount; // 人流量
+    private Integer carCount; // 车流量
+    private String chargeCount; // 充电量
+    private String chargeMoney; // 充电金额
+    private Integer wifiCount; // WiFi连接人数
+    private Integer alarmCount; // 报警次数
+    private String lightTime; // 亮灯时间
+    private String flow; // 消耗流量
+    private Integer lampCount; // 路灯数
+    private Integer lampPoleCount; // 灯杆数
+
+    private List<LampPoleDTO> lampPoleList; // 灯杆列表
+    private List<LampPoleDTO> lampPoleAlarmList; // 故障列表
+    private List<LampPoleDTO> lampPoleLightList; // 亮灯列表
+    private Integer lampPoleLightCount; // 亮灯总数
+    private Integer lampPoleAlarmCount; // 故障总数
+
+    private String dayCom; // 当天用电量
+    private String monthCom; // 当月用电量
+    private String yearCom; // 当年用电量
+    private String totalCom; // 累计用电量
+    private List<LampInfoCacheByDayDTO> comList; // 7天用电量
+
+    private List<?> alarmList; // 故障列表
+
+    private List<OperationLogDTO> logList; // 日志信息列表
+
+    private LampPoleInfoVO dataDevCount; // 设备数量信息
+}

+ 1 - 0
src/main/java/com/welampiot/dto/OperationLogDTO.java

@@ -28,4 +28,5 @@ public class OperationLogDTO {
     private String section;
     private Integer timezone;
     private String company;
+    private String logInfo;
 }

+ 2 - 0
src/main/java/com/welampiot/service/ChargeService.java

@@ -28,4 +28,6 @@ public interface ChargeService {
     void updateLampPoleChargeData(ChargeDTO chargeDTO);
 
     Integer checkChargeData(ChargeDTO chargeDTO);
+
+    ChargeDTO getTotalChargeEleAndFree(ChargeDTO dto);
 }

+ 4 - 0
src/main/java/com/welampiot/service/LampInfoCacheByDayService.java

@@ -34,4 +34,8 @@ public interface LampInfoCacheByDayService {
     List<LampInfoCacheByDayDTO> getEleConsumptionSaveList(LampInfoCacheByDayDTO dto);
 
     void deleteLampInfoCacheByDayData(LampInfoCacheByDayDTO dto);
+
+    LampInfoCacheByDayDTO getOneDayConSum(LampInfoCacheByDayDTO dto);
+
+    List<LampInfoCacheByDayDTO> getNearDayConSumList(LampInfoCacheByDayDTO dto);
 }

+ 6 - 0
src/main/java/com/welampiot/service/LampPoleService.java

@@ -28,8 +28,12 @@ public interface LampPoleService {
     void changeLampPoleLocationById(LampPoleDTO dto);
     LampPoleDTO getLampPoleDTOById(Integer id);
     Integer getLampPoleAlarmTotal(LampPoleVO vo);
+    List<LampPoleDTO> getAlarmLampPoleList(LampPoleVO vo);
+    Integer getLampPoleLightCount(LampPoleVO vo);
+    List<LampPoleDTO> getLampPoleLightList(LampPoleVO vo);
     Integer getNewCreateLampPoleCount(LampPoleVO vo);
     Integer getLampPoleInstallTotal(LampPoleVO vo);
+    List<LampPoleDTO> getLampPoleInstallList(LampPoleVO vo);
     void updateLampPoleDevType(LampPoleDTO dto);
     List<LampPoleDTO> getSectionLampPoleList(LampPoleVO vo);
     List<LampPoleDTO> getLampPoleByLampIds(List<String> lampIds);
@@ -38,4 +42,6 @@ public interface LampPoleService {
     List<LampPoleDTO> getNewLampPoleList2(LampPoleVO vo);
     LampPoleDTO getLampPoleDetails(LampPoleVO vo);
     List<LampPoleDTO> getLampPoleDevList(LampPoleVO vo);
+    List<LampPoleDTO> getLampPoleAlarmInfoList(LampPoleVO vo);
+    LampPoleInfoVO getLampPoleDevCount(LampPoleDTO dto);
 }

+ 1 - 0
src/main/java/com/welampiot/service/LampService.java

@@ -56,4 +56,5 @@ public interface LampService {
     List<LampInfoDTO> getLampAlarmTotal(LampInfoDTO dto);
     int getAlarmCountByVO(LampVO lampVO);
     int getOnlineCountByVO(LampVO lampVO);
+    List<LampInfoDTO> getLampSectionAlarmCountTop(LampVO vo);
 }

+ 1 - 0
src/main/java/com/welampiot/service/OperationLogService.java

@@ -14,4 +14,5 @@ public interface OperationLogService {
 
     List<OperationLogDTO> getOperationLogList(OperationLogVO vo);
     int add(OperationLogDTO operationLogDTO);
+    List<OperationLogDTO> getNewOperationLogList(OperationLogVO vo);
 }

+ 1 - 0
src/main/java/com/welampiot/service/VideoMonitorService.java

@@ -30,4 +30,5 @@ public interface VideoMonitorService {
     void addVideoMonitorData(VideoMonitorDTO dto);
     void updateVideoMonitorData(VideoMonitorDTO dto);
     Integer checkVideoDevId(VideoMonitorDTO dto);
+    VideoMonitorDTO getTotalCarAndPeople(VideoMonitorVO vo);
 }

+ 1 - 0
src/main/java/com/welampiot/service/WifiService.java

@@ -34,4 +34,5 @@ public interface WifiService {
     void updateWifiByLampPoleId(WifiDTO dto);
     Integer checkWifiData(WifiDTO dto);
     WifiDTO getWifiInfoDetails(WifiDTO dto);
+    WifiDTO getTotalWifiCountAndFlow(WifiDTO dto);
 }

+ 5 - 0
src/main/java/com/welampiot/service/impl/ChargeServiceImpl.java

@@ -164,4 +164,9 @@ public class ChargeServiceImpl implements ChargeService {
     public Integer checkChargeData(ChargeDTO chargeDTO) {
         return chargeDao.checkChargeData(chargeDTO);
     }
+
+    @Override
+    public ChargeDTO getTotalChargeEleAndFree(ChargeDTO dto) {
+        return chargeDao.getTotalChargeEleAndFree(dto);
+    }
 }

+ 11 - 1
src/main/java/com/welampiot/service/impl/LampInfoCacheByDayServiceImpl.java

@@ -167,7 +167,7 @@ public class LampInfoCacheByDayServiceImpl implements LampInfoCacheByDayService
                 l.setYearLightTime(0);
             }
             if (l.getLightTime() == null) { // 累计亮灯时长
-                l.setLightTime(0);
+                l.setLightTime(0L);
             }
             if (l.getNewTime() != null) {
                 l.setUpdateTime(l.getNewTime());
@@ -180,4 +180,14 @@ public class LampInfoCacheByDayServiceImpl implements LampInfoCacheByDayService
     public void deleteLampInfoCacheByDayData(LampInfoCacheByDayDTO dto) {
         lampInfoCacheByDayDao.deleteLampInfoCacheByDayData(dto);
     }
+
+    @Override
+    public LampInfoCacheByDayDTO getOneDayConSum(LampInfoCacheByDayDTO dto) {
+        return lampInfoCacheByDayDao.getOneDayConSum(dto);
+    }
+
+    @Override
+    public List<LampInfoCacheByDayDTO> getNearDayConSumList(LampInfoCacheByDayDTO dto) {
+        return lampInfoCacheByDayDao.getNearDayConSumList(dto);
+    }
 }

+ 43 - 0
src/main/java/com/welampiot/service/impl/LampPoleServiceImpl.java

@@ -474,6 +474,21 @@ public class LampPoleServiceImpl implements LampPoleService {
         return lampPoleDao.getLampPoleAlarmTotal(vo);
     }
 
+    @Override
+    public List<LampPoleDTO> getAlarmLampPoleList(LampPoleVO vo) {
+        return lampPoleDao.getAlarmLampPoleList(vo);
+    }
+
+    @Override
+    public Integer getLampPoleLightCount(LampPoleVO vo) {
+        return lampPoleDao.getLampPoleLightCount(vo);
+    }
+
+    @Override
+    public List<LampPoleDTO> getLampPoleLightList(LampPoleVO vo) {
+        return lampPoleDao.getLampPoleLightList(vo);
+    }
+
     @Override
     public Integer getNewCreateLampPoleCount(LampPoleVO vo) {
         return lampPoleDao.getNewCreateLampPoleCount(vo);
@@ -484,6 +499,11 @@ public class LampPoleServiceImpl implements LampPoleService {
         return lampPoleDao.getLampPoleInstallTotal(vo);
     }
 
+    @Override
+    public List<LampPoleDTO> getLampPoleInstallList(LampPoleVO vo) {
+        return lampPoleDao.getLampPoleInstallList(vo);
+    }
+
     @Override
     public void updateLampPoleDevType(LampPoleDTO dto) {
         lampPoleDao.updateLampPoleDevType(dto);
@@ -524,6 +544,29 @@ public class LampPoleServiceImpl implements LampPoleService {
         return lampPoleDao.getLampPoleDevList(vo);
     }
 
+    @Override
+    public List<LampPoleDTO> getLampPoleAlarmInfoList(LampPoleVO vo) {
+        return lampPoleDao.getLampPoleAlarmInfoList(vo);
+    }
+
+    @Override
+    public LampPoleInfoVO getLampPoleDevCount(LampPoleDTO dto) {
+        LampPoleInfoVO lampPoleInfoVO = new LampPoleInfoVO();
+        lampPoleInfoVO.setWifiCount(lampPoleDao.getWifiCount(dto));
+        lampPoleInfoVO.setBroadcastCount(lampPoleDao.getBroadcastCount(dto));
+        lampPoleInfoVO.setLampCount(lampPoleDao.getLampInfoCount(dto));
+        lampPoleInfoVO.setLoopCount(lampPoleDao.getLoopCount(dto));
+        lampPoleInfoVO.setVideoCount(lampPoleDao.getVideoCount(dto));
+        lampPoleInfoVO.setChargeCount(lampPoleDao.getChargeCount(dto));
+        lampPoleInfoVO.setLedCount(lampPoleDao.getScreenCount(dto));
+        lampPoleInfoVO.setWellCoverCount(lampPoleDao.getManholeCount(dto));
+        lampPoleInfoVO.setWeatherCount(lampPoleDao.getWeatherCount(dto));
+        lampPoleInfoVO.setTrashCount(lampPoleDao.getTrashCount(dto));
+        lampPoleInfoVO.setOneKeyCount(lampPoleDao.getEmergencyCount(dto));
+        lampPoleInfoVO.setLineCount(0);
+        return lampPoleInfoVO;
+    }
+
     @Override
     public Integer getAlarmCountByVO(LampPoleCountVO lampPoleCountVO) {
         return lampPoleDao.getAlarmCountByVO(lampPoleCountVO);

+ 5 - 0
src/main/java/com/welampiot/service/impl/LampServiceImpl.java

@@ -685,6 +685,11 @@ public class LampServiceImpl implements LampService {
         return lampDao.getOnlineCountByVO(lampVO);
     }
 
+    @Override
+    public List<LampInfoDTO> getLampSectionAlarmCountTop(LampVO vo) {
+        return lampDao.getLampSectionAlarmCountTop(vo);
+    }
+
     @Override
     public LampInfoLogNewDTO getComBySectionList(LampVO vo) {
         return lampDao.getComBySectionList(vo);

+ 5 - 0
src/main/java/com/welampiot/service/impl/OperationLogServiceImpl.java

@@ -115,4 +115,9 @@ public class OperationLogServiceImpl implements OperationLogService {
     public int add(OperationLogDTO operationLogDTO) {
         return operationLogDao.add(operationLogDTO);
     }
+
+    @Override
+    public List<OperationLogDTO> getNewOperationLogList(OperationLogVO vo) {
+        return operationLogDao.getNewOperationLogList(vo);
+    }
 }

+ 5 - 0
src/main/java/com/welampiot/service/impl/VideoMonitorServiceImpl.java

@@ -125,6 +125,11 @@ public class VideoMonitorServiceImpl implements VideoMonitorService {
         return videoMonitorDao.checkVideoDevId(dto);
     }
 
+    @Override
+    public VideoMonitorDTO getTotalCarAndPeople(VideoMonitorVO vo) {
+        return videoMonitorDao.getTotalCarAndPeople(vo);
+    }
+
     @Override
     public VideoMonitorDTO getOneByDevId(String devId) {
         return videoMonitorDao.getOneByDevId(devId);

+ 5 - 0
src/main/java/com/welampiot/service/impl/WifiServiceImpl.java

@@ -202,4 +202,9 @@ public class WifiServiceImpl implements WifiService {
     public WifiDTO getWifiInfoDetails(WifiDTO dto) {
         return wifiDao.getWifiInfoDetails(dto);
     }
+
+    @Override
+    public WifiDTO getTotalWifiCountAndFlow(WifiDTO dto) {
+        return wifiDao.getTotalWifiCountAndFlow(dto);
+    }
 }

+ 16 - 0
src/main/java/com/welampiot/vo/LampPoleDataVO.java

@@ -25,4 +25,20 @@ public class LampPoleDataVO implements Serializable {
     private ChargeDTO chargeDev;
 
     private EmergencyDTO emergencyDev;
+
+    private String dataType; // 数据类型
+
+    private LampPoleDataDTO dataData; // 概览信息
+
+    private LampPoleDataDTO dataMap; // 地图信息
+
+    private LampPoleDataDTO data7Day; // 7天用电量
+
+    private LampPoleDataDTO dataAlarmControl; // 全国故障排名
+
+    private LampPoleDataDTO dataAlarmList; // 故障信息列表
+
+    private LampPoleDataDTO dataLogList; // 日志信息列表
+
+    private LampPoleInfoVO dataDevCount; // 设备数量信息
 }

+ 6 - 0
src/main/java/com/welampiot/vo/LampPoleInfoVO.java

@@ -30,4 +30,10 @@ public class LampPoleInfoVO {
     private Integer lockCount;
     private Integer tiltCount;
     private Integer waterImmersionCount;
+    private Integer broadcastCount;
+    private Integer wellCoverCount;
+    private Integer trashCount;
+    private Integer oneKeyCount;
+    private Integer lineCount;
+    private Integer ledCount;
 }

+ 4 - 18
src/main/resources/mapper/AllAlarmInfoLogMapper.xml

@@ -628,11 +628,11 @@
     <select id="getManholeAlarmTotal" resultType="Integer">
         select count(*)
         from all_alarm_info_log a
+        left join manhole m on a.lampid = m.id
         left join section s on a.sectionId = s.id
         left join global_location gl on s.pid = gl.id
         left join global_location gl1 on gl.pid = gl1.id
         left join global_location gl2 on gl1.pid = gl2.id
-        left join manhole m on a.lampid = m.id
         where a.devType = 2
         <if test="sectionList != null and !sectionList.isEmpty()">
             and a.sectionId in
@@ -658,19 +658,16 @@
         <if test="keyword != null and keyword != ''">
             and m.address like '%${keyword}%'
         </if>
-        <if test="limit >= 0 and offset > 0">
-            limit #{limit},#{offset}
-        </if>
     </select>
 
     <select id="getLampAlarmTotal" resultType="Integer">
         select count(*)
         from all_alarm_info_log a
+        left join lampinfo m on a.lampid = m.id
         left join section s on a.sectionId = s.id
         left join global_location gl on s.pid = gl.id
         left join global_location gl1 on gl.pid = gl1.id
         left join global_location gl2 on gl1.pid = gl2.id
-        left join lampinfo m on a.lampid = m.id
         where a.devType = 0
         <if test="sectionList != null and !sectionList.isEmpty()">
             and a.sectionId in
@@ -696,9 +693,6 @@
         <if test="keyword != null and keyword != ''">
             and m.number like '%${keyword}%'
         </if>
-        <if test="limit >= 0 and offset > 0">
-            limit #{limit},#{offset}
-        </if>
     </select>
 
     <select id="getLampPoleAlarmTotal" resultType="Integer">
@@ -734,9 +728,6 @@
         <if test="keyword != null and keyword != ''">
             and m.number like '%${keyword}%'
         </if>
-        <if test="limit >= 0 and offset > 0">
-            limit #{limit},#{offset}
-        </if>
     </select>
 
     <select id="getEleBoxAlarmTotal" resultType="Integer">
@@ -772,9 +763,6 @@
         <if test="keyword != null and keyword != ''">
             and m.address like '%${keyword}%'
         </if>
-        <if test="limit >= 0 and offset > 0">
-            limit #{limit},#{offset}
-        </if>
     </select>
 
     <select id="getWaterAlarmTotal" resultType="Integer">
@@ -811,9 +799,6 @@
         <if test="keyword != null and keyword != ''">
             and m.number like '%${keyword}%'
         </if>
-        <if test="limit >= 0 and offset > 0">
-            limit #{limit},#{offset}
-        </if>
     </select>
 
     <select id="getAlarmInfoDTOById" resultType="AllAlarmInfoLogDTO">
@@ -883,12 +868,13 @@
         left join lamp_pole lp on a.lampid = lp.id
         where a.devType = 1
         <if test="sectionList != null and !sectionList.isEmpty()">
-            and a.sectionId in
+            and lp.sectionId in
             <foreach collection="sectionList" item="item" separator="," open="(" close=")">
                 #{item}
             </foreach>
         </if>
         order by a.updatetime desc
+        limit 100
     </select>
 
 </mapper>

+ 22 - 0
src/main/resources/mapper/ChargeMapper.xml

@@ -192,5 +192,27 @@
             and c.id != #{id}
         </if>
     </select>
+    
+    <!-- 智诺云信息概览充电量和充电金额 -->
+    <select id="getTotalChargeEleAndFree" resultType="ChargeDTO">
+        select
+            sum(c.equipmentElectricity) as equipmentElectricity,
+            sum(c.free) as free
+        from charge c
+        left join lamp_pole lp on lp.id = c.lamp_pole_id
+        where 1=1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and lp.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and lp.sectionid = #{sectionId}
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and lp.areaid = #{areaId}
+        </if>
+    </select>
 
 </mapper>

+ 46 - 0
src/main/resources/mapper/LampInfoCacheByDayMapper.xml

@@ -101,6 +101,27 @@
         </if>
     </select>
 
+    <!-- 当天用电量 -->
+    <select id="getOneDayConSum" resultType="LampInfoCacheByDayDTO">
+        SELECT SUM(l.consum) AS conSum,
+        SUM(l.powerSave) AS powerSave,
+        SUM(l.lightTime) AS lightTime
+        FROM lamp_info_cache_by_day l
+        WHERE l.updatetime = CURDATE()
+        <if test="areaId != null and areaId != 0">
+            and l.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and l.sectionid = #{sectionId}
+        </if>
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and l.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
     <select id="getSectionOfYearConSum" resultType="LampInfoCacheByDayDTO">
         SELECT SUM(l.consum) AS conSum,
         SUM(l.powerSave) AS powerSave,
@@ -254,4 +275,29 @@
         </if>
     </delete>
 
+    <!--  最近用电量列表  -->
+    <select id="getNearDayConSumList" resultType="LampInfoCacheByDayDTO">
+        SELECT SUM(l.consum) AS conSum,
+        SUM(l.powerSave) AS powerSave,
+        SUM(l.lightTime) AS lightTime,
+        l.updatetime AS updateTime
+        FROM lamp_info_cache_by_day l
+        WHERE l.updatetime <![CDATA[ >= ]]> #{startDate}
+        AND l.updatetime <![CDATA[ <= ]]> #{endDate}
+        <if test="areaId != null and areaId != 0">
+            AND l.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            AND l.sectionid = #{sectionId}
+        </if>
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            AND l.sectionid IN
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        GROUP BY l.updatetime
+        ORDER BY l.updatetime DESC
+    </select>
+
 </mapper>

+ 2 - 1
src/main/resources/mapper/LampInfoLogNewMapper.xml

@@ -16,7 +16,8 @@
 
     <select id="getSumEleByDTO" resultType="com.welampiot.dto.LampInfoLogNewDTO">
         select sum(l.total_ele_save_cache) as sumTotalEleSave,
-               sum(l.total_gener_energy_cache) as sumTotalGeneraEnergy
+               sum(l.total_gener_energy_cache) as sumTotalGeneraEnergy,
+               sum(l.work_time_total) as workTimeTotal
         from lamp_info_log_new l
         left join lampinfo l1 on l.lampid = l1.id
         where 1=1

+ 55 - 0
src/main/resources/mapper/LampMapper.xml

@@ -1048,4 +1048,59 @@
             </foreach>
         </if>
     </select>
+
+    <!-- 灯控路段故障数前十 -->
+    <select id="getLampSectionAlarmCountTop" resultType="LampInfoDTO">
+        SELECT
+        COUNT(b.id) as total,
+        s.name
+        FROM
+        lampinfo b
+        LEFT JOIN section s on b.sectionid = s.id,
+        (
+            SELECT
+            t1.lampid AS lampId
+            FROM
+            all_alarm_info_log t1,
+            (
+                SELECT
+                l.id,
+                a.id AS alarmId,
+                MAX( a.id ) AS maxId,
+                MAX( a.updatetime ) AS maxTime,
+                a.lampid,
+                a.`status`,
+                a.devType
+                FROM
+                lampinfo l
+                LEFT JOIN
+                all_alarm_info_log a ON a.lampid = l.id
+                WHERE
+                a.devType = 0
+                <if test="sectionList != null and !sectionList.isEmpty()">
+                    AND l.sectionid IN
+                    <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+                <if test="areaId != null and areaId != 0">
+                    AND l.areaid = #{areaId}
+                </if>
+                <if test="sectionId != null and sectionId != 0">
+                    AND l.sectionid = #{sectionId}
+                </if>
+                GROUP BY
+                a.lampid
+            ) t2
+            WHERE
+            t1.id = t2.maxId
+            AND t1.`status` != 2
+        ) t3
+        WHERE
+        b.id = t3.lampId
+        GROUP BY b.sectionid
+        ORDER BY total DESC
+        LIMIT 10
+    </select>
+
 </mapper>

+ 262 - 8
src/main/resources/mapper/LampPoleMapper.xml

@@ -314,6 +314,95 @@
         <if test="areaId != null and areaId != 0">
             AND lp.areaid = #{areaId}
         </if>
+        <if test="sectionId != null and sectionId != 0">
+            AND lp.sectionid = #{sectionId}
+        </if>
+    </select>
+
+    <!-- 回路数量 -->
+    <select id="getLoopCount" resultType="Integer">
+        SELECT
+        count(m.id)
+        AS total
+        FROM `loop` m
+        WHERE 1=1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            AND m.sectionid IN
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            AND m.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            AND m.sectionid = #{sectionId}
+        </if>
+    </select>
+
+    <!-- 垃圾桶数量 -->
+    <select id="getTrashCount" resultType="Integer">
+        SELECT
+        count(m.id)
+        AS total
+        FROM `transh_info` m
+        WHERE 1=1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            AND m.sectionid IN
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            AND m.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            AND m.sectionid = #{sectionId}
+        </if>
+    </select>
+
+    <!-- 井盖数量 -->
+    <select id="getManholeCount" resultType="Integer">
+        SELECT
+        count(m.id)
+        AS total
+        FROM manhole m
+        WHERE m.type = 0
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            AND m.sectionid IN
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            AND m.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            AND m.sectionid = #{sectionId}
+        </if>
+    </select>
+
+    <!-- 路灯数量 -->
+    <select id="getLampInfoCount" resultType="Integer">
+        SELECT
+        count(vm.id)
+        AS total
+        FROM lamp_pole lp
+        LEFT JOIN lampinfo vm
+        ON vm.lamp_pole_id = lp.id
+        WHERE vm.lamp_pole_id != 0
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            AND lp.sectionid IN
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            AND lp.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            AND lp.sectionid = #{sectionId}
+        </if>
     </select>
 
     <!-- 屏幕数量 -->
@@ -334,6 +423,9 @@
         <if test="areaId != null and areaId != 0">
             AND lp.areaid = #{areaId}
         </if>
+        <if test="sectionId != null and sectionId != 0">
+            AND lp.sectionid = #{sectionId}
+        </if>
     </select>
 
     <!-- WIFI数量 -->
@@ -354,6 +446,9 @@
         <if test="areaId != null and areaId != 0">
             AND lp.areaid = #{areaId}
         </if>
+        <if test="sectionId != null and sectionId != 0">
+            AND lp.sectionid = #{sectionId}
+        </if>
     </select>
 
     <!-- 气象站数量 -->
@@ -374,6 +469,9 @@
         <if test="areaId != null and areaId != 0">
             AND lp.areaid = #{areaId}
         </if>
+        <if test="sectionId != null and sectionId != 0">
+            AND lp.sectionid = #{sectionId}
+        </if>
     </select>
 
     <!-- 充电桩数量 -->
@@ -394,6 +492,9 @@
         <if test="areaId != null and areaId != 0">
             AND lp.areaid = #{areaId}
         </if>
+        <if test="sectionId != null and sectionId != 0">
+            AND lp.sectionid = #{sectionId}
+        </if>
     </select>
 
     <!-- 一键报警数量 -->
@@ -414,6 +515,9 @@
         <if test="areaId != null and areaId != 0">
             AND lp.areaid = #{areaId}
         </if>
+        <if test="sectionId != null and sectionId != 0">
+            AND lp.sectionid = #{sectionId}
+        </if>
     </select>
 
     <!-- RFID数量 -->
@@ -434,6 +538,9 @@
         <if test="areaId != null and areaId != 0">
             AND lp.areaid = #{areaId}
         </if>
+        <if test="sectionId != null and sectionId != 0">
+            AND lp.sectionid = #{sectionId}
+        </if>
     </select>
 
     <!-- 广播数量 -->
@@ -454,6 +561,9 @@
         <if test="areaId != null and areaId != 0">
             AND lp.areaid = #{areaId}
         </if>
+        <if test="sectionId != null and sectionId != 0">
+            AND lp.sectionid = #{sectionId}
+        </if>
     </select>
 
     <select id="getSectionIdByLampPoleId" resultType="Integer">
@@ -477,11 +587,14 @@
         where l.id = #{id}
     </select>
 
+    <!--  获取灯杆故障总数  -->
     <select id="getLampPoleAlarmTotal" resultType="Integer">
-        select count(*) as total
-        from (SELECT
+        SELECT
+            count(*) AS total
+        FROM all_alarm_info_log t1,
+            (SELECT
                   l.id,
-                  a.id AS alarmId,
+                  MAX(a.id) AS alarmId,
                   MAX(a.updatetime) as maxTime,
                   a.lampid,
                   a.`status`,
@@ -493,22 +606,141 @@
               ON a.lampid = l.id
               WHERE
                   a.devType = 1
-              AND a.`status` != 2
               <if test="sectionList != null and !sectionList.isEmpty()">
-                  and l.sectionid in
+                  AND l.sectionid IN
                   <foreach collection="sectionList" item="item" open="(" separator="," close=")">
                     #{item}
                   </foreach>
               </if>
               <if test="areaId != null and areaId != 0">
-                  and l.areaid = #{areaId}
+                  AND l.areaid = #{areaId}
               </if>
               <if test="sectionId != null and sectionId != 0">
-                  and l.sectionid = #{sectionId}
+                  AND l.sectionid = #{sectionId}
               </if>
               GROUP BY
                   a.lampid
-              ORDER BY maxTime) a
+              ORDER BY maxTime) t2
+        WHERE t1.id = t2.alarmId AND t1.`status` != 2
+    </select>
+    
+    <!--  获取灯杆故障列表  -->
+    <select id="getAlarmLampPoleList" resultType="LampPoleDTO">
+        SELECT
+            lp.id,
+            lp.longitude,
+            lp.latitude
+        FROM
+            lamp_pole lp,
+            (
+                SELECT
+                    t1.lampid AS lampId
+                FROM
+                    all_alarm_info_log t1,
+                    (
+                        SELECT
+                            l.id,
+                            a.id AS alarmId,
+                            MAX( a.id ) AS maxId,
+                            MAX( a.updatetime ) AS maxTime,
+                            a.lampid,
+                            a.`status`,
+                            a.devType
+                        FROM
+                            lamp_pole l
+                        LEFT JOIN 
+                                all_alarm_info_log a ON a.lampid = l.id
+                        WHERE
+                            a.devType = 1
+                            <if test="sectionList != null and !sectionList.isEmpty()">
+                                AND l.sectionid IN
+                                <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                                    #{item}
+                                </foreach>
+                            </if>
+                            <if test="areaId != null and areaId != 0">
+                                AND l.areaid = #{areaId}
+                            </if>
+                            <if test="sectionId != null and sectionId != 0">
+                                AND l.sectionid = #{sectionId}
+                            </if>
+                        GROUP BY
+                            a.lampid
+                    ) t2
+                WHERE
+                    t1.id = t2.maxId
+                  AND t1.`status` != 2
+            ) t3
+        WHERE
+            lp.id = t3.lampId
+    </select>
+
+    <select id="getLampPoleAlarmInfoList" resultType="LampPoleDTO">
+        select
+            a.updatetime as updateTime,
+            a.stralarmtype as alarmInfo,
+            lp.name
+        from lamp_pole lp
+        left join all_alarm_info_log a on a.lampid = lp.id
+        where a.devType = 1 and a.status != 2
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and lp.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and lp.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and lp.sectionid = #{sectionId}
+        </if>
+        order by updateTime desc
+        limit 100
+    </select>
+
+    <!-- 路灯亮灯数 -->
+    <select id="getLampPoleLightCount" resultType="Integer">
+        select
+            count(*)
+        from lamp_pole lp
+        left join lampinfo l on lp.id = l.lamp_pole_id
+        where l.status = 1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and l.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and l.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and l.sectionid = #{sectionId}
+        </if>
+    </select>
+
+    <!-- 路灯亮灯列表 -->
+    <select id="getLampPoleLightList" resultType="LampPoleDTO">
+        select
+        lp.id,
+        lp.longitude,
+        lp.latitude
+        from lamp_pole lp
+        left join lampinfo l on lp.id = l.lamp_pole_id
+        where l.status = 1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and l.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and l.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and l.sectionid = #{sectionId}
+        </if>
     </select>
 
     <select id="getNewCreateLampPoleCount" resultType="Integer">
@@ -549,6 +781,28 @@
         </if>
     </select>
 
+    <!-- 灯杆安装列表 -->
+    <select id="getLampPoleInstallList" resultType="LampPoleDTO">
+        select
+            l.id,
+            l.longitude,
+            l.latitude
+        from lamp_pole l
+        where l.id != 0
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and l.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and l.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and l.sectionid = #{sectionId}
+        </if>
+    </select>
+
     <update id="updateLampPoleDevType" parameterType="LampPoleDTO">
         update
             lamp_pole l

+ 11 - 0
src/main/resources/mapper/OperationLogMapper.xml

@@ -148,4 +148,15 @@
         )
     </insert>
 
+    <select id="getNewOperationLogList" resultType="com.welampiot.dto.OperationLogDTO" parameterType="com.welampiot.vo.OperationLogVO">
+        select o.time as updateTime,o.remark as logInfo,o.acount as `name`
+        from operation_log o
+        where 1=1
+        <if test="role != 1">
+            and o.userid = #{userId}
+        </if>
+        order by o.time desc
+        limit 100
+    </select>
+
 </mapper>

+ 20 - 0
src/main/resources/mapper/VideoMonitorMapper.xml

@@ -380,5 +380,25 @@
         </if>
     </select>
 
+    <!--  智诺云信息概览车流量,人流量  -->
+    <select id="getTotalCarAndPeople" resultType="VideoMonitorDTO">
+        select
+            sum(v.peopleCountTotal) as peopleCountTotal,
+            sum(v.carCountTotal) as carCountTotal
+        from video_monitor v
+        where 1=1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and v.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and v.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and v.sectionid = #{sectionId}
+        </if>
+    </select>
 
 </mapper>

+ 22 - 0
src/main/resources/mapper/WifiMapper.xml

@@ -262,4 +262,26 @@
             and w.lamp_pole_id = #{lampPoleId}
         </if>
     </select>
+
+    <!--  智诺云信息概览累计流量和wifi连接次数  -->
+    <select id="getTotalWifiCountAndFlow" resultType="WifiDTO">
+        select
+            sum(w.device_count) as deviceCount,
+            sum(w.flow) as flow
+        from wifi w
+        left join lamp_pole lp on lp.id = w.lamp_pole_id
+        where 1=1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and lp.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and lp.sectionid = #{sectionId}
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and lp.areaid = #{areaId}
+        </if>
+    </select>
 </mapper>