소스 검색

网关管理接口、雷达传感器接口

zhj 2 년 전
부모
커밋
1ddd281850

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

@@ -131,6 +131,11 @@ public enum InterfaceResultEnum {
     REPAIR_GROUP_UNIQUE_NAME("0324","维修分组名称重复","Maintenance group names are repeated","Название группы техобслуживания повторяется"),
     REPAIR_GROUP_UNIQUE_NUMBER("0325","维修分组编号重复","Maintenance group number are repeated","Номера групп техобслуживания повторяются"),
     NOISE_NAME_UNIQUE_ERROR("0326","噪声监测设备名称重复","The name of the noise monitoring device is repeated","Название устройства мониторинга шума повторяется"),
+    NET_ID_UNIQUE_ERROR("0327","网关id重复","The gateway id is repeated","повторяю"),
+    NET_NAME_UNIQUE_ERROR("0328","网关名称重复","The gateway name is repeated","Название шлюза повторяется"),
+    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","Повтор радиолокационного адреса"),
     ;
     private String code;
     private String msgCn;

+ 158 - 0
src/main/java/com/welampiot/controller/NetworkController.java

@@ -2,15 +2,20 @@ package com.welampiot.controller;
 
 import com.welampiot.common.BaseResult;
 import com.welampiot.common.InterfaceResultEnum;
+import com.welampiot.dto.NetInfoDTO;
 import com.welampiot.dto.NetworkDTO;
+import com.welampiot.service.NetInfoService;
 import com.welampiot.service.NetworkService;
 import com.welampiot.utils.ToolUtils;
+import com.welampiot.vo.NetInfoDetailVO;
+import com.welampiot.vo.NetInfoVO;
 import com.welampiot.vo.NetworkVO;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
 import java.util.List;
 
 /**
@@ -30,6 +35,8 @@ public class NetworkController {
     private NetworkService networkService;
     @Autowired
     private ToolUtils toolUtils;
+    @Autowired
+    private NetInfoService netInfoService;
 
     /**
      * 网关详情
@@ -128,4 +135,155 @@ public class NetworkController {
         networkVO.setList(networkNavList);
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,networkVO);
     }
+
+    /**
+     * 网关列表
+     * @param request sectionList,分页,关键字搜索
+     * @return 网关列表
+     */
+    @PostMapping("/netInfoList")
+    private BaseResult<?> netInfoList(HttpServletRequest request){
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer areaId = (Integer) toolUtils.getRequestContent(request,"areaId",1);
+        Integer sectionId = (Integer) toolUtils.getRequestContent(request,"sectionId",1);
+        String keyword = (String) toolUtils.getRequestContent(request,"keyword",2);
+        int page = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page"));
+        int count = request.getParameter("count") == null ? 16 : Integer.parseInt(request.getParameter("count"));
+        NetInfoVO netInfoVO = new NetInfoVO();
+        netInfoVO.setPage(count * (page - 1));
+        netInfoVO.setCount(count);
+        netInfoVO.setAreaId(areaId);
+        netInfoVO.setSectionId(sectionId);
+        netInfoVO.setKeyword(keyword);
+        netInfoVO.setSectionList(toolUtils.getSectionList(request));
+        List<NetInfoDTO> netInfoList = netInfoService.getNetInfoListByNetInfoVO(netInfoVO);
+        Integer netInfoTotal = netInfoService.getNetInfoTotal(netInfoVO);
+        double ceil = Math.ceil((double) netInfoTotal / count);
+        NetInfoVO netInfoVO1 = new NetInfoVO();
+        netInfoVO1.setList(netInfoList);
+        netInfoVO1.setTotal((int) ceil);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,netInfoVO1);
+    }
+
+    /**
+     * 网关统计信息
+     * @param request sectionList
+     * @return 网关统计信息
+     */
+    @PostMapping("/netInfoData")
+    private BaseResult<?> netInfoData(HttpServletRequest request){
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        NetInfoVO netInfoVO = new NetInfoVO();
+        netInfoVO.setSectionList(toolUtils.getSectionList(request));
+        Integer total = netInfoService.getNetInfoTotal(netInfoVO);
+        Integer onlineTotal = netInfoService.getNetInfoOnlineTotal(netInfoVO);
+        Integer welTotal = netInfoService.getNetInfoWelTotal(netInfoVO);
+        Integer solarTotal = netInfoService.getNetInfoSolarTotal(netInfoVO);
+        Integer ethTotal = netInfoService.getNetInfoETHTotal(netInfoVO);
+        Integer fourTotal = netInfoService.getNetInfo4GTotal(netInfoVO);
+        Integer failTotal = netInfoService.getNetInfoFailTotal(netInfoVO);
+        NetInfoVO netInfoVO1 = new NetInfoVO();
+        netInfoVO1.setTotal(total);
+        netInfoVO1.setOnlineCount(onlineTotal);
+        netInfoVO1.setWelCount(welTotal);
+        netInfoVO1.setSolarCount(solarTotal);
+        netInfoVO1.setEthCount(ethTotal);
+        netInfoVO1.setFourGCount(fourTotal);
+        netInfoVO1.setFailCount(failTotal);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,netInfoVO1);
+    }
+
+    /**
+     * 网关详情
+     * @param request 网关id
+     * @return 网关详情
+     */
+    @PostMapping("/netInfo")
+    private BaseResult<?> netInfo(HttpServletRequest request){
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer netId = (Integer) toolUtils.getRequestContent(request,"netId",1);
+        if (netId == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
+        NetInfoDTO netInfoDTO = netInfoService.getNetInfoDetailsByNetId(netId);
+        NetInfoDetailVO netInfoDetailVO = new NetInfoDetailVO();
+        if (netInfoDTO == null)
+            return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,netInfoDetailVO);
+        BeanUtils.copyProperties(netInfoDTO,netInfoDetailVO);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,netInfoDetailVO);
+    }
+
+    /**
+     * 添加网关
+     * @param request 网关属性
+     * @return 添加网关
+     */
+    @PostMapping("/addNet")
+    private BaseResult<?> addNet(HttpServletRequest request){
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer areaId = (Integer) toolUtils.getRequestContent(request,"areaId",1);
+        Integer sectionId = (Integer) toolUtils.getRequestContent(request,"sectionId",1);
+        String netId = (String) toolUtils.getRequestContent(request,"netId",2);
+        String netName = (String) toolUtils.getRequestContent(request,"netName",2);
+        if (sectionId == 0) return toolUtils.response(InterfaceResultEnum.LACK_SECTION_ERROR,version);
+        if (areaId == 0) return toolUtils.response(InterfaceResultEnum.LACK_AREA_ERROR,version);
+        if (netId.length() == 0 || netName.length() == 0)
+            return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+        NetInfoDTO netInfoDTO = new NetInfoDTO();
+        netInfoDTO.setNetId(netId);
+        netInfoDTO.setSectionId(sectionId);
+        if (netInfoService.checkNetInfoData(netInfoDTO) > 0)
+            return toolUtils.response(InterfaceResultEnum.NET_ID_UNIQUE_ERROR,version);
+        netInfoDTO = new NetInfoDTO();
+        netInfoDTO.setSectionId(sectionId);
+        netInfoDTO.setNetName(netName);
+        if (netInfoService.checkNetInfoData(netInfoDTO) > 0)
+            return toolUtils.response(InterfaceResultEnum.NET_NAME_UNIQUE_ERROR,version);
+        netInfoDTO.setAreaId(areaId);
+        netInfoDTO.setNetId(netId);
+        long l = System.currentTimeMillis();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String format = simpleDateFormat.format(l);
+        netInfoDTO.setUpdateTime(format);
+        netInfoService.addNetInfoData(netInfoDTO);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version);
+    }
+
+    /**
+     * 修改网关信息
+     * @param request 网关属性
+     * @return 修改网关信息
+     */
+    @PostMapping("/updateNetInfo")
+    private BaseResult<?> updateNetInfo(HttpServletRequest request){
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer id = (Integer) toolUtils.getRequestContent(request,"id",1);
+        Integer areaId = (Integer) toolUtils.getRequestContent(request,"areaId",1);
+        Integer sectionId = (Integer) toolUtils.getRequestContent(request,"sectionId",1);
+        String netId = (String) toolUtils.getRequestContent(request,"netId",2);
+        String netName = (String) toolUtils.getRequestContent(request,"netName",2);
+        if (id == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
+        if (sectionId == 0) return toolUtils.response(InterfaceResultEnum.LACK_SECTION_ERROR,version);
+        if (areaId == 0) return toolUtils.response(InterfaceResultEnum.LACK_AREA_ERROR,version);
+        if (netId.length() == 0 || netName.length() == 0)
+            return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+        NetInfoDTO netInfoDTO = new NetInfoDTO();
+        netInfoDTO.setId(id);
+        netInfoDTO.setNetId(netId);
+        netInfoDTO.setSectionId(sectionId);
+        if (netInfoService.checkNetInfoData(netInfoDTO) > 0)
+            return toolUtils.response(InterfaceResultEnum.NET_ID_UNIQUE_ERROR,version);
+        netInfoDTO = new NetInfoDTO();
+        netInfoDTO.setId(id);
+        netInfoDTO.setSectionId(sectionId);
+        netInfoDTO.setNetName(netName);
+        if (netInfoService.checkNetInfoData(netInfoDTO) > 0)
+            return toolUtils.response(InterfaceResultEnum.NET_NAME_UNIQUE_ERROR,version);
+        netInfoDTO.setAreaId(areaId);
+        netInfoDTO.setNetId(netId);
+        long l = System.currentTimeMillis();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String format = simpleDateFormat.format(l);
+        netInfoDTO.setUpdateTime(format);
+        netInfoService.updateNetInfoData(netInfoDTO);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version);
+    }
 }

+ 246 - 0
src/main/java/com/welampiot/controller/RadarDeviceController.java

@@ -0,0 +1,246 @@
+package com.welampiot.controller;
+
+import com.welampiot.common.BaseResult;
+import com.welampiot.common.InterfaceResultEnum;
+import com.welampiot.dto.LampInfoDTO;
+import com.welampiot.dto.RadarDevInfoDTO;
+import com.welampiot.service.LampService;
+import com.welampiot.service.RadarDevInfoService;
+import com.welampiot.utils.ExcelUtil;
+import com.welampiot.utils.ToolUtils;
+import com.welampiot.vo.RadarDevInfoVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * ClassName: RadarDeviceController
+ * Package: com.welampiot.controller
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/28 - 16:00
+ * @Version: v1.0
+ */
+@RestController
+@CrossOrigin
+@RequestMapping("/radarDevice")
+public class RadarDeviceController {
+    @Autowired
+    private RadarDevInfoService radarDevInfoService;
+    @Autowired
+    private ToolUtils toolUtils;
+    @Autowired
+    private LampService lampService;
+
+    /**
+     * 雷达数据统计
+     * @param request areaId,sectionId,sectionList,keyword
+     * @return 雷达数据统计
+     */
+    @PostMapping("/data")
+    private BaseResult<?> data(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer areaId = (Integer) toolUtils.getRequestContent(request,"areaId",1);
+        Integer sectionId = (Integer) toolUtils.getRequestContent(request,"sectionId",1);
+        String keyword = (String) toolUtils.getRequestContent(request,"keyword",2);
+        RadarDevInfoVO radarDevInfoVO = new RadarDevInfoVO();
+        radarDevInfoVO.setAreaId(areaId);
+        radarDevInfoVO.setSectionId(sectionId);
+        radarDevInfoVO.setKeyword(keyword);
+        radarDevInfoVO.setSectionList(toolUtils.getSectionList(request));
+        Integer total = radarDevInfoService.getRadarTotal(radarDevInfoVO);
+        Integer onlineTotal = radarDevInfoService.getRadarOnlineTotal(radarDevInfoVO);
+        RadarDevInfoVO vo = new RadarDevInfoVO();
+        vo.setTotal(total);
+        vo.setOnlineCount(onlineTotal);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,vo);
+    }
+
+    /**
+     * 雷达设备列表
+     * @param request areaId,sectionId,sectionList,keyword
+     * @return 雷达设备列表
+     */
+    @PostMapping("/getList")
+    private BaseResult<?> getList(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer areaId = (Integer) toolUtils.getRequestContent(request,"areaId",1);
+        Integer sectionId = (Integer) toolUtils.getRequestContent(request,"sectionId",1);
+        Integer online = (Integer) toolUtils.getRequestContent(request,"online",1);
+        Integer download = (Integer) toolUtils.getRequestContent(request,"download",1);
+        String keyword = (String) toolUtils.getRequestContent(request,"keyword",2);
+        int page = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page"));
+        int count = request.getParameter("count") == null ? 16 : Integer.parseInt(request.getParameter("count"));
+        RadarDevInfoVO radarDevInfoVO = new RadarDevInfoVO();
+        radarDevInfoVO.setAreaId(areaId);
+        radarDevInfoVO.setSectionId(sectionId);
+        radarDevInfoVO.setKeyword(keyword);
+        radarDevInfoVO.setOnline(online);
+        radarDevInfoVO.setVersion(version);
+        radarDevInfoVO.setSectionList(toolUtils.getSectionList(request));
+        if (download == 0) {
+            radarDevInfoVO.setPage(count * (page - 1));
+            radarDevInfoVO.setCount(count);
+        }
+        Integer total = radarDevInfoService.getRadarTotal(radarDevInfoVO);
+        List<RadarDevInfoDTO> radarDevList = radarDevInfoService.getRadarDevList(radarDevInfoVO);
+        RadarDevInfoVO vo = new RadarDevInfoVO();
+        vo.setTotal(total);
+        if (download == 0) {
+            radarDevList.forEach(dto -> {
+                if (dto.getLampIds() != null && !dto.getLampIds().equals("")) {
+                    List<String> lampIds = Arrays.asList(dto.getLampIds().split(","));
+                    List<LampInfoDTO> lampData = lampService.getLampDataByLampIds(lampIds);
+                    dto.setLampData(lampData);
+                } else {
+                    dto.setLampData(new ArrayList<>());
+                }
+            });
+            vo.setList(radarDevList);
+        } else {
+            String title;
+            if (version == 0) {
+                title = "路段,网络状态,设备地址,设备类型,来向车速,去向车速,雷达开启(开/关)灯的开始时间,雷达开启(开/关)灯的结束时间,更新时间";
+            } else if (version == 1) {
+                title = "Road Section,Network Status,Device Address,Device Type, Coming Speed,Going Speed," +
+                        "Start Time Of Radar On (on/off) Light,End Time Of Radar On (on/off) Light,Update Time";
+            } else {
+                title = "";
+            }
+            List<String> titleList = Arrays.asList(title.split(","));
+            List<List<String>> contentList = new ArrayList<>();
+            for (RadarDevInfoDTO r : radarDevList) {
+                List<String> newString = new ArrayList<>();
+                newString.add(0,r.getArea());
+                if (r.getOnline() == 1) {
+                    if (version == 0) {
+                        newString.add(1,"在线");
+                    } else if (version == 1) {
+                        newString.add(1,"online");
+                    } else {
+                        newString.add(1,"Онлайн -");
+                    }
+                } else {
+                    if (version == 0) {
+                        newString.add(1,"离线");
+                    } else if (version == 1) {
+                        newString.add(1,"offline");
+                    } else {
+                        newString.add(1,"отключ");
+                    }
+                }
+                newString.add(2,r.getAddress());
+                newString.add(3,"WE-LD485");
+                newString.add(4,r.getComeSpeed());
+                newString.add(5,r.getDesSpeed());
+                newString.add(6,r.getBeginTime());
+                newString.add(7,r.getEndTime());
+                newString.add(8,r.getUpdateTime());
+                contentList.add(radarDevList.indexOf(r),newString);
+            }
+            String path = ExcelUtil.outExcel(titleList, contentList);
+            vo.setList(radarDevList);
+            vo.setPath(path);
+        }
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,vo);
+    }
+
+    /**
+     * 添加编辑雷达
+     * @param request 要编辑的雷达属性
+     * @return 添加编辑雷达
+     */
+    @PostMapping("/save")
+    private BaseResult<?> save(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer id = (Integer) toolUtils.getRequestContent(request,"id",1);
+        Integer model = (Integer) toolUtils.getRequestContent(request,"model",1);
+        Integer areaId = (Integer) toolUtils.getRequestContent(request,"areaId",1);
+        Integer sectionId = (Integer) toolUtils.getRequestContent(request,"sectionId",1);
+        String name = (String) toolUtils.getRequestContent(request,"name",2);
+        String number = (String) toolUtils.getRequestContent(request,"number",2);
+        String address = (String) toolUtils.getRequestContent(request,"address",2);
+        String longitude = (String) toolUtils.getRequestContent(request,"longitude",2);
+        String latitude = (String) toolUtils.getRequestContent(request,"latitude",2);
+        if (areaId == 0) return toolUtils.response(InterfaceResultEnum.LACK_AREA_ERROR,version);
+        if (sectionId == 0) return toolUtils.response(InterfaceResultEnum.LACK_SECTION_ERROR,version);
+        if (name.length() == 0 || number.length() == 0 || address.length() == 0)
+            return toolUtils.response(InterfaceResultEnum.LACK_NEED_PARAM,version);
+        RadarDevInfoDTO radarDevInfoDTO = new RadarDevInfoDTO();
+        radarDevInfoDTO.setModel(model);
+        radarDevInfoDTO.setSectionId(sectionId);
+        radarDevInfoDTO.setAreaId(areaId);
+        radarDevInfoDTO.setAddress(address);
+        radarDevInfoDTO.setName(name);
+        radarDevInfoDTO.setNumber(number);
+        radarDevInfoDTO.setLatitude(Double.valueOf(latitude));
+        radarDevInfoDTO.setLongitude(Double.valueOf(longitude));
+        long l = System.currentTimeMillis();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String format = simpleDateFormat.format(l);
+        radarDevInfoDTO.setCreateTime(format);
+        radarDevInfoDTO.setUpdateTime(format);
+        if (id == 0) { // 添加
+            RadarDevInfoDTO dto = new RadarDevInfoDTO();
+            dto.setSectionId(sectionId);
+            dto.setName(name);
+            if (radarDevInfoService.checkRadarData(dto) > 0)
+                return toolUtils.response(InterfaceResultEnum.RADAR_NAME_UNIQUE_ERROR,version);
+            dto = new RadarDevInfoDTO();
+            dto.setSectionId(sectionId);
+            dto.setNumber(number);
+            if (radarDevInfoService.checkRadarData(dto) > 0)
+                return toolUtils.response(InterfaceResultEnum.RADAR_NUMBER_UNIQUE_ERROR,version);
+            dto = new RadarDevInfoDTO();
+            dto.setAddress(address);
+            if (radarDevInfoService.checkRadarData(dto) > 0)
+                return toolUtils.response(InterfaceResultEnum.RADAR_ADDRESS_UNIQUE_ERROR,version);
+            radarDevInfoService.addRadarData(radarDevInfoDTO);
+        } else { // 编辑
+            radarDevInfoDTO.setId(id);
+            RadarDevInfoDTO dto = new RadarDevInfoDTO();
+            dto.setId(id);
+            dto.setSectionId(sectionId);
+            dto.setName(name);
+            if (radarDevInfoService.checkRadarData(dto) > 0)
+                return toolUtils.response(InterfaceResultEnum.RADAR_NAME_UNIQUE_ERROR,version);
+            dto = new RadarDevInfoDTO();
+            dto.setId(id);
+            dto.setSectionId(sectionId);
+            dto.setNumber(number);
+            if (radarDevInfoService.checkRadarData(dto) > 0)
+                return toolUtils.response(InterfaceResultEnum.RADAR_NUMBER_UNIQUE_ERROR,version);
+            dto = new RadarDevInfoDTO();
+            dto.setId(id);
+            dto.setAddress(address);
+            if (radarDevInfoService.checkRadarData(dto) > 0)
+                return toolUtils.response(InterfaceResultEnum.RADAR_ADDRESS_UNIQUE_ERROR,version);
+            radarDevInfoService.updateRadarData(radarDevInfoDTO);
+        }
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version);
+    }
+
+    /**
+     * 删除雷达数据
+     * @param request 雷达id
+     * @return 删除雷达数据
+     */
+    @PostMapping("/del")
+    private BaseResult<?> del(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        String id = (String) toolUtils.getRequestContent(request,"id",2);
+        if (id.length() == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
+        List<String> ids = Arrays.asList(id.split(","));
+        radarDevInfoService.deleteRadarData(ids);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version);
+    }
+}

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

@@ -38,4 +38,5 @@ public interface LampDao {
     LampInfoDTO getLampInfoDTOById(@Param("id") Integer id);
     List<LampInfoDTO> getLampList(LampVO vo);
     Integer getLampTotal(LampVO vo);
+    List<LampInfoDTO> getLampDataByLampIds(@Param("lampIds") List<String> lampIds);
 }

+ 42 - 0
src/main/java/com/welampiot/dao/NetInfoDao.java

@@ -0,0 +1,42 @@
+package com.welampiot.dao;
+
+import com.welampiot.dto.NetInfoDTO;
+import com.welampiot.vo.NetInfoVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * ClassName: NetInfoDao
+ * Package: com.welampiot.dao
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/28 - 10:04
+ * @Version: v1.0
+ */
+public interface NetInfoDao {
+    List<NetInfoDTO> getNetInfoListByNetInfoVO(NetInfoVO vo);
+
+    Integer getNetInfoTotal(NetInfoVO vo);
+
+    Integer getNetInfoOnlineTotal(NetInfoVO vo);
+
+    Integer getNetInfoWelTotal(NetInfoVO vo);
+
+    Integer getNetInfoSolarTotal(NetInfoVO vo);
+
+    Integer getNetInfoETHTotal(NetInfoVO vo);
+
+    Integer getNetInfo4GTotal(NetInfoVO vo);
+
+    Integer getNetInfoFailTotal(NetInfoVO vo);
+
+    NetInfoDTO getNetInfoDetailsByNetId(@Param("id") Integer id);
+
+    void addNetInfoData(NetInfoDTO dto);
+
+    void updateNetInfoData(NetInfoDTO dto);
+
+    Integer checkNetInfoData(NetInfoDTO dto);
+}

+ 32 - 0
src/main/java/com/welampiot/dao/RadarDevInfoDao.java

@@ -0,0 +1,32 @@
+package com.welampiot.dao;
+
+import com.welampiot.dto.RadarDevInfoDTO;
+import com.welampiot.vo.RadarDevInfoVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * ClassName: RadarDevInfoDao
+ * Package: com.welampiot.dao
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/28 - 15:53
+ * @Version: v1.0
+ */
+public interface RadarDevInfoDao {
+    Integer getRadarTotal(RadarDevInfoVO vo);
+
+    Integer getRadarOnlineTotal(RadarDevInfoVO vo);
+
+    List<RadarDevInfoDTO> getRadarDevList(RadarDevInfoVO vo);
+
+    void addRadarData(RadarDevInfoDTO dto);
+
+    void updateRadarData(RadarDevInfoDTO dto);
+
+    Integer checkRadarData(RadarDevInfoDTO dto);
+
+    void deleteRadarData(@Param("ids") List<String> ids);
+}

+ 55 - 0
src/main/java/com/welampiot/dto/NetInfoDTO.java

@@ -0,0 +1,55 @@
+package com.welampiot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * ClassName: NetInfoDTO
+ * Package: com.welampiot.dto
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/28 - 9:40
+ * @Version: v1.0
+ */
+@Data
+public class NetInfoDTO implements Serializable {
+    private Integer id;
+
+    private String netId; // 网关id
+
+    private String netName; // 网关名称
+
+    private Integer runStatus; // 运行状态(0 停止运行,1 运行中)
+
+    private Integer netStatus; // 联网状态(0 离线,1 ETH,2 4G)
+
+    private String ipPort; // ip端口号
+
+    private String ipAddress; // ip地址
+
+    private String operators; // 运行商
+
+    private String simCard; // SIM卡号
+
+    private String apn; // APN
+
+    private Integer server; // 服务器(0 市电,1 太阳能)
+
+    private String firmware; // 固件版本
+
+    private Integer areaId; // 区域id
+
+    private Integer sectionId; // 路段id
+
+    private String updateTime; // 更新时间
+
+    private Integer isFail; // 是否故障(0 正常,1 故障)
+
+    private String pinCode; // PIN码
+
+    private Integer online; // 在线状态(0 离线,1 在线)
+
+    private static final long serialVersionUID = 1L;
+}

+ 62 - 0
src/main/java/com/welampiot/dto/RadarDevInfoDTO.java

@@ -0,0 +1,62 @@
+package com.welampiot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * ClassName: RadarDevInfoDTO
+ * Package: com.welampiot.dto
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/28 - 15:35
+ * @Version: v1.0
+ */
+@Data
+public class RadarDevInfoDTO implements Serializable {
+    private Integer id;
+
+    private String number; // 编号
+
+    private String name; // 名称
+
+    private Integer sectionId;
+
+    private String section;
+
+    private Integer areaId;
+
+    private String area;
+
+    private Double longitude;
+
+    private Double latitude;
+
+    private String address; // 地址
+
+    private Integer model; // 型号
+
+    private Integer online; // 在线状态
+
+    private String comeSpeed; // 来向的车速(单位:km/h)
+
+    private String desSpeed; // 去向的车速(单位:km/h)
+
+    private String createTime;
+
+    private String updateTime;
+
+    private String lampIds; // 灯控设备id
+
+    private String patrolTime; // 巡检关灯时间
+
+    private String beginTime; // 雷达开/关灯的开始时间
+
+    private String endTime; // 雷达开/关灯的结束时间
+
+    private List<LampInfoDTO> lampData;
+
+    private static final long serialVersionUID = 1L;
+}

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

@@ -40,4 +40,5 @@ public interface LampService {
     LampInfoDTO getLampInfoDTOById(Integer id);
     List<LampInfoDTO> getLampList(LampVO vo);
     Integer getLampTotal(LampVO vo);
+    List<LampInfoDTO> getLampDataByLampIds(List<String> lampIds);
 }

+ 41 - 0
src/main/java/com/welampiot/service/NetInfoService.java

@@ -0,0 +1,41 @@
+package com.welampiot.service;
+
+import com.welampiot.dto.NetInfoDTO;
+import com.welampiot.vo.NetInfoVO;
+
+import java.util.List;
+
+/**
+ * ClassName: NetInfoService
+ * Package: com.welampiot.service
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/28 - 10:05
+ * @Version: v1.0
+ */
+public interface NetInfoService {
+    List<NetInfoDTO> getNetInfoListByNetInfoVO(NetInfoVO vo);
+
+    Integer getNetInfoTotal(NetInfoVO vo);
+
+    Integer getNetInfoOnlineTotal(NetInfoVO vo);
+
+    Integer getNetInfoWelTotal(NetInfoVO vo);
+
+    Integer getNetInfoSolarTotal(NetInfoVO vo);
+
+    Integer getNetInfoETHTotal(NetInfoVO vo);
+
+    Integer getNetInfo4GTotal(NetInfoVO vo);
+
+    Integer getNetInfoFailTotal(NetInfoVO vo);
+
+    NetInfoDTO getNetInfoDetailsByNetId(Integer id);
+
+    void addNetInfoData(NetInfoDTO dto);
+
+    void updateNetInfoData(NetInfoDTO dto);
+
+    Integer checkNetInfoData(NetInfoDTO dto);
+}

+ 31 - 0
src/main/java/com/welampiot/service/RadarDevInfoService.java

@@ -0,0 +1,31 @@
+package com.welampiot.service;
+
+import com.welampiot.dto.RadarDevInfoDTO;
+import com.welampiot.vo.RadarDevInfoVO;
+
+import java.util.List;
+
+/**
+ * ClassName: RadarDevInfoService
+ * Package: com.welampiot.service
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/28 - 15:58
+ * @Version: v1.0
+ */
+public interface RadarDevInfoService {
+    Integer getRadarTotal(RadarDevInfoVO vo);
+
+    Integer getRadarOnlineTotal(RadarDevInfoVO vo);
+
+    List<RadarDevInfoDTO> getRadarDevList(RadarDevInfoVO vo);
+
+    void addRadarData(RadarDevInfoDTO dto);
+
+    void updateRadarData(RadarDevInfoDTO dto);
+
+    Integer checkRadarData(RadarDevInfoDTO dto);
+
+    void deleteRadarData(List<String> ids);
+}

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

@@ -361,4 +361,9 @@ public class LampServiceImpl implements LampService {
     public Integer getLampTotal(LampVO vo) {
         return lampDao.getLampTotal(vo);
     }
+
+    @Override
+    public List<LampInfoDTO> getLampDataByLampIds(List<String> lampIds) {
+        return lampDao.getLampDataByLampIds(lampIds);
+    }
 }

+ 85 - 0
src/main/java/com/welampiot/service/impl/NetInfoServiceImpl.java

@@ -0,0 +1,85 @@
+package com.welampiot.service.impl;
+
+import com.welampiot.dao.NetInfoDao;
+import com.welampiot.dto.NetInfoDTO;
+import com.welampiot.service.NetInfoService;
+import com.welampiot.vo.NetInfoVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * ClassName: NetInfoServiceImpl
+ * Package: com.welampiot.service.impl
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/28 - 10:05
+ * @Version: v1.0
+ */
+@Service
+public class NetInfoServiceImpl implements NetInfoService {
+    @Autowired
+    private NetInfoDao netInfoDao;
+
+    @Override
+    public List<NetInfoDTO> getNetInfoListByNetInfoVO(NetInfoVO vo) {
+        return netInfoDao.getNetInfoListByNetInfoVO(vo);
+    }
+
+    @Override
+    public Integer getNetInfoTotal(NetInfoVO vo) {
+        return netInfoDao.getNetInfoTotal(vo);
+    }
+
+    @Override
+    public Integer getNetInfoOnlineTotal(NetInfoVO vo) {
+        return netInfoDao.getNetInfoOnlineTotal(vo);
+    }
+
+    @Override
+    public Integer getNetInfoWelTotal(NetInfoVO vo) {
+        return netInfoDao.getNetInfoWelTotal(vo);
+    }
+
+    @Override
+    public Integer getNetInfoSolarTotal(NetInfoVO vo) {
+        return netInfoDao.getNetInfoSolarTotal(vo);
+    }
+
+    @Override
+    public Integer getNetInfoETHTotal(NetInfoVO vo) {
+        return netInfoDao.getNetInfoETHTotal(vo);
+    }
+
+    @Override
+    public Integer getNetInfo4GTotal(NetInfoVO vo) {
+        return netInfoDao.getNetInfo4GTotal(vo);
+    }
+
+    @Override
+    public Integer getNetInfoFailTotal(NetInfoVO vo) {
+        return netInfoDao.getNetInfoFailTotal(vo);
+    }
+
+    @Override
+    public NetInfoDTO getNetInfoDetailsByNetId(Integer id) {
+        return netInfoDao.getNetInfoDetailsByNetId(id);
+    }
+
+    @Override
+    public void addNetInfoData(NetInfoDTO dto) {
+        netInfoDao.addNetInfoData(dto);
+    }
+
+    @Override
+    public void updateNetInfoData(NetInfoDTO dto) {
+        netInfoDao.updateNetInfoData(dto);
+    }
+
+    @Override
+    public Integer checkNetInfoData(NetInfoDTO dto) {
+        return netInfoDao.checkNetInfoData(dto);
+    }
+}

+ 60 - 0
src/main/java/com/welampiot/service/impl/RadarDevInfoServiceImpl.java

@@ -0,0 +1,60 @@
+package com.welampiot.service.impl;
+
+import com.welampiot.dao.RadarDevInfoDao;
+import com.welampiot.dto.RadarDevInfoDTO;
+import com.welampiot.service.RadarDevInfoService;
+import com.welampiot.vo.RadarDevInfoVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * ClassName: RadarDevInfoServiceImpl
+ * Package: com.welampiot.service.impl
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/28 - 15:58
+ * @Version: v1.0
+ */
+@Service
+public class RadarDevInfoServiceImpl implements RadarDevInfoService {
+    @Autowired
+    private RadarDevInfoDao radarDevInfoDao;
+
+    @Override
+    public Integer getRadarTotal(RadarDevInfoVO vo) {
+        return radarDevInfoDao.getRadarTotal(vo);
+    }
+
+    @Override
+    public Integer getRadarOnlineTotal(RadarDevInfoVO vo) {
+        return radarDevInfoDao.getRadarOnlineTotal(vo);
+    }
+
+    @Override
+    public List<RadarDevInfoDTO> getRadarDevList(RadarDevInfoVO vo) {
+        return radarDevInfoDao.getRadarDevList(vo);
+    }
+
+    @Override
+    public void addRadarData(RadarDevInfoDTO dto) {
+        radarDevInfoDao.addRadarData(dto);
+    }
+
+    @Override
+    public void updateRadarData(RadarDevInfoDTO dto) {
+        radarDevInfoDao.updateRadarData(dto);
+    }
+
+    @Override
+    public Integer checkRadarData(RadarDevInfoDTO dto) {
+        return radarDevInfoDao.checkRadarData(dto);
+    }
+
+    @Override
+    public void deleteRadarData(List<String> ids) {
+        radarDevInfoDao.deleteRadarData(ids);
+    }
+}

+ 55 - 0
src/main/java/com/welampiot/vo/NetInfoDetailVO.java

@@ -0,0 +1,55 @@
+package com.welampiot.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * ClassName: NetInfoDetailVO
+ * Package: com.welampiot.vo
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/28 - 11:37
+ * @Version: v1.0
+ */
+@Data
+public class NetInfoDetailVO implements Serializable {
+    private Integer id;
+
+    private String netId; // 网关id
+
+    private String netName; // 网关名称
+
+    private Integer runStatus; // 运行状态(0 停止运行,1 运行中)
+
+    private Integer netStatus; // 联网状态(0 离线,1 ETH,2 4G)
+
+    private String ipPort; // ip端口号
+
+    private String ipAddress; // ip地址
+
+    private String operators; // 运行商
+
+    private String simCard; // SIM卡号
+
+    private String apn; // APN
+
+    private Integer server; // 服务器(0 市电,1 太阳能)
+
+    private String firmware; // 固件版本
+
+    private Integer areaId; // 区域id
+
+    private Integer sectionId; // 路段id
+
+    private String updateTime; // 更新时间
+
+    private Integer isFail; // 是否故障(0 正常,1 故障)
+
+    private String pinCode; // PIN码
+
+    private Integer online; // 在线状态(0 离线,1 在线)
+
+    private static final long serialVersionUID = 1L;
+}

+ 49 - 0
src/main/java/com/welampiot/vo/NetInfoVO.java

@@ -0,0 +1,49 @@
+package com.welampiot.vo;
+
+import com.welampiot.dto.NetInfoDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * ClassName: NetInfoVO
+ * Package: com.welampiot.vo
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/28 - 10:02
+ * @Version: v1.0
+ */
+@Data
+public class NetInfoVO implements Serializable {
+    private Integer total;
+
+    private Integer page;
+
+    private Integer count;
+
+    private String keyword;
+
+    private Integer areaId;
+
+    private Integer sectionId;
+
+    private List<Integer> sectionList;
+
+    private List<NetInfoDTO> list;
+
+    private Integer onlineCount; // 在线数
+
+    private Integer welCount; // 市电数
+
+    private Integer solarCount; // 太阳能数
+
+    private Integer ethCount; // ETH数
+
+    private Integer fourGCount; // 4G数
+
+    private Integer failCount; // 故障数
+
+    private static final long serialVersionUID = 1L;
+}

+ 45 - 0
src/main/java/com/welampiot/vo/RadarDevInfoVO.java

@@ -0,0 +1,45 @@
+package com.welampiot.vo;
+
+import com.welampiot.dto.RadarDevInfoDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * ClassName: RadarDevInfoVO
+ * Package: com.welampiot.vo
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/28 - 15:54
+ * @Version: v1.0
+ */
+@Data
+public class RadarDevInfoVO implements Serializable {
+    private Integer total;
+
+    private Integer onlineCount;
+
+    private Integer areaId;
+
+    private Integer sectionId;
+
+    private String keyword;
+
+    private Integer online;
+
+    private Integer version;
+
+    private Integer page;
+
+    private Integer count;
+
+    private String path;
+
+    private List<Integer> sectionList;
+
+    private List<RadarDevInfoDTO> list;
+
+    private static final long serialVersionUID = 1L;
+}

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

@@ -746,5 +746,25 @@
         left join global_location gl1 on gl.pid = gl1.id
         where gl1.id = #{id}
     </select>
+
+    <select id="getLampDataByLampIds" resultType="LampInfoDTO">
+        select
+            l.name,
+            l.address,
+            l.number,
+            l.lighteness,
+            l.status,
+            l.control_type as controlType,
+            n.status as `online`,
+            l.power,
+            l.mode,
+            n.protocoltype as protocolType
+        from lampinfo l
+        left join network n on l.networkid = n.id
+        where l.id in
+        <foreach collection="lampIds" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+    </select>
     
 </mapper>

+ 199 - 0
src/main/resources/mapper/NetInfoMapper.xml

@@ -0,0 +1,199 @@
+<?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.NetInfoDao">
+    
+    <select id="getNetInfoListByNetInfoVO" resultType="NetInfoDTO">
+        select
+            n.id,
+            n.net_name as netName,
+            n.net_id as netId,
+            n.run_status as runStatus,
+            n.net_status as netStatus,
+            n.ip_address as ipAddress,
+            n.ip_port as ipPort,
+            n.operators,
+            n.sim_card as simCard,
+            n.apn,
+            n.server,
+            n.firmware
+        from net_info n
+        where 1=1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and n.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and n.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and n.sectionid = #{sectionId}
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and (n.net_name like '%${keyword}%' or n.net_id like '%${keyword}%')
+        </if>
+        <if test="page >= 0 and count > 0">
+            limit #{page},#{count}
+        </if>
+    </select>
+
+    <select id="getNetInfoTotal" resultType="Integer">
+        select count(*)
+        from net_info n
+        where 1=1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and n.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and n.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and n.sectionid = #{sectionId}
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and n.net_name like '%${keyword}%'
+        </if>
+    </select>
+
+    <!-- 在线数 -->
+    <select id="getNetInfoOnlineTotal" resultType="Integer">
+        select count(*)
+        from net_info n
+        where n.online = 1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and n.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+    <!-- 市电数 -->
+    <select id="getNetInfoWelTotal" resultType="Integer">
+        select count(*)
+        from net_info n
+        where n.server = 0
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and n.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+    <!-- 太阳能数 -->
+    <select id="getNetInfoSolarTotal" resultType="Integer">
+        select count(*)
+        from net_info n
+        where n.server = 1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and n.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+    <!-- ETH数 -->
+    <select id="getNetInfoETHTotal" resultType="Integer">
+        select count(*)
+        from net_info n
+        where n.net_status = 1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and n.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+    <!-- 4G数 -->
+    <select id="getNetInfo4GTotal" resultType="Integer">
+        select count(*)
+        from net_info n
+        where n.net_status = 2
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and n.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+    <!-- 故障数 -->
+    <select id="getNetInfoFailTotal" resultType="Integer">
+        select count(*)
+        from net_info n
+        where n.is_fail = 1 and n.online = 1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and n.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="getNetInfoDetailsByNetId" resultType="NetInfoDTO">
+        select
+            n.id,
+            n.net_name as netName,
+            n.net_id as netId,
+            n.run_status as runStatus,
+            n.net_status as netStatus,
+            n.ip_address as ipAddress,
+            n.ip_port as ipPort,
+            n.operators,
+            n.sim_card as simCard,
+            n.apn,
+            n.server,
+            n.firmware,
+            n.updatetime as updateTime,
+            n.pin_code as pinCode,
+            n.areaid as areaId,
+            n.sectionid as sectionId
+        from net_info n
+        where n.id = #{id}
+    </select>
+
+    <insert id="addNetInfoData" parameterType="NetInfoDTO" keyProperty="id" useGeneratedKeys="true">
+        insert into net_info(net_id,net_name,sectionid,areaid,updatetime)
+        values (#{netId},#{netName},#{sectionId},#{areaId},#{updateTime})
+    </insert>
+
+    <update id="updateNetInfoData" parameterType="NetInfoDTO">
+        update
+            net_info n
+        set
+            n.net_id = #{netId},
+            n.net_name = #{netName},
+            n.sectionid = #{sectionId},
+            n.areaid = #{areaId},
+            n.updatetime = #{updateTime}
+        where
+            n.id = #{id}
+    </update>
+
+    <select id="checkNetInfoData" resultType="Integer">
+        select
+            count(*)
+        from net_info n
+        where 1=1
+        <if test="sectionId != null and sectionId != 0">
+            and n.sectionid = #{sectionId}
+        </if>
+        <if test="netId != null and netId != ''">
+            and n.net_id = #{netId}
+        </if>
+        <if test="netName != null and netName != ''">
+            and n.net_name = #{netName}
+        </if>
+        <if test="id != null and id != 0">
+            and n.id != #{id}
+        </if>
+    </select>
+
+</mapper>

+ 204 - 0
src/main/resources/mapper/RadarDevInfoMapper.xml

@@ -0,0 +1,204 @@
+<?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.RadarDevInfoDao">
+
+    <select id="getRadarTotal" resultType="Integer">
+        select
+            count(*)
+        from radar_dev_info r
+        where 1=1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and r.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and (r.name like '%${keyword}%'
+                or r.number like '%${keyword}%'
+                or r.online like '%${keyword}%'
+                or r.address like '%${keyword}%')
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and r.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and r.sectionid = #{sectionId}
+        </if>
+    </select>
+
+    <select id="getRadarOnlineTotal" resultType="Integer">
+        select
+        count(*)
+        from radar_dev_info r
+        where r.online = 1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and r.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and (r.name like '%${keyword}%'
+            or r.number like '%${keyword}%'
+            or r.online like '%${keyword}%'
+            or r.address like '%${keyword}%')
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and r.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and r.sectionid = #{sectionId}
+        </if>
+    </select>
+
+    <select id="getRadarDevList" resultType="RadarDevInfoDTO">
+        select
+            r.id,
+            r.name,
+            r.areaid as areaId,
+            r.sectionid as sectionId,
+            r.number,
+            r.model,
+            r.online,
+            r.address,
+            r.come_speed as comeSpeed,
+            r.des_speed as desSpeed,
+            r.latitude,
+            r.longitude,
+            r.createtime as createTime,
+            r.updatetime as updateTime,
+            r.lampids as lampIds,
+            r.patrol_time as patrolTime,
+            r.begin_time as beginTime,
+            r.end_time as endTime,
+            s.name as section
+            <choose>
+                <when test="version == 0">
+                    ,gl.chinese_name as area
+                </when>
+                <when test="version == 1">
+                    ,gl.english_name as area
+                </when>
+                <otherwise>
+                    ,gl.ru_name as area
+                </otherwise>
+            </choose>
+        from radar_dev_info r
+        left join section s on r.sectionid = s.id
+        left join global_location gl on s.pid = gl.id
+        where 1=1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and r.sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and (r.name like '%${keyword}%'
+            or r.number like '%${keyword}%'
+            or r.address like '%${keyword}%')
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and r.areaid = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and r.sectionid = #{sectionId}
+        </if>
+        <choose>
+            <when test="online == 1">
+                and r.online = 0
+            </when>
+            <when test="online == 2">
+                and r.online = 1
+            </when>
+        </choose>
+        <if test="page >= 0 and count > 0">
+            limit #{page},#{count}
+        </if>
+    </select>
+
+    <insert id="addRadarData" parameterType="RadarDevInfoDTO" useGeneratedKeys="true" keyProperty="id">
+        insert into radar_dev_info(`number`,
+                                   `name`,
+                                   model,
+                                   address,
+                                   areaid,
+                                   sectionid,
+                                   <if test="longitude != null and longitude != ''">
+                                       longitude,
+                                   </if>
+                                   <if test="latitude != null and latitude != ''">
+                                       latitude,
+                                   </if>
+                                   updatetime,
+                                   createtime)
+        values (#{number},
+                #{name},
+                #{model},
+                #{address},
+                #{areaId},
+                #{sectionId},
+                <if test="longitude != null and longitude != ''">
+                    #{longitude},
+                </if>
+                <if test="latitude != null and latitude != ''">
+                    #{latitude},
+                </if>
+                #{updateTime},
+                #{createTime})
+    </insert>
+
+    <update id="updateRadarData" parameterType="RadarDevInfoDTO">
+        update
+            radar_dev_info r
+        set
+            r.number = #{number},
+            r.name = #{name},
+            r.model = #{model},
+            r.address = #{address},
+            r.areaid = #{areaId},
+            r.sectionid = #{sectionId},
+            <if test="longitude != null and longitude != ''">
+               r.longitude = #{longitude},
+            </if>
+            <if test="latitude != null and latitude != ''">
+               r.latitude = #{latitude},
+            </if>
+            r.updatetime = #{updateTime}
+        where
+            r.id = #{id}
+    </update>
+
+    <select id="checkRadarData" resultType="Integer">
+        select
+            count(*)
+        from radar_dev_info r
+        where 1=1
+        <if test="sectionId != null and sectionId != ‘’">
+            and r.sectionid = #{sectionId}
+        </if>
+        <if test="number != null and number != ''">
+            and r.number = #{number}
+        </if>
+        <if test="name != null and name != ''">
+            and r.name = #{name}
+        </if>
+        <if test="id != null and id != 0">
+            and r.id != #{id}
+        </if>
+        <if test="address != null and address != ''">
+            and r.address #{address}
+        </if>
+    </select>
+
+    <delete id="deleteRadarData">
+        delete
+        from radar_dev_info
+        where id in
+        <foreach collection="ids" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+    </delete>
+
+</mapper>