Prechádzať zdrojové kódy

智慧灯杆:获取灯杆下灯控列表、删除灯杆设备组件、编辑灯杆设备组件

zhj 2 rokov pred
rodič
commit
58185400ff
54 zmenil súbory, kde vykonal 1570 pridanie a 18 odobranie
  1. 8 0
      src/main/java/com/welampiot/common/InterfaceResultEnum.java
  2. 485 0
      src/main/java/com/welampiot/controller/LampPoleController.java
  3. 5 14
      src/main/java/com/welampiot/controller/NoiseDevInfoController.java
  4. 20 0
      src/main/java/com/welampiot/dao/BenchDevInfoDao.java
  5. 12 0
      src/main/java/com/welampiot/dao/BroadcastDao.java
  6. 13 0
      src/main/java/com/welampiot/dao/CableDao.java
  7. 10 0
      src/main/java/com/welampiot/dao/ChargeDao.java
  8. 12 0
      src/main/java/com/welampiot/dao/EmergencyDao.java
  9. 10 0
      src/main/java/com/welampiot/dao/EnvmonitorDao.java
  10. 3 0
      src/main/java/com/welampiot/dao/LampDao.java
  11. 10 0
      src/main/java/com/welampiot/dao/ScreenDao.java
  12. 6 0
      src/main/java/com/welampiot/dao/VideoMonitorDao.java
  13. 16 0
      src/main/java/com/welampiot/dao/WeatherRS485DevInfoDao.java
  14. 2 0
      src/main/java/com/welampiot/dao/WifiDao.java
  15. 29 0
      src/main/java/com/welampiot/dto/BenchDevInfoDTO.java
  16. 2 0
      src/main/java/com/welampiot/dto/BroadcastDTO.java
  17. 3 1
      src/main/java/com/welampiot/dto/CableDTO.java
  18. 2 0
      src/main/java/com/welampiot/dto/EmergencyDTO.java
  19. 31 0
      src/main/java/com/welampiot/dto/WeatherRS485DevInfoDTO.java
  20. 18 0
      src/main/java/com/welampiot/service/BenchDevInfoService.java
  21. 12 0
      src/main/java/com/welampiot/service/BroadcastService.java
  22. 13 0
      src/main/java/com/welampiot/service/CableService.java
  23. 10 0
      src/main/java/com/welampiot/service/ChargeService.java
  24. 12 0
      src/main/java/com/welampiot/service/EmergencyService.java
  25. 10 0
      src/main/java/com/welampiot/service/EnvmonitorService.java
  26. 3 0
      src/main/java/com/welampiot/service/LampService.java
  27. 10 0
      src/main/java/com/welampiot/service/ScreenService.java
  28. 3 0
      src/main/java/com/welampiot/service/VideoMonitorService.java
  29. 16 0
      src/main/java/com/welampiot/service/WeatherRS485DevInfoService.java
  30. 2 0
      src/main/java/com/welampiot/service/WifiService.java
  31. 36 0
      src/main/java/com/welampiot/service/impl/BenchDevInfoServiceImpl.java
  32. 30 0
      src/main/java/com/welampiot/service/impl/BroadcastServiceImpl.java
  33. 30 0
      src/main/java/com/welampiot/service/impl/CableServiceImpl.java
  34. 25 0
      src/main/java/com/welampiot/service/impl/ChargeServiceImpl.java
  35. 30 0
      src/main/java/com/welampiot/service/impl/EmergencyServiceImpl.java
  36. 25 0
      src/main/java/com/welampiot/service/impl/EnvmonitorServiceImpl.java
  37. 15 0
      src/main/java/com/welampiot/service/impl/LampServiceImpl.java
  38. 25 0
      src/main/java/com/welampiot/service/impl/ScreenServiceImpl.java
  39. 15 0
      src/main/java/com/welampiot/service/impl/VideoMonitorServiceImpl.java
  40. 27 0
      src/main/java/com/welampiot/service/impl/WeatherRS485DevInfoServiceImpl.java
  41. 10 0
      src/main/java/com/welampiot/service/impl/WifiServiceImpl.java
  42. 36 0
      src/main/java/com/welampiot/utils/ToolUtils.java
  43. 23 0
      src/main/resources/mapper/BenchDevInfoMapper.xml
  44. 64 0
      src/main/resources/mapper/BroadcastMapper.xml
  45. 64 0
      src/main/resources/mapper/CableMapper.xml
  46. 51 0
      src/main/resources/mapper/ChargeMapper.xml
  47. 67 1
      src/main/resources/mapper/EmergencyMapper.xml
  48. 64 1
      src/main/resources/mapper/EnvmonitorMapper.xml
  49. 21 0
      src/main/resources/mapper/LampMapper.xml
  50. 1 1
      src/main/resources/mapper/LampPoleMapper.xml
  51. 57 0
      src/main/resources/mapper/ScreenMapper.xml
  52. 18 0
      src/main/resources/mapper/VideoMonitorMapper.xml
  53. 10 0
      src/main/resources/mapper/WeatherRS485DevInfoMapper.xml
  54. 38 0
      src/main/resources/mapper/WifiMapper.xml

+ 8 - 0
src/main/java/com/welampiot/common/InterfaceResultEnum.java

@@ -136,6 +136,14 @@ public enum InterfaceResultEnum {
     RADAR_NAME_UNIQUE_ERROR("0329","雷达名称重复","The name of the radar to repeat","Повтор названия радиолокатора"),
     RADAR_NUMBER_UNIQUE_ERROR("0330","雷达编号重复","The number of the radar to repeat","Повтор номера радара"),
     RADAR_ADDRESS_UNIQUE_ERROR("0331","雷达地址重复","The address of the radar to repeat","Повтор радиолокационного адреса"),
+    SCREEN_NUM_UNIQUE_ERROR("0332","屏幕序列号已存在","The screen serial number already exists","Серийный номер экрана уже существует"),
+    CHARGE_NUM_UNIQUE_ERROR("0333","充电桩序列号已存在","The serial number of the charging pile already exists","Серийный номер заряда уже существует"),
+    EMERGENCY_MODEL_UNIQUE_ERROR("0334","一键报警设备名称已存在","The name of the one-click alarm device already exists","Один ключ сигнализации уже существует"),
+    EMERGENCY_NUM_UNIQUE_ERROR("0335","一键报警序列号已存在","The one-click alarm serial number already exists","Серийный номер одной кнопки сигнализации уже существует"),
+    BROADCAST_NAME_UNIQUE_ERROR("0336","音柱名称已存在","The sound post name already exists","Имя колонны уже существует"),
+    BROADCAST_ADDRESS_UNIQUE_ERROR("0337","音柱地址已存在","The sound post address already exists","Адрес колонны уже существует"),
+    CABLE_ADDRESS_UNIQUE_ERROR("0338","电缆地址已存在","The cable address already exists","Адрес кабеля уже существует"),
+    CABLE_NAME_UNIQUE_ERROR("0339","电缆名称已存在","The cable name already exists","Имя кабеля уже существует"),
     ;
     private String code;
     private String msgCn;

+ 485 - 0
src/main/java/com/welampiot/controller/LampPoleController.java

@@ -6,6 +6,8 @@ import com.welampiot.dto.*;
 import com.welampiot.service.*;
 import com.welampiot.utils.ToolUtils;
 import com.welampiot.vo.*;
+import org.json.JSONArray;
+import org.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -50,6 +52,16 @@ public class LampPoleController {
     private ChargeService chargeService;
     @Autowired
     private EnvmonitorService envmonitorService;
+    @Autowired
+    private VideoMonitorService videoMonitorService;
+    @Autowired
+    private BroadcastService broadcastService;
+    @Autowired
+    private CableService cableService;
+    @Autowired
+    private BenchDevInfoService benchDevInfoService;
+    @Autowired
+    private WeatherRS485DevInfoService weatherRS485DevInfoService;
 
     /**
      * 获取屏幕详情
@@ -226,4 +238,477 @@ public class LampPoleController {
         }
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,lampPoleDataVO);
     }
+
+    /**
+     * 获取灯杆下灯控列表
+     * @param request 灯杆id
+     * @return 灯杆下灯控列表
+     */
+    @RequestMapping(value = "/lampList", method = RequestMethod.POST)
+    public BaseResult<?> lampList(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer id = (Integer) toolUtils.getRequestContent(request,"id",1);
+        if (id == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
+        List<LampInfoDTO> lampList = lampService.getLampListByLampPoleId(id);
+        LampInfoVO lampInfoVO = new LampInfoVO();
+        lampInfoVO.setList(lampList);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,lampInfoVO);
+    }
+
+    /**
+     * 删除灯杆组件设备
+     * @param request 设备id,设备类型
+     * @return 删除灯杆组件设备
+     */
+    @RequestMapping(value = "/delLampPoleDev", method = RequestMethod.POST)
+    public BaseResult<?> delLampPoleDev(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        String devId = (String) toolUtils.getRequestContent(request,"devId",2);
+        Integer type = (Integer) toolUtils.getRequestContent(request,"type",1);
+        if (devId.length() == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
+        String[] split = devId.split(",");
+        if (type == 0) { // 路灯
+            for (String s : split) {
+                Integer id = Integer.valueOf(s);
+                Integer lampPoleId = lampService.getLampPoleIdByLampId(id);
+                lampService.deleteById(id);
+                Integer lampCount = lampService.getLampCountByLampPoleId(lampPoleId);
+                if (lampCount == 0) {
+                    LampPoleDTO dto = lampPoleService.getLampPoleDTOById(lampPoleId);
+                    String devType = dto.getDevType();
+                    toolUtils.updateLampPoleDevType(devType,0,lampPoleId);
+                }
+            }
+        } else if (type == 1) { // 摄像头
+            for (String s : split) {
+                Integer id = Integer.valueOf(s);
+                Integer lampPoleId = videoMonitorService.getLampPoleIdByVideoMonitorId(id);
+                videoMonitorService.deleteVideoMonitorById(id);
+                Integer lampCount = videoMonitorService.getVideoCountByLampPoleId(lampPoleId);
+                if (lampCount == 0) {
+                    LampPoleDTO dto = lampPoleService.getLampPoleDTOById(lampPoleId);
+                    String devType = dto.getDevType();
+                    toolUtils.updateLampPoleDevType(devType,1,lampPoleId);
+                }
+            }
+        } else if (type == 4) { // LED屏
+            for (String s : split) {
+                Integer id = Integer.valueOf(s);
+                Integer lampPoleId = screenService.getLampPoleIdByScreenId(id);
+                screenService.deleteScreenById(id);
+                Integer lampCount = screenService.getScreenCountByLampPoleId(lampPoleId);
+                if (lampCount == 0) {
+                    LampPoleDTO dto = lampPoleService.getLampPoleDTOById(lampPoleId);
+                    String devType = dto.getDevType();
+                    toolUtils.updateLampPoleDevType(devType,4,lampPoleId);
+                }
+            }
+        } else if (type == 5) { // 一键报警
+            for (String s : split) {
+                Integer id = Integer.valueOf(s);
+                Integer lampPoleId = emergencyService.getLampPoleIdByEmergencyId(id);
+                emergencyService.deleteEmergencyById(id);
+                Integer lampCount = emergencyService.getEmergencyCountByLampPoleId(lampPoleId);
+                if (lampCount == 0) {
+                    LampPoleDTO dto = lampPoleService.getLampPoleDTOById(lampPoleId);
+                    String devType = dto.getDevType();
+                    toolUtils.updateLampPoleDevType(devType,5,lampPoleId);
+                }
+            }
+        } else if (type == 6) { // 充电桩
+            for (String s : split) {
+                Integer id = Integer.valueOf(s);
+                Integer lampPoleId = chargeService.getLampPoleIdByChargeId(id);
+                chargeService.deleteChargeById(id);
+                Integer lampCount = chargeService.getChargeCountByLampPoleId(lampPoleId);
+                if (lampCount == 0) {
+                    LampPoleDTO dto = lampPoleService.getLampPoleDTOById(lampPoleId);
+                    String devType = dto.getDevType();
+                    toolUtils.updateLampPoleDevType(devType,6,lampPoleId);
+                }
+            }
+        } else if (type == 7) { // 气象站
+            for (String s : split) {
+                Integer id = Integer.valueOf(s);
+                Integer lampPoleId = envmonitorService.getLampPoleIdByEnvmonitorId(id);
+                envmonitorService.deleteEnvmonitorById(id);
+                Integer lampCount = envmonitorService.getEnvmonitorCountByLampPoleId(lampPoleId);
+                if (lampCount == 0) {
+                    LampPoleDTO dto = lampPoleService.getLampPoleDTOById(lampPoleId);
+                    String devType = dto.getDevType();
+                    toolUtils.updateLampPoleDevType(devType,7,lampPoleId);
+                }
+            }
+        } else if (type == 9) { // 广播音柱
+            for (String s : split) {
+                Integer id = Integer.valueOf(s);
+                BroadcastDTO dto = broadcastService.getBroadcastById(id);
+                broadcastService.deleteBroadcastById(id);
+                Integer lampCount = broadcastService.getBroadcastCountByLampPoleId(dto.getLampPoleId());
+                if (lampCount == 0) {
+                    LampPoleDTO dto1 = lampPoleService.getLampPoleDTOById(dto.getLampPoleId());
+                    String devType = dto1.getDevType();
+                    toolUtils.updateLampPoleDevType(devType,9,dto.getLampPoleId());
+                }
+            }
+        } else if (type == 11) { // 电缆
+            for (String s : split) {
+                Integer id = Integer.valueOf(s);
+                CableDTO cableDTO = cableService.getCableById(id);
+                cableService.deleteCableById(id);
+                Integer lampCount = cableService.getCableCountByLampPoleId(cableDTO.getLampPoleId());
+                if (lampCount == 0) {
+                    LampPoleDTO dto = lampPoleService.getLampPoleDTOById(cableDTO.getLampPoleId());
+                    String devType = dto.getDevType();
+                    toolUtils.updateLampPoleDevType(devType,11,cableDTO.getLampPoleId());
+                }
+            }
+        } else if (type == 12) { // 太阳能板凳
+            for (String s : split) {
+                Integer id = Integer.valueOf(s);
+                Integer lampPoleId = benchDevInfoService.getLampPoleIdByBenchId(id);
+                benchDevInfoService.deleteBenchById(id);
+                Integer lampCount = benchDevInfoService.getBenchCountByLampPoleId(lampPoleId);
+                if (lampCount == 0) {
+                    LampPoleDTO dto = lampPoleService.getLampPoleDTOById(lampPoleId);
+                    String devType = dto.getDevType();
+                    toolUtils.updateLampPoleDevType(devType,12,lampPoleId);
+                }
+            }
+        }
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version);
+    }
+
+    /**
+     * 编辑灯杆组件
+     * @param request 设备id,设备类型
+     * @return 编辑灯杆组件
+     */
+    @RequestMapping(value = "/updateLampPoleDev", method = RequestMethod.POST)
+    public BaseResult<?> updateLampPoleDev(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer devId = (Integer) toolUtils.getRequestContent(request,"devId",1);
+        Integer lampPoleId = (Integer) toolUtils.getRequestContent(request,"lampPoleId",1);
+        Integer type = (Integer) toolUtils.getRequestContent(request,"type",1);
+        if (lampPoleId == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
+        String installDate = (String) toolUtils.getRequestContent(request,"installDate",2);
+        String expirationDate = (String) toolUtils.getRequestContent(request,"expirationDate",2);
+        if (type == 4) { // LED屏
+            String model = (String) toolUtils.getRequestContent(request,"model",2);
+            String num = (String) toolUtils.getRequestContent(request,"num",2);
+            String resole = (String) toolUtils.getRequestContent(request,"resole",2);
+            Integer role = (Integer) toolUtils.getRequestContent(request,"role",1);
+            Integer powerModel = (Integer) toolUtils.getRequestContent(request,"powerModel",1);
+            Integer comModel = (Integer) toolUtils.getRequestContent(request,"comModel",1);
+            Integer maxLight = (Integer) toolUtils.getRequestContent(request,"maxLight",1);
+            Integer width = (Integer) toolUtils.getRequestContent(request,"width",1);
+            Integer height = (Integer) toolUtils.getRequestContent(request,"height",1);
+            if (model.length() == 0 || num.length() == 0 || resole.length() == 0)
+                return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+            if (width == 0 || height == 0 || maxLight == 0)
+                return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+            ScreenDTO screenDTO = new ScreenDTO();
+            screenDTO.setInstallDate(installDate);
+            screenDTO.setExpirationDate(expirationDate);
+            screenDTO.setModel(model);
+            screenDTO.setNum(num);
+            screenDTO.setResolve(resole);
+            screenDTO.setRole(role);
+            screenDTO.setPowerModel(powerModel);
+            screenDTO.setComModel(comModel);
+            screenDTO.setMaxLight(maxLight);
+            screenDTO.setWidth(width);
+            screenDTO.setHeight(height);
+            if (devId == 0) {
+                screenDTO.setLampPoleId(lampPoleId);
+                ScreenDTO dto = new ScreenDTO();
+                dto.setNum(num);
+                dto.setLampPoleId(lampPoleId);
+                if (screenService.checkScreenData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.SCREEN_NUM_UNIQUE_ERROR,version);
+                screenService.updateLampPoleScreenData(screenDTO);
+            } else {
+                screenDTO.setId(devId);
+                ScreenDTO dto = new ScreenDTO();
+                dto.setNum(num);
+                dto.setId(devId);
+                if (screenService.checkScreenData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.SCREEN_NUM_UNIQUE_ERROR,version);
+                screenService.updateLampPoleScreenData(screenDTO);
+            }
+        } else if (type == 5) { // 一键报警
+            Integer devType = (Integer) toolUtils.getRequestContent(request,"devType",1);
+            String model = (String) toolUtils.getRequestContent(request,"model",2);
+            String num = (String) toolUtils.getRequestContent(request,"num",2);
+            String remarks = (String) toolUtils.getRequestContent(request,"remarks",2);
+            if (model.length() == 0) return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+            if (devType != 2) {
+                if (num.length() == 0) return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+            }
+            EmergencyDTO emergencyDTO = new EmergencyDTO();
+            emergencyDTO.setDevType(devType);
+            emergencyDTO.setModel(model);
+            emergencyDTO.setNum(num);
+            emergencyDTO.setRemarks(remarks);
+            emergencyDTO.setExpirationDate(expirationDate);
+            emergencyDTO.setInstallDate(installDate);
+            if (devId == 0) {
+                emergencyDTO.setLampPoleId(lampPoleId);
+                EmergencyDTO dto = new EmergencyDTO();
+                dto.setLampPoleId(lampPoleId);
+                EmergencyDTO emergency = emergencyService.getEmergencyByLampPoleId(lampPoleId);
+                dto.setSectionId(emergency.getSectionId());
+                dto.setModel(model);
+                if (emergencyService.checkEmergencyData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.EMERGENCY_MODEL_UNIQUE_ERROR,version);
+                if (devType != 2) {
+                    dto = new EmergencyDTO();
+                    dto.setLampPoleId(lampPoleId);
+                    dto.setNum(num);
+                    if (emergencyService.checkEmergencyData(dto) > 0)
+                        return toolUtils.response(InterfaceResultEnum.EMERGENCY_NUM_UNIQUE_ERROR,version);
+                }
+                emergencyService.updateLampPoleEmergencyData(emergencyDTO);
+            } else {
+                emergencyDTO.setDevId(devId);
+                EmergencyDTO dto = new EmergencyDTO();
+                dto.setId(devId);
+                Integer sectionId = emergencyService.getEmergencySectionIdByLampPoleId(devId);
+                dto.setSectionId(sectionId);
+                dto.setModel(model);
+                if (emergencyService.checkEmergencyData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.EMERGENCY_MODEL_UNIQUE_ERROR,version);
+                if (devType != 2) {
+                    dto = new EmergencyDTO();
+                    dto.setLampPoleId(lampPoleId);
+                    dto.setNum(num);
+                    if (emergencyService.checkEmergencyData(dto) > 0)
+                        return toolUtils.response(InterfaceResultEnum.EMERGENCY_NUM_UNIQUE_ERROR,version);
+                }
+                emergencyService.updateLampPoleEmergencyData(emergencyDTO);
+            }
+        } else if (type == 6) { // 充电桩
+            Integer model = (Integer) toolUtils.getRequestContent(request,"model",1);
+            Integer power = (Integer) toolUtils.getRequestContent(request,"power",1);
+            Integer chargeModel = (Integer) toolUtils.getRequestContent(request,"chargeModel",1);
+            String num = (String) toolUtils.getRequestContent(request,"num",2);
+            if (num.length() == 0) return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+            ChargeDTO chargeDTO = new ChargeDTO();
+            chargeDTO.setModel(model);
+            chargeDTO.setNum(num);
+            chargeDTO.setPower(power);
+            chargeDTO.setChargeModel(chargeModel);
+            chargeDTO.setExpirationDate(expirationDate);
+            chargeDTO.setInstallDate(installDate);
+            if (devId == 0) {
+                chargeDTO.setLampPoleId(lampPoleId);
+                ChargeDTO dto = new ChargeDTO();
+                dto.setLampPoleId(lampPoleId);
+                dto.setNum(num);
+                if (chargeService.checkChargeData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.CHARGE_NUM_UNIQUE_ERROR,version);
+                chargeService.updateLampPoleChargeData(chargeDTO);
+            } else {
+                chargeDTO.setId(devId);
+                ChargeDTO dto = new ChargeDTO();
+                dto.setId(devId);
+                dto.setNum(num);
+                if (chargeService.checkChargeData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.CHARGE_NUM_UNIQUE_ERROR,version);
+                chargeService.updateLampPoleChargeData(chargeDTO);
+            }
+        } else if (type == 7) { // 气象站
+            Integer devType = (Integer) toolUtils.getRequestContent(request,"devType",1);
+            Integer pramType = (Integer) toolUtils.getRequestContent(request,"pramType",1);
+            Integer rate = (Integer) toolUtils.getRequestContent(request,"rate",1);
+            Integer netType = (Integer) toolUtils.getRequestContent(request,"netType",1);
+            Integer mp = (Integer) toolUtils.getRequestContent(request,"mp",1);
+            String model = (String) toolUtils.getRequestContent(request,"model",2);
+            String address = (String) toolUtils.getRequestContent(request,"address",2);
+            String devList = (String) toolUtils.getRequestContent(request,"devList",2);
+            if (address.length() == 0 || model.length() == 0)
+                return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+            if (devType == 9) {
+                if (mp == 0) return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+            }
+            if (netType == 1) {
+                if (devList.length() == 0)
+                    return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+                JSONArray jsonArray = new JSONArray(devList);
+                for (int i = 0; i < jsonArray.length();i ++) {
+                    JSONObject jsonObject = jsonArray.getJSONObject(i);
+                    int address1 = jsonObject.getInt("address");
+                    int devId1 = jsonObject.getInt("devId");
+                    WeatherRS485DevInfoDTO weatherRS485DevInfoDTO = new WeatherRS485DevInfoDTO();
+                    weatherRS485DevInfoDTO.setAddress(address1);
+                    weatherRS485DevInfoDTO.setDevId(devId1);
+                    weatherRS485DevInfoService.addWeatherRS485DevInfoData(weatherRS485DevInfoDTO);
+                }
+            }
+            EnvmonitorDTO envmonitorDTO = new EnvmonitorDTO();
+            envmonitorDTO.setDevType(devType);
+            envmonitorDTO.setPramType(pramType);
+            envmonitorDTO.setRate(rate);
+            envmonitorDTO.setNetType(netType);
+            envmonitorDTO.setMp(mp);
+            envmonitorDTO.setModel(model);
+            envmonitorDTO.setAddress(address);
+            envmonitorDTO.setExpirationDate(expirationDate);
+            envmonitorDTO.setInstallDate(installDate);
+            if (devId == 0) {
+                envmonitorDTO.setLampPoleId(lampPoleId);
+                EnvmonitorDTO envmonitor = envmonitorService.getEnvmonitorByLampPoleId(lampPoleId);
+                Integer sectionId = envmonitor.getSectionId();
+                EnvmonitorDTO dto = new EnvmonitorDTO();
+                dto.setLampPoleId(lampPoleId);
+                dto.setModel(model);
+                dto.setSectionId(sectionId);
+                if (envmonitorService.checkEnvmonitorData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.ENVMONITOR_NAME_UNIQUE_ERROR,version);
+                envmonitorService.updateLampPoleEnvmonitorData(envmonitorDTO);
+            } else {
+                envmonitorDTO.setId(devId);
+                EnvmonitorDTO envmonitor = envmonitorService.getEnvmonitorByLampPoleId(lampPoleId);
+                Integer sectionId = envmonitor.getSectionId();
+                EnvmonitorDTO dto = new EnvmonitorDTO();
+                dto.setId(devId);
+                dto.setModel(model);
+                dto.setSectionId(sectionId);
+                if (envmonitorService.checkEnvmonitorData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.ENVMONITOR_NAME_UNIQUE_ERROR,version);
+                envmonitorService.updateLampPoleEnvmonitorData(envmonitorDTO);
+            }
+        } else if (type == 9) { // 广播音柱
+            Integer devType = (Integer) toolUtils.getRequestContent(request,"devType",1);
+            String address = (String) toolUtils.getRequestContent(request,"address",2);
+            String name = (String) toolUtils.getRequestContent(request,"name",2);
+            if (name.length() == 0) return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+            if (devType == 0) {
+                if (address.length() == 0) return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+            }
+            BroadcastDTO broadcastDTO = new BroadcastDTO();
+            broadcastDTO.setType(devType);
+            broadcastDTO.setAddress(address);
+            broadcastDTO.setName(name);
+            broadcastDTO.setExpirationDate(expirationDate);
+            broadcastDTO.setInstallDate(installDate);
+            if (devId == 0) {
+                broadcastDTO.setLampPoleId(lampPoleId);
+                BroadcastDTO dto = new BroadcastDTO();
+                dto.setLampPoleId(lampPoleId);
+                BroadcastDTO broadcast = broadcastService.getBroadcastDTOByLampPoleId(lampPoleId);
+                dto.setSectionId(broadcast.getSectionId());
+                dto.setName(name);
+                if (broadcastService.checkBroadcastData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.BROADCAST_NAME_UNIQUE_ERROR,version);
+                if (devType == 0) {
+                    dto = new BroadcastDTO();
+                    dto.setLampPoleId(lampPoleId);
+                    dto.setAddress(address);
+                    if (broadcastService.checkBroadcastData(dto) > 0)
+                        return toolUtils.response(InterfaceResultEnum.BROADCAST_ADDRESS_UNIQUE_ERROR,version);
+                }
+                broadcastService.updateLampPoleBroadcastData(broadcastDTO);
+            } else {
+                broadcastDTO.setId(devId);
+                BroadcastDTO dto = new BroadcastDTO();
+                dto.setId(devId);
+                BroadcastDTO broadcast = broadcastService.getBroadcastById(devId);
+                dto.setSectionId(broadcast.getSectionId());
+                dto.setName(name);
+                if (broadcastService.checkBroadcastData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.BROADCAST_NAME_UNIQUE_ERROR,version);
+                if (devType == 0) {
+                    dto = new BroadcastDTO();
+                    dto.setId(devId);
+                    dto.setAddress(address);
+                    if (broadcastService.checkBroadcastData(dto) > 0)
+                        return toolUtils.response(InterfaceResultEnum.BROADCAST_ADDRESS_UNIQUE_ERROR,version);
+                }
+                broadcastService.updateLampPoleBroadcastData(broadcastDTO);
+            }
+        } else if (type == 10) { // 云盒
+            Integer model = (Integer) toolUtils.getRequestContent(request,"model",1);
+            String sn = (String) toolUtils.getRequestContent(request,"sn",2);
+            if (sn.length() == 0) return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+            String remark1 = (String) toolUtils.getRequestContent(request,"remark1",2);
+            String remark2 = (String) toolUtils.getRequestContent(request,"remark2",2);
+            String remark3 = (String) toolUtils.getRequestContent(request,"remark3",2);
+            String remark4 = (String) toolUtils.getRequestContent(request,"remark4",2);
+            String remark5 = (String) toolUtils.getRequestContent(request,"remark5",2);
+            String remark6 = (String) toolUtils.getRequestContent(request,"remark6",2);
+            WifiDTO wifiDTO = new WifiDTO();
+            wifiDTO.setExpirationDate(expirationDate);
+            wifiDTO.setInstallDate(installDate);
+            wifiDTO.setModel(model);
+            wifiDTO.setSn(sn);
+            wifiDTO.setRemark1(remark1);
+            wifiDTO.setRemark2(remark2);
+            wifiDTO.setRemark3(remark3);
+            wifiDTO.setRemark4(remark4);
+            wifiDTO.setRemark5(remark5);
+            wifiDTO.setRemark6(remark6);
+            if (devId == 0) {
+                wifiDTO.setLampPoleId(lampPoleId);
+                WifiDTO dto = new WifiDTO();
+                dto.setLampPoleId(lampPoleId);
+                dto.setSn(sn);
+                if (wifiService.checkWifiData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.CLOUD_BOX_SN_UNIQUE_ERROR,version);
+                wifiService.updateWifiByLampPoleId(wifiDTO);
+            } else {
+                wifiDTO.setId(devId);
+                WifiDTO dto = new WifiDTO();
+                dto.setId(devId);
+                dto.setSn(sn);
+                if (wifiService.checkWifiData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.CLOUD_BOX_SN_UNIQUE_ERROR,version);
+                wifiService.updateWifiByLampPoleId(wifiDTO);
+            }
+        } else if (type == 11) { // 电缆
+            Integer devType = (Integer) toolUtils.getRequestContent(request,"devType",1);
+            String address = (String) toolUtils.getRequestContent(request,"address",2);
+            String name = (String) toolUtils.getRequestContent(request,"name",2);
+            if (name.length() == 0) return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+            if (address.length() == 0) return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+            CableDTO cableDTO = new CableDTO();
+            cableDTO.setType(devType);
+            cableDTO.setAddress(address);
+            cableDTO.setName(name);
+            cableDTO.setExpirationDate(expirationDate);
+            cableDTO.setInstallDate(installDate);
+            if (devId == 0) {
+                cableDTO.setLampPoleId(lampPoleId);
+                CableDTO dto = new CableDTO();
+                dto.setLampPoleId(lampPoleId);
+                CableDTO cable = cableService.getCableByLampPoleId(lampPoleId);
+                dto.setSectionId(cable.getSectionId());
+                dto.setName(name);
+                if (cableService.checkCableData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.CABLE_NAME_UNIQUE_ERROR,version);
+                dto = new CableDTO();
+                dto.setLampPoleId(lampPoleId);
+                dto.setAddress(address);
+                if (cableService.checkCableData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.CABLE_ADDRESS_UNIQUE_ERROR,version);
+                cableService.updateLampPoleCableData(cableDTO);
+            } else {
+                cableDTO.setId(devId);
+                CableDTO dto = new CableDTO();
+                dto.setId(devId);
+                CableDTO cable = cableService.getCableByLampPoleId(devId);
+                dto.setSectionId(cable.getSectionId());
+                dto.setName(name);
+                if (cableService.checkCableData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.CABLE_NAME_UNIQUE_ERROR,version);
+                dto = new CableDTO();
+                dto.setId(devId);
+                dto.setAddress(address);
+                if (cableService.checkCableData(dto) > 0)
+                    return toolUtils.response(InterfaceResultEnum.CABLE_ADDRESS_UNIQUE_ERROR,version);
+                cableService.updateLampPoleCableData(cableDTO);
+            }
+        }
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version);
+    }
 }

+ 5 - 14
src/main/java/com/welampiot/controller/NoiseDevInfoController.java

@@ -2,7 +2,6 @@ package com.welampiot.controller;
 
 import com.welampiot.common.BaseResult;
 import com.welampiot.common.InterfaceResultEnum;
-import com.welampiot.dto.LampPoleDTO;
 import com.welampiot.dto.NoiseDevInfoDTO;
 import com.welampiot.dto.NoiseDevInfoLogDTO;
 import com.welampiot.service.LampPoleService;
@@ -20,7 +19,10 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.servlet.http.HttpServletRequest;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
 
 /**
  * ClassName: NoiseDevInfoController
@@ -225,18 +227,7 @@ public class NoiseDevInfoController {
         noiseDevInfoLogService.deleteNoiseLogData(id);
         NoiseDevInfoDTO dto = noiseDevInfoService.getNoiseLampPole(id);
         String devType = dto.getDevType();
-        String[] split = devType.split(",");
-        StringJoiner joiner = new StringJoiner(",");
-        for (String s : split) {
-            if (!s.equals("17")) {
-                joiner.add(s);
-            }
-        }
-        String newDevType = joiner.toString();
-        LampPoleDTO lampPoleDTO = new LampPoleDTO();
-        lampPoleDTO.setId(dto.getId());
-        lampPoleDTO.setDevType(newDevType);
-        lampPoleService.updateLampPoleDevType(lampPoleDTO);
+        toolUtils.updateLampPoleDevType(devType,17,dto.getId());
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version);
     }
 }

+ 20 - 0
src/main/java/com/welampiot/dao/BenchDevInfoDao.java

@@ -0,0 +1,20 @@
+package com.welampiot.dao;
+
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * ClassName: BenchDevInfoDao
+ * Package: com.welampiot.dao
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/8/2 - 15:20
+ * @Version: v1.0
+ */
+public interface BenchDevInfoDao {
+    void deleteBenchById(@Param("id") Integer id);
+
+    Integer getLampPoleIdByBenchId(@Param("id") Integer id);
+
+    Integer getBenchCountByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+}

+ 12 - 0
src/main/java/com/welampiot/dao/BroadcastDao.java

@@ -28,4 +28,16 @@ public interface BroadcastDao {
     List<BroadcastProListDTO> getProListByDTO(@Param("userId") Integer userId);
 
     List<BroadcastItemDTO> getItemListByDTO(@Param("userId") Integer userId, @Param("devId") Integer devId);
+
+    void deleteBroadcastById(@Param("id") Integer id);
+
+    BroadcastDTO getBroadcastById(@Param("id") Integer id);
+
+    Integer getBroadcastCountByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+
+    BroadcastDTO getBroadcastDTOByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+
+    void updateLampPoleBroadcastData(BroadcastDTO dto);
+
+    Integer checkBroadcastData(BroadcastDTO dto);
 }

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

@@ -1,6 +1,7 @@
 package com.welampiot.dao;
 
 import com.welampiot.dto.CableDTO;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -33,4 +34,16 @@ public interface CableDao {
     Integer getH2sAlarmTotalByCableDTO(CableDTO dto);
 
     Integer getO2AlarmTotalByCableDTO(CableDTO dto);
+
+    void deleteCableById(@Param("id") Integer id);
+
+    CableDTO getCableById(@Param("id") Integer id);
+
+    Integer getCableCountByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+
+    CableDTO getCableByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+
+    void updateLampPoleCableData(CableDTO dto);
+
+    Integer checkCableData(CableDTO dto);
 }

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

@@ -32,4 +32,14 @@ public interface ChargeDao {
     List<ChargeDTO> getChargeEnergyBySectionList(ChargeDTO dto);
 
     ChargeDTO getChargeInfoByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+
+    void deleteChargeById(@Param("id") Integer id);
+
+    Integer getLampPoleIdByChargeId(@Param("id") Integer id);
+
+    Integer getChargeCountByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+
+    void updateLampPoleChargeData(ChargeDTO chargeDTO);
+
+    Integer checkChargeData(ChargeDTO chargeDTO);
 }

+ 12 - 0
src/main/java/com/welampiot/dao/EmergencyDao.java

@@ -14,4 +14,16 @@ import org.apache.ibatis.annotations.Param;
  */
 public interface EmergencyDao {
     EmergencyDTO getEmergencyByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+
+    void deleteEmergencyById(@Param("id") Integer id);
+
+    Integer getLampPoleIdByEmergencyId(@Param("id") Integer id);
+
+    Integer getEmergencyCountByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+
+    Integer getEmergencySectionIdByLampPoleId(@Param("id") Integer id);
+
+    void updateLampPoleEmergencyData(EmergencyDTO dto);
+
+    Integer checkEmergencyData(EmergencyDTO dto);
 }

+ 10 - 0
src/main/java/com/welampiot/dao/EnvmonitorDao.java

@@ -33,4 +33,14 @@ public interface EnvmonitorDao {
     void changeEnvmonitorLocationById(EnvmonitorDTO dto);
 
     EnvmonitorDTO getEnvmonitorByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+
+    void deleteEnvmonitorById(@Param("id") Integer id);
+
+    Integer getLampPoleIdByEnvmonitorId(@Param("id") Integer id);
+
+    Integer getEnvmonitorCountByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+
+    void updateLampPoleEnvmonitorData(EnvmonitorDTO dto);
+
+    Integer checkEnvmonitorData(EnvmonitorDTO dto);
 }

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

@@ -39,4 +39,7 @@ public interface LampDao {
     List<LampInfoDTO> getLampList(LampVO vo);
     Integer getLampTotal(LampVO vo);
     List<LampInfoDTO> getLampDataByLampIds(@Param("lampIds") List<String> lampIds);
+    List<LampInfoDTO> getLampListByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+    Integer getLampPoleIdByLampId(@Param("id") Integer id);
+    Integer getLampCountByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
 }

+ 10 - 0
src/main/java/com/welampiot/dao/ScreenDao.java

@@ -28,4 +28,14 @@ public interface ScreenDao {
     List<ScreenDTO> getAllScreenListBySectionId(@Param("sectionId") Integer sectionId);
 
     ScreenDTO getScreenByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+
+    void deleteScreenById(@Param("id") Integer id);
+
+    Integer getLampPoleIdByScreenId(@Param("id") Integer id);
+
+    Integer getScreenCountByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+
+    void updateLampPoleScreenData(ScreenDTO dto);
+
+    Integer checkScreenData(ScreenDTO dto);
 }

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

@@ -16,4 +16,10 @@ public interface VideoMonitorDao {
     Integer getVideoOnlineTotal(VideoMonitorVO vo);
 
     Integer getVideoUsableTotal(VideoMonitorVO vo);
+
+    void deleteVideoMonitorById(@Param("id") Integer id);
+
+    Integer getLampPoleIdByVideoMonitorId(@Param("id") Integer id);
+
+    Integer getVideoCountByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
 }

+ 16 - 0
src/main/java/com/welampiot/dao/WeatherRS485DevInfoDao.java

@@ -0,0 +1,16 @@
+package com.welampiot.dao;
+
+import com.welampiot.dto.WeatherRS485DevInfoDTO;
+
+/**
+ * ClassName: WeatherRS485DevInfoDao
+ * Package: com.welampiot.dao
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/8/2 - 21:05
+ * @Version: v1.0
+ */
+public interface WeatherRS485DevInfoDao {
+    void addWeatherRS485DevInfoData(WeatherRS485DevInfoDTO dto);
+}

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

@@ -29,4 +29,6 @@ public interface WifiDao {
     Integer deleteById(@Param("id")Integer id);
     WifiDTO getWifiInfoByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
     void updateWifiStatus(WifiDTO wifiDTO);
+    void updateWifiByLampPoleId(WifiDTO dto);
+    Integer checkWifiData(WifiDTO dto);
 }

+ 29 - 0
src/main/java/com/welampiot/dto/BenchDevInfoDTO.java

@@ -0,0 +1,29 @@
+package com.welampiot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * ClassName: BenchDevInfoDTO
+ * Package: com.welampiot.dto
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/8/2 - 15:16
+ * @Version: v1.0
+ */
+@Data
+public class BenchDevInfoDTO implements Serializable {
+    private Integer id;
+
+    private Integer lampPoleId;
+
+    private String number;
+
+    private String address;
+
+    private String createTime;
+
+    private String updateTime;
+}

+ 2 - 0
src/main/java/com/welampiot/dto/BroadcastDTO.java

@@ -74,6 +74,8 @@ public class BroadcastDTO implements Serializable {
 
     private Integer onlineState;
 
+    private Integer sectionId;
+
     private List<Integer> sectionList;
 
     private static final long serialVersionUID = 1L;

+ 3 - 1
src/main/java/com/welampiot/dto/CableDTO.java

@@ -159,7 +159,9 @@ public class CableDTO implements Serializable {
 
     private String updateTime;
 
-    private String installTime;
+    private Integer sectionId;
+
+    private String installDate;
 
     private String expirationDate;
 

+ 2 - 0
src/main/java/com/welampiot/dto/EmergencyDTO.java

@@ -43,6 +43,8 @@ public class EmergencyDTO implements Serializable {
 
     private String ipAddr;
 
+    private Integer sectionId;
+
     private String installDate;
 
     private String expirationDate;

+ 31 - 0
src/main/java/com/welampiot/dto/WeatherRS485DevInfoDTO.java

@@ -0,0 +1,31 @@
+package com.welampiot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * ClassName: WeatherRS485DevInfoDTO
+ * Package: com.welampiot.dto
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/8/2 - 21:00
+ * @Version: v1.0
+ */
+@Data
+public class WeatherRS485DevInfoDTO implements Serializable {
+    private Integer id;
+
+    private Integer weatherId;
+
+    private Integer devId;
+
+    private Integer address;
+
+    private Integer isCmd;
+
+    private Integer rate;
+
+    private String importPra;
+}

+ 18 - 0
src/main/java/com/welampiot/service/BenchDevInfoService.java

@@ -0,0 +1,18 @@
+package com.welampiot.service;
+
+/**
+ * ClassName: BenchDevInfoService
+ * Package: com.welampiot.service
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/8/2 - 15:21
+ * @Version: v1.0
+ */
+public interface BenchDevInfoService {
+    void deleteBenchById(Integer id);
+
+    Integer getLampPoleIdByBenchId(Integer id);
+
+    Integer getBenchCountByLampPoleId(Integer lampPoleId);
+}

+ 12 - 0
src/main/java/com/welampiot/service/BroadcastService.java

@@ -20,4 +20,16 @@ public interface BroadcastService {
     BroadcastProListVO getProListByDTO(String username);
 
     BroadcastItemVO getItemListByDTO(String username, Integer devId);
+
+    void deleteBroadcastById(Integer id);
+
+    BroadcastDTO getBroadcastById(Integer id);
+
+    Integer getBroadcastCountByLampPoleId(Integer lampPoleId);
+
+    BroadcastDTO getBroadcastDTOByLampPoleId(Integer lampPoleId);
+
+    void updateLampPoleBroadcastData(BroadcastDTO dto);
+
+    Integer checkBroadcastData(BroadcastDTO dto);
 }

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

@@ -2,6 +2,7 @@ package com.welampiot.service;
 
 import com.welampiot.dto.CableDTO;
 import com.welampiot.vo.CableVO;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * ClassName: CableService
@@ -16,4 +17,16 @@ public interface CableService {
     CableVO getDevListByCableDTO(CableDTO dto);
 
     CableVO getDataByCableDTO(CableDTO dto);
+
+    void deleteCableById(Integer id);
+
+    CableDTO getCableById(@Param("id") Integer id);
+
+    Integer getCableCountByLampPoleId(Integer lampPoleId);
+
+    CableDTO getCableByLampPoleId(Integer lampPoleId);
+
+    void updateLampPoleCableData(CableDTO dto);
+
+    Integer checkCableData(CableDTO dto);
 }

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

@@ -18,4 +18,14 @@ public interface ChargeService {
     ChargeVO getDataByChargeDTO(ChargeDTO dto);
 
     ChargeDTO getChargeInfoByLampPoleId(Integer lampPoleId);
+
+    void deleteChargeById(Integer id);
+
+    Integer getLampPoleIdByChargeId(Integer id);
+
+    Integer getChargeCountByLampPoleId(Integer lampPoleId);
+
+    void updateLampPoleChargeData(ChargeDTO chargeDTO);
+
+    Integer checkChargeData(ChargeDTO chargeDTO);
 }

+ 12 - 0
src/main/java/com/welampiot/service/EmergencyService.java

@@ -13,4 +13,16 @@ import com.welampiot.dto.EmergencyDTO;
  */
 public interface EmergencyService {
     EmergencyDTO getEmergencyByLampPoleId(Integer lampPoleId);
+
+    void deleteEmergencyById(Integer id);
+
+    Integer getLampPoleIdByEmergencyId(Integer id);
+
+    Integer getEmergencyCountByLampPoleId(Integer lampPoleId);
+
+    Integer getEmergencySectionIdByLampPoleId(Integer id);
+
+    void updateLampPoleEmergencyData(EmergencyDTO dto);
+
+    Integer checkEmergencyData(EmergencyDTO dto);
 }

+ 10 - 0
src/main/java/com/welampiot/service/EnvmonitorService.java

@@ -31,4 +31,14 @@ public interface EnvmonitorService {
     void changeEnvmonitorLocationById(EnvmonitorDTO dto);
 
     EnvmonitorDTO getEnvmonitorByLampPoleId(Integer lampPoleId);
+
+    void deleteEnvmonitorById(Integer id);
+
+    Integer getLampPoleIdByEnvmonitorId(Integer id);
+
+    Integer getEnvmonitorCountByLampPoleId(Integer lampPoleId);
+
+    void updateLampPoleEnvmonitorData(EnvmonitorDTO dto);
+
+    Integer checkEnvmonitorData(EnvmonitorDTO dto);
 }

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

@@ -41,4 +41,7 @@ public interface LampService {
     List<LampInfoDTO> getLampList(LampVO vo);
     Integer getLampTotal(LampVO vo);
     List<LampInfoDTO> getLampDataByLampIds(List<String> lampIds);
+    List<LampInfoDTO> getLampListByLampPoleId(Integer lampPoleId);
+    Integer getLampPoleIdByLampId(Integer id);
+    Integer getLampCountByLampPoleId(Integer lampPoleId);
 }

+ 10 - 0
src/main/java/com/welampiot/service/ScreenService.java

@@ -25,4 +25,14 @@ public interface ScreenService {
     List<ScreenDTO> getAllScreenListBySectionId(Integer sectionId);
 
     ScreenDTO getScreenByLampPoleId(Integer lampPoleId);
+
+    void deleteScreenById(Integer id);
+
+    Integer getLampPoleIdByScreenId(Integer id);
+
+    Integer getScreenCountByLampPoleId(Integer lampPoleId);
+
+    void updateLampPoleScreenData(ScreenDTO dto);
+
+    Integer checkScreenData(ScreenDTO dto);
 }

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

@@ -13,4 +13,7 @@ public interface VideoMonitorService {
     Integer getVideoTotal(VideoMonitorVO vo);
     Integer getVideoOnlineTotal(VideoMonitorVO vo);
     Integer getVideoUsableTotal(VideoMonitorVO vo);
+    void deleteVideoMonitorById(Integer id);
+    Integer getLampPoleIdByVideoMonitorId(Integer id);
+    Integer getVideoCountByLampPoleId(Integer lampPoleId);
 }

+ 16 - 0
src/main/java/com/welampiot/service/WeatherRS485DevInfoService.java

@@ -0,0 +1,16 @@
+package com.welampiot.service;
+
+import com.welampiot.dto.WeatherRS485DevInfoDTO;
+
+/**
+ * ClassName: WeatherRS485DevInfoService
+ * Package: com.welampiot.service
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/8/2 - 21:08
+ * @Version: v1.0
+ */
+public interface WeatherRS485DevInfoService {
+    void addWeatherRS485DevInfoData(WeatherRS485DevInfoDTO dto);
+}

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

@@ -31,4 +31,6 @@ public interface WifiService {
     List<WifiDTO> getWifiListByDTO(WifiDTO dto);
     WifiDTO getWifiInfoByLampPoleId(Integer lampPoleId);
     void updateWifiStatus(WifiDTO wifiDTO);
+    void updateWifiByLampPoleId(WifiDTO dto);
+    Integer checkWifiData(WifiDTO dto);
 }

+ 36 - 0
src/main/java/com/welampiot/service/impl/BenchDevInfoServiceImpl.java

@@ -0,0 +1,36 @@
+package com.welampiot.service.impl;
+
+import com.welampiot.dao.BenchDevInfoDao;
+import com.welampiot.service.BenchDevInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * ClassName: BenchDevInfoServiceImpl
+ * Package: com.welampiot.service.impl
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/8/2 - 15:22
+ * @Version: v1.0
+ */
+@Service
+public class BenchDevInfoServiceImpl implements BenchDevInfoService {
+    @Autowired
+    private BenchDevInfoDao benchDevInfoDao;
+
+    @Override
+    public void deleteBenchById(Integer id) {
+        benchDevInfoDao.deleteBenchById(id);
+    }
+
+    @Override
+    public Integer getLampPoleIdByBenchId(Integer id) {
+        return benchDevInfoDao.getLampPoleIdByBenchId(id);
+    }
+
+    @Override
+    public Integer getBenchCountByLampPoleId(Integer lampPoleId) {
+        return benchDevInfoDao.getBenchCountByLampPoleId(lampPoleId);
+    }
+}

+ 30 - 0
src/main/java/com/welampiot/service/impl/BroadcastServiceImpl.java

@@ -128,4 +128,34 @@ public class BroadcastServiceImpl implements BroadcastService {
         vo.setList(list);
         return vo;
     }
+
+    @Override
+    public void deleteBroadcastById(Integer id) {
+        broadcastDao.deleteBroadcastById(id);
+    }
+
+    @Override
+    public BroadcastDTO getBroadcastById(Integer id) {
+        return broadcastDao.getBroadcastById(id);
+    }
+
+    @Override
+    public Integer getBroadcastCountByLampPoleId(Integer lampPoleId) {
+        return broadcastDao.getBroadcastCountByLampPoleId(lampPoleId);
+    }
+
+    @Override
+    public BroadcastDTO getBroadcastDTOByLampPoleId(Integer lampPoleId) {
+        return broadcastDao.getBroadcastDTOByLampPoleId(lampPoleId);
+    }
+
+    @Override
+    public void updateLampPoleBroadcastData(BroadcastDTO dto) {
+        broadcastDao.updateLampPoleBroadcastData(dto);
+    }
+
+    @Override
+    public Integer checkBroadcastData(BroadcastDTO dto) {
+        return broadcastDao.checkBroadcastData(dto);
+    }
 }

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

@@ -198,4 +198,34 @@ public class CableServiceImpl implements CableService {
         vo.setO2AlarmCount(cableDao.getO2AlarmTotalByCableDTO(dto));
         return vo;
     }
+
+    @Override
+    public void deleteCableById(Integer id) {
+        cableDao.deleteCableById(id);
+    }
+
+    @Override
+    public CableDTO getCableById(Integer id) {
+        return cableDao.getCableById(id);
+    }
+
+    @Override
+    public Integer getCableCountByLampPoleId(Integer lampPoleId) {
+        return cableDao.getCableCountByLampPoleId(lampPoleId);
+    }
+
+    @Override
+    public CableDTO getCableByLampPoleId(Integer lampPoleId) {
+        return cableDao.getCableByLampPoleId(lampPoleId);
+    }
+
+    @Override
+    public void updateLampPoleCableData(CableDTO dto) {
+        cableDao.updateLampPoleCableData(dto);
+    }
+
+    @Override
+    public Integer checkCableData(CableDTO dto) {
+        return cableDao.checkCableData(dto);
+    }
 }

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

@@ -139,4 +139,29 @@ public class ChargeServiceImpl implements ChargeService {
     public ChargeDTO getChargeInfoByLampPoleId(Integer lampPoleId) {
         return chargeDao.getChargeInfoByLampPoleId(lampPoleId);
     }
+
+    @Override
+    public void deleteChargeById(Integer id) {
+        chargeDao.deleteChargeById(id);
+    }
+
+    @Override
+    public Integer getLampPoleIdByChargeId(Integer id) {
+        return chargeDao.getLampPoleIdByChargeId(id);
+    }
+
+    @Override
+    public Integer getChargeCountByLampPoleId(Integer lampPoleId) {
+        return chargeDao.getChargeCountByLampPoleId(lampPoleId);
+    }
+
+    @Override
+    public void updateLampPoleChargeData(ChargeDTO chargeDTO) {
+        chargeDao.updateLampPoleChargeData(chargeDTO);
+    }
+
+    @Override
+    public Integer checkChargeData(ChargeDTO chargeDTO) {
+        return chargeDao.checkChargeData(chargeDTO);
+    }
 }

+ 30 - 0
src/main/java/com/welampiot/service/impl/EmergencyServiceImpl.java

@@ -24,4 +24,34 @@ public class EmergencyServiceImpl implements EmergencyService {
     public EmergencyDTO getEmergencyByLampPoleId(Integer lampPoleId) {
         return emergencyDao.getEmergencyByLampPoleId(lampPoleId);
     }
+
+    @Override
+    public void deleteEmergencyById(Integer id) {
+        emergencyDao.deleteEmergencyById(id);
+    }
+
+    @Override
+    public Integer getLampPoleIdByEmergencyId(Integer id) {
+        return emergencyDao.getLampPoleIdByEmergencyId(id);
+    }
+
+    @Override
+    public Integer getEmergencyCountByLampPoleId(Integer lampPoleId) {
+        return emergencyDao.getEmergencyCountByLampPoleId(lampPoleId);
+    }
+
+    @Override
+    public Integer getEmergencySectionIdByLampPoleId(Integer id) {
+        return emergencyDao.getEmergencySectionIdByLampPoleId(id);
+    }
+
+    @Override
+    public void updateLampPoleEmergencyData(EmergencyDTO dto) {
+        emergencyDao.updateLampPoleEmergencyData(dto);
+    }
+
+    @Override
+    public Integer checkEmergencyData(EmergencyDTO dto) {
+        return emergencyDao.checkEmergencyData(dto);
+    }
 }

+ 25 - 0
src/main/java/com/welampiot/service/impl/EnvmonitorServiceImpl.java

@@ -219,4 +219,29 @@ public class EnvmonitorServiceImpl implements EnvmonitorService {
     public EnvmonitorDTO getEnvmonitorByLampPoleId(Integer lampPoleId) {
         return envmonitorDao.getEnvmonitorByLampPoleId(lampPoleId);
     }
+
+    @Override
+    public void deleteEnvmonitorById(Integer id) {
+        envmonitorDao.deleteEnvmonitorById(id);
+    }
+
+    @Override
+    public Integer getLampPoleIdByEnvmonitorId(Integer id) {
+        return envmonitorDao.getLampPoleIdByEnvmonitorId(id);
+    }
+
+    @Override
+    public Integer getEnvmonitorCountByLampPoleId(Integer lampPoleId) {
+        return envmonitorDao.getEnvmonitorCountByLampPoleId(lampPoleId);
+    }
+
+    @Override
+    public void updateLampPoleEnvmonitorData(EnvmonitorDTO dto) {
+        envmonitorDao.checkEnvmonitorData(dto);
+    }
+
+    @Override
+    public Integer checkEnvmonitorData(EnvmonitorDTO dto) {
+        return envmonitorDao.checkEnvmonitorData(dto);
+    }
 }

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

@@ -366,4 +366,19 @@ public class LampServiceImpl implements LampService {
     public List<LampInfoDTO> getLampDataByLampIds(List<String> lampIds) {
         return lampDao.getLampDataByLampIds(lampIds);
     }
+
+    @Override
+    public List<LampInfoDTO> getLampListByLampPoleId(Integer lampPoleId) {
+        return lampDao.getLampListByLampPoleId(lampPoleId);
+    }
+
+    @Override
+    public Integer getLampPoleIdByLampId(Integer id) {
+        return lampDao.getLampPoleIdByLampId(id);
+    }
+
+    @Override
+    public Integer getLampCountByLampPoleId(Integer lampPoleId) {
+        return lampDao.getLampCountByLampPoleId(lampPoleId);
+    }
 }

+ 25 - 0
src/main/java/com/welampiot/service/impl/ScreenServiceImpl.java

@@ -227,4 +227,29 @@ public class ScreenServiceImpl implements ScreenService {
     public ScreenDTO getScreenByLampPoleId(Integer lampPoleId) {
         return screenDao.getScreenByLampPoleId(lampPoleId);
     }
+
+    @Override
+    public void deleteScreenById(Integer id) {
+        screenDao.deleteScreenById(id);
+    }
+
+    @Override
+    public Integer getLampPoleIdByScreenId(Integer id) {
+        return screenDao.getLampPoleIdByScreenId(id);
+    }
+
+    @Override
+    public Integer getScreenCountByLampPoleId(Integer lampPoleId) {
+        return screenDao.getScreenCountByLampPoleId(lampPoleId);
+    }
+
+    @Override
+    public void updateLampPoleScreenData(ScreenDTO dto) {
+        screenDao.updateLampPoleScreenData(dto);
+    }
+
+    @Override
+    public Integer checkScreenData(ScreenDTO dto) {
+        return screenDao.checkScreenData(dto);
+    }
 }

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

@@ -48,4 +48,19 @@ public class VideoMonitorServiceImpl implements VideoMonitorService {
     public Integer getVideoUsableTotal(VideoMonitorVO vo) {
         return videoMonitorDao.getVideoUsableTotal(vo);
     }
+
+    @Override
+    public void deleteVideoMonitorById(Integer id) {
+        videoMonitorDao.deleteVideoMonitorById(id);
+    }
+
+    @Override
+    public Integer getLampPoleIdByVideoMonitorId(Integer id) {
+        return videoMonitorDao.getLampPoleIdByVideoMonitorId(id);
+    }
+
+    @Override
+    public Integer getVideoCountByLampPoleId(Integer lampPoleId) {
+        return videoMonitorDao.getVideoCountByLampPoleId(lampPoleId);
+    }
 }

+ 27 - 0
src/main/java/com/welampiot/service/impl/WeatherRS485DevInfoServiceImpl.java

@@ -0,0 +1,27 @@
+package com.welampiot.service.impl;
+
+import com.welampiot.dao.WeatherRS485DevInfoDao;
+import com.welampiot.dto.WeatherRS485DevInfoDTO;
+import com.welampiot.service.WeatherRS485DevInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * ClassName: WeatherRS485DevInfoServiceImpl
+ * Package: com.welampiot.service.impl
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/8/2 - 21:08
+ * @Version: v1.0
+ */
+@Service
+public class WeatherRS485DevInfoServiceImpl implements WeatherRS485DevInfoService {
+    @Autowired
+    private WeatherRS485DevInfoDao weatherRS485DevInfoDao;
+
+    @Override
+    public void addWeatherRS485DevInfoData(WeatherRS485DevInfoDTO dto) {
+        weatherRS485DevInfoDao.addWeatherRS485DevInfoData(dto);
+    }
+}

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

@@ -187,4 +187,14 @@ public class WifiServiceImpl implements WifiService {
     public void updateWifiStatus(WifiDTO wifiDTO) {
         wifiDao.updateWifiStatus(wifiDTO);
     }
+
+    @Override
+    public void updateWifiByLampPoleId(WifiDTO dto) {
+        wifiDao.updateWifiByLampPoleId(dto);
+    }
+
+    @Override
+    public Integer checkWifiData(WifiDTO dto) {
+        return wifiDao.checkWifiData(dto);
+    }
 }

+ 36 - 0
src/main/java/com/welampiot/utils/ToolUtils.java

@@ -7,10 +7,12 @@ import com.welampiot.common.InterfaceResultEnum;
 import com.welampiot.common.LampControlTypeEnum;
 import com.welampiot.configuration.MqttConfig;
 import com.welampiot.dto.GlobalLocationDTO;
+import com.welampiot.dto.LampPoleDTO;
 import com.welampiot.dto.SectionDTO;
 import com.welampiot.dto.UserDTO;
 import com.welampiot.handle.MqttHandler;
 import com.welampiot.service.GlobalLocationService;
+import com.welampiot.service.LampPoleService;
 import com.welampiot.service.SectionService;
 import com.welampiot.service.UserService;
 import com.welampiot.vo.DevEnumVO;
@@ -51,6 +53,8 @@ public class ToolUtils {
     private MqttConfig mqttConfig;
     @Autowired
     private MqttHandler mqttHandler;
+    @Autowired
+    private LampPoleService lampPoleService;
 
     private static final String PATTERN = "^(?=.*[0-9])(?=.*[a-zA-Z]).{8,20}$";
     private static final String PATTERN_PHONE = "^1[3-9]\\d{9}$";
@@ -560,6 +564,12 @@ public class ToolUtils {
         return isFlag;
     }
 
+    /**
+     * 获取云盒气象站485设备列表
+     * @param devInfoEnum 枚举类数组
+     * @param version 语言版本
+     * @return 云盒气象站485设备列表
+     */
     public static List<DevEnumVO> getDevEnum(List<DevInfoEnum> devInfoEnum, Integer version) {
         List<DevEnumVO> list = new ArrayList<>();
         for (DevInfoEnum d : devInfoEnum) {
@@ -576,6 +586,10 @@ public class ToolUtils {
         return list;
     }
 
+    /**
+     * 获取枚举类数组
+     * @return 枚举类数组
+     */
     public static List<DevInfoEnum> addAllEnum() {
         List<DevInfoEnum> list = new ArrayList<>();
         list.add(DevInfoEnum.LOUVER_BOX6);
@@ -587,4 +601,26 @@ public class ToolUtils {
         list.add(DevInfoEnum.SOLAR_WIND_SPEED_DIRT);
         return list;
     }
+
+    /**
+     * 修改灯杆上绑定设备的设备类型
+     * @param devType 灯杆绑定的设备类型
+     * @param type 设备类型
+     * @param lampPoleId 灯杆id
+     */
+    public void updateLampPoleDevType(String devType, Integer type, Integer lampPoleId) {
+        String[] split = devType.split(",");
+        String value = String.valueOf(type);
+        StringJoiner joiner = new StringJoiner(",");
+        for (String s : split) {
+            if (!s.equals(value)) {
+                joiner.add(s);
+            }
+        }
+        String newDevType = joiner.toString();
+        LampPoleDTO lampPoleDTO = new LampPoleDTO();
+        lampPoleDTO.setId(lampPoleId);
+        lampPoleDTO.setDevType(newDevType);
+        lampPoleService.updateLampPoleDevType(lampPoleDTO);
+    }
 }

+ 23 - 0
src/main/resources/mapper/BenchDevInfoMapper.xml

@@ -0,0 +1,23 @@
+<?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.BenchDevInfoDao">
+
+    <delete id="deleteBenchById">
+        delete
+        from bench_dev_info
+        where id = #{id};
+    </delete>
+
+    <select id="getLampPoleIdByBenchId" resultType="Integer">
+        select b.lamp_pole_id
+        from bench_dev_info b
+        where b.id = #{id}
+    </select>
+
+    <select id="getBenchCountByLampPoleId" resultType="Integer">
+        select count(*)
+        from bench_dev_info b
+        where b.lamp_pole_id = #{lampPoleId}
+    </select>
+
+</mapper>

+ 64 - 0
src/main/resources/mapper/BroadcastMapper.xml

@@ -72,5 +72,69 @@
            and b.broadcastId = #{devId}
         </if>
     </select>
+
+    <delete id="deleteBroadcastById">
+        delete
+        from broadcast
+        where id = #{id};
+    </delete>
+
+    <select id="getBroadcastById" resultType="BroadcastDTO">
+        select b.lamp_pole_id,lp.sectionid as sectionId
+        from broadcast b
+        left join lamp_pole lp on lp.id = b.lamp_pole_id
+        left join section s on lp.sectionid = s.id
+        where b.id = #{id}
+    </select>
+
+    <select id="getBroadcastCountByLampPoleId" resultType="Integer">
+        select count(*)
+        from broadcast b
+        where b.lamp_pole_id = #{lampPoleId}
+    </select>
+
+    <select id="getBroadcastDTOByLampPoleId" resultType="BroadcastDTO">
+        select b.lamp_pole_id,lp.sectionid as sectionId
+        from broadcast b
+        left join lamp_pole lp on lp.id = b.lamp_pole_id
+        left join section s on lp.sectionid = s.id
+        where b.lamp_pole_id = #{lampPoleId}
+    </select>
+
+    <select id="checkBroadcastData" resultType="Integer">
+        select count(*)
+        from broadcast b
+        where 1=1
+        <if test="address != null and address != ''">
+            and b.address = #{address}
+        </if>
+        <if test="lampPoleId != null and lampPoleId != 0">
+            and b.lamp_pole_id != #{lampPoleId}
+        </if>
+        <if test="name != null and name != ''">
+            and b.name = #{name}
+        </if>
+        <if test="id != null and id != 0">
+            and b.id != #{id}
+        </if>
+    </select>
+
+    <update id="updateLampPoleBroadcastData" parameterType="BroadcastDTO">
+        update
+        broadcast e
+        set
+        <if test="installDate != null and installDate != ''">e.install_date = #{installDate},</if>
+        <if test="expirationDate != null and installDate != ''">e.expiration_date = #{expirationDate},</if>
+        <if test="address != null and address != ''">e.address = #{address},</if>
+        e.type = #{type},
+        e.name = #{name}
+        where 1=1
+        <if test="lampPoleId != null and lampPoleId != 0">
+            and e.lamp_pole_id = #{lampPoleId}
+        </if>
+        <if test="id != null and id != 0">
+            and e.id = #{id}
+        </if>
+    </update>
     
 </mapper>

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

@@ -174,4 +174,68 @@
         </if>
     </select>
 
+    <delete id="deleteCableById">
+        delete
+        from cable
+        where id = #{id};
+    </delete>
+
+    <select id="getCableById" resultType="CableDTO">
+        select b.lamp_pole_id,lp.sectionid as sectionId
+        from cable b
+        left join lamp_pole lp on lp.id = b.lamp_pole_id
+        left join section s on lp.sectionid = s.id
+        where b.id = #{id}
+    </select>
+
+    <select id="getCableCountByLampPoleId" resultType="Integer">
+        select count(*)
+        from cable b
+        where b.lamp_pole_id = #{lampPoleId}
+    </select>
+
+    <select id="getCableByLampPoleId" resultType="CableDTO">
+        select b.lamp_pole_id,lp.sectionid as sectionId
+        from cable b
+        left join lamp_pole lp on lp.id = b.lamp_pole_id
+        left join section s on lp.sectionid = s.id
+        where b.lamp_pole_id = #{lampPoleId}
+    </select>
+
+    <select id="checkCableData" resultType="Integer">
+        select count(*)
+        from cable b
+        where 1=1
+        <if test="address != null and address != ''">
+            and b.address = #{address}
+        </if>
+        <if test="lampPoleId != null and lampPoleId != 0">
+            and b.lamp_pole_id != #{lampPoleId}
+        </if>
+        <if test="name != null and name != ''">
+            and b.name = #{name}
+        </if>
+        <if test="id != null and id != 0">
+            and b.id != #{id}
+        </if>
+    </select>
+
+    <update id="updateLampPoleCableData" parameterType="CableDTO">
+        update
+        cable e
+        set
+        <if test="installDate != null and installDate != ''">e.install_date = #{installDate},</if>
+        <if test="expirationDate != null and installDate != ''">e.expiration_date = #{expirationDate},</if>
+        <if test="address != null and address != ''">e.address = #{address},</if>
+        e.type = #{type},
+        e.name = #{name}
+        where 1=1
+        <if test="lampPoleId != null and lampPoleId != 0">
+            and e.lamp_pole_id = #{lampPoleId}
+        </if>
+        <if test="id != null and id != 0">
+            and e.id = #{id}
+        </if>
+    </update>
+
 </mapper>

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

@@ -142,4 +142,55 @@
         limit 1
     </select>
 
+    <delete id="deleteChargeById">
+        delete
+        from charge
+        where id = #{id};
+    </delete>
+
+    <select id="getLampPoleIdByChargeId" resultType="Integer">
+        select c.lamp_pole_id
+        from charge c
+        where c.id = #{id}
+    </select>
+
+    <select id="getChargeCountByLampPoleId" resultType="Integer">
+        select count(*)
+        from charge c
+        where c.lamp_pole_id = #{lampPoleId}
+    </select>
+
+    <update id="updateLampPoleChargeData" parameterType="ChargeDTO">
+        update charge c
+        set
+            c.num = #{num},
+            c.model = #{model},
+            <if test="installDate != null and installDate != ''">c.install_date = #{installDate},</if>
+            <if test="expirationDate != null and expirationDate != ''">c.expiration_date = #{expirationDate},</if>
+            c.power = #{power},
+            c.chargeModel = #{chargeModel}
+        where 1=1
+        <if test="lampPoleId != null and lampPoleId != 0">
+            and c.lamp_pole_id = #{lampPoleId}
+        </if>
+        <if test="id != null and id != 0">
+            and c.id = #{id}
+        </if>
+    </update>
+
+    <select id="checkChargeData" resultType="Integer">
+        select count(*)
+        from charge c
+        where 1=1
+        <if test="lampPoleId != null and lampPoleId != 0">
+            and c.lamp_pole_id != #{lampPoleId}
+        </if>
+        <if test="num != null and num != ''">
+            and c.num = #{num}
+        </if>
+        <if test="id != null and id != 0">
+            and c.id != #{id}
+        </if>
+    </select>
+
 </mapper>

+ 67 - 1
src/main/resources/mapper/EmergencyMapper.xml

@@ -7,11 +7,77 @@
             e.id,
             e.num,
             e.model,
-            e.remarks
+            e.remarks,
+            lp.sectionid as sectionId
         from
             emergency e
+        left join lamp_pole lp on e.lamp_pole_id = lp.id
+        left join section s on lp.sectionid = s.id
         where
             e.lamp_pole_id = #{lampPoleId}
     </select>
 
+    <delete id="deleteEmergencyById">
+        delete
+        from emergency
+        where id = #{id};
+    </delete>
+
+    <select id="getLampPoleIdByEmergencyId" resultType="Integer">
+        select e.lamp_pole_id
+        from emergency e
+        where e.id = #{id}
+    </select>
+
+    <select id="getEmergencyCountByLampPoleId" resultType="Integer">
+        select count(*)
+        from emergency e
+        where e.lamp_pole_id = #{lampPoleId}
+    </select>
+    
+    <update id="updateLampPoleEmergencyData" parameterType="EmergencyDTO">
+        update
+            emergency e
+        set
+            <if test="installDate != null and installDate != ''">e.install_date = #{installDate},</if>
+            <if test="expirationDate != null and installDate != ''">e.expiration_date = #{expirationDate},</if>
+            <if test="num != null and num != ''">e.num = #{num},</if>
+            <if test="remarks != null and remarks != ''">e.remarks = #{remarks},</if>
+            e.devType = #{devType},
+            e.model = #{model}
+        where 1=1
+        <if test="lampPoleId != null and lampPoleId != 0">
+            and e.lamp_pole_id = #{lampPoleId}
+        </if>
+        <if test="id != null and id != 0">
+            and e.id = #{id}
+        </if>
+    </update>
+
+    <select id="checkEmergencyData" resultType="Integer">
+        select count(*)
+        from emergency e
+        where 1=1
+        <if test="model != null and model != ''">
+            and e.model = #{model}
+        </if>
+        <if test="lampPoleId != null and lampPoleId != 0">
+            and e.lamp_pole_id != #{lampPoleId}
+        </if>
+        <if test="num != null and num != ''">
+            and e.num = #{num}
+        </if>
+        <if test="id != null and id != 0">
+            and e.id != #{id}
+        </if>
+    </select>
+
+    <select id="getEmergencySectionIdByLampPoleId" resultType="Integer">
+        select lp.sectionid as sectionId
+        from emergency e
+        left join lamp_pole lp on e.lamp_pole_id = lp.id
+        left join section s on lp.sectionid = s.id
+        where e.id = #{id}
+    </select>
+
 </mapper>

+ 64 - 1
src/main/resources/mapper/EnvmonitorMapper.xml

@@ -144,6 +144,7 @@
             e.num,
             e.address,
             e.importPra,
+            e.sectionid as sectionId,
             e1.temperature,
             e1.humidity,
             e1.PM25,
@@ -163,5 +164,67 @@
             e.lamp_pole_id = #{lampPoleId}
         limit 1
     </select>
-    
+
+    <delete id="deleteEnvmonitorById">
+        delete
+        from envmonitor
+        where id = #{id};
+    </delete>
+
+    <select id="getLampPoleIdByEnvmonitorId" resultType="Integer">
+        select e.lamp_pole_id
+        from envmonitor e
+        where e.id = #{id}
+    </select>
+
+    <update id="updateLampPoleEnvmonitorData" parameterType="EnvmonitorDTO">
+        update envmonitor e
+        set
+        e.model = #{model},
+        e.devType = #{devType},
+        <if test="pramType != null">
+            e.pramType = #{pramType},
+        </if>
+        <if test="installDate != null and installDate != ''">
+            e.install_date = #{installDate},
+        </if>
+        <if test="expirationDate != null and expirationDate != ''">
+            e.expiration_date = #{expirationDate},
+        </if>
+        e.rate = #{rate},
+        e.netType = #{netType},
+        e.mp = #{mp}
+        where 1=1
+        <if test="lampPoleId != null and lampPoleId != 0">
+            and e.lamp_pole_id = #{lampPoleId}
+        </if>
+        <if test="id != null and id != 0">
+            and e.id = #{id}
+        </if>
+    </update>
+
+    <select id="checkEnvmonitorData" resultType="Integer">
+        select count(*)
+        from envmonitor s
+        where 1=1
+        <if test="lampPoleId != null and lampPoleId != 0">
+            and s.lamp_pole_id != #{lampPoleId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and s.sectionid = #{sectionId}
+        </if>
+        <if test="model != null and model != ''">
+            and s.model = #{model}
+        </if>
+        <if test="id != null and id != 0">
+            and s.id != #{id}
+        </if>
+    </select>
+
+    <select id="getEnvmonitorCountByLampPoleId" resultType="Integer">
+        select count(*)
+        from envmonitor e
+        where e.lamp_pole_id = #{lampPoleId}
+    </select>
+
 </mapper>

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

@@ -767,4 +767,25 @@
         </foreach>
     </select>
     
+    <select id="getLampListByLampPoleId" resultType="LampInfoDTO">
+        select
+            l.id,
+            l.number
+        from lampinfo l
+        left join lamp_pole lp on l.lamp_pole_id = lp.id
+        where l.lamp_pole_id = #{lampPoleId}
+    </select>
+
+    <select id="getLampPoleIdByLampId" resultType="Integer">
+        select l.lamp_pole_id
+        from lampinfo l
+        where l.id = #{id}
+    </select>
+
+    <select id="getLampCountByLampPoleId" resultType="Integer">
+        select count(*)
+        from lampinfo l
+        where l.lamp_pole_id = #{lampPoleId}
+    </select>
+    
 </mapper>

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

@@ -441,7 +441,7 @@
     </update>
 
     <select id="getLampPoleDTOById" resultType="LampPoleDTO">
-        select l.id,l.number
+        select l.id,l.number,l.devtype as devType
         from lamp_pole l
         where l.id = #{id}
     </select>

+ 57 - 0
src/main/resources/mapper/ScreenMapper.xml

@@ -135,4 +135,61 @@
         limit 1
     </select>
 
+    <delete id="deleteScreenById">
+        delete
+        from screen
+        where id = #{id};
+    </delete>
+
+    <select id="getLampPoleIdByScreenId" resultType="Integer">
+        select s.lamp_pole_id
+        from screen s
+        where s.id = #{id}
+    </select>
+
+    <select id="getScreenCountByLampPoleId" resultType="Integer">
+        select count(*)
+        from screen s
+        where s.lamp_pole_id = #{lampPoleId}
+    </select>
+
+    <update id="updateLampPoleScreenData" parameterType="ScreenDTO">
+        update
+            screen s
+        set
+            s.model = #{model},
+            s.num = #{num},
+            s.resolve = #{resolve},
+            <if test="role != null">s.role = #{role},</if>
+            <if test="powerModel != null">s.powerModel = #{powerModel},</if>
+            <if test="comModel != null">s.comModel = #{comModel},</if>
+            <if test="installDate != null and installDate != ''">s.install_date = #{installDate},</if>
+            <if test="expirationDate != null and expirationDate != ''">s.expiration_date = #{expirationDate},</if>
+            s.maxLight = #{maxLight},
+            s.width = #{width},
+            s.height = #{height}
+        where 1=1
+        <if test="lampPoleId != null and lampPoleId != 0">
+            and s.lamp_pole_id = #{lampPoleId}
+        </if>
+        <if test="id != null and id != 0">
+            and s.id = #{id}
+        </if>
+    </update>
+
+    <select id="checkScreenData" resultType="Integer">
+        select count(*)
+        from screen s
+        where 1=1
+        <if test="lampPoleId != null and lampPoleId != 0">
+            and s.lamp_pole_id != #{lampPoleId}
+        </if>
+        <if test="num != null and num != ''">
+            and s.num = #{num}
+        </if>
+        <if test="id != null and id != 0">
+            and s.id != #{id}
+        </if>
+    </select>
+
 </mapper>

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

@@ -122,4 +122,22 @@
         </if>
     </select>
 
+    <delete id="deleteVideoMonitorById">
+        delete
+        from video_monitor
+        where id = #{id};
+    </delete>
+
+    <select id="getLampPoleIdByVideoMonitorId" resultType="Integer">
+        select v.lamp_pole_id
+        from video_monitor v
+        where v.id = #{id}
+    </select>
+
+    <select id="getVideoCountByLampPoleId" resultType="Integer">
+        select count(*)
+        from video_monitor v
+        where v.lamp_pole_id = #{lampPoleId}
+    </select>
+
 </mapper>

+ 10 - 0
src/main/resources/mapper/WeatherRS485DevInfoMapper.xml

@@ -0,0 +1,10 @@
+<?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.WeatherRS485DevInfoDao">
+
+    <insert id="addWeatherRS485DevInfoData" parameterType="WeatherRS485DevInfoDTO" keyProperty="id" useGeneratedKeys="true">
+        insert into weather_rs485_dev_info(address,devId)
+        values (#{address},#{devId})
+    </insert>
+
+</mapper>

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

@@ -80,6 +80,7 @@
     <select id="getCountByDTO" resultType="int" parameterType="WifiDTO">
         select count(*) as total
         from wifi w
+        left join lamp_pole lp on lp.id = w.lamp_pole_id
         where w.id = #{id}
         <if test="sectionList != null and !sectionList.isEmpty()">
             and lp.sectionid in
@@ -179,4 +180,41 @@
             w.lamp_pole_id = #{lampPoleId}
     </update>
 
+    <update id="updateWifiByLampPoleId" parameterType="com.welampiot.dto.WifiDTO">
+        update wifi
+        set
+        num = #{sn},
+        <if test="ipAddr != null and ipAddr != ''">ip_addr = #{ipAddr},</if>
+        <if test="remark1 != null and remark1 != ''">remark1 = #{remark1},</if>
+        <if test="remark2 != null and remark2 != ''">remark2 = #{remark2},</if>
+        <if test="remark3 != null and remark3 != ''">remark3 = #{remark3},</if>
+        <if test="remark4 != null and remark4 != ''">remark4 = #{remark4},</if>
+        <if test="remark5 != null and remark5 != ''">remark5 = #{remark5},</if>
+        <if test="remark6 != null and remark6 != ''">remark6 = #{remark6},</if>
+        <if test="installDate != null and installDate != ''">install_date = #{installDate},</if>
+        <if test="expirationDate != null and expirationDate != ''">expiration_date = #{expirationDate},</if>
+        model = #{model}
+        where 1=1
+        <if test="lampPoleId != null and lampPoleId != 0">
+            and lamp_pole_id = #{lampPoleId}
+        </if>
+        <if test="id != null and id != 0">
+            and id = #{id}
+        </if>
+    </update>
+
+    <select id="checkWifiData" resultType="Integer">
+        select count(*)
+        from wifi w
+        where 1=1
+        <if test="lampPoleId != null and lampPoleId != 0">
+            and w.lamp_pole_id != #{lampPoleId}
+        </if>
+        <if test="sn != null and sn != ''">
+            and w.num = #{sn}
+        </if>
+        <if test="id != null and id != 0">
+            and w.id != #{id}
+        </if>
+    </select>
 </mapper>