Procházet zdrojové kódy

新增 设备管理相关代码

zhaiyifei před 1 rokem
rodič
revize
8c82cf0983
25 změnil soubory, kde provedl 1846 přidání a 3183 odebrání
  1. 48 1669
      src/main/java/com/yunfeiyun/agmp/iotm/device/controller/IotDeviceController.java
  2. 105 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/controller/IotDeviceconnController.java
  3. 101 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/controller/TosDeviceclassController.java
  4. 101 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/controller/TosDevicetypeController.java
  5. 101 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/controller/TosFirmController.java
  6. 21 76
      src/main/java/com/yunfeiyun/agmp/iotm/device/mapper/IotDeviceMapper.java
  7. 62 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/mapper/IotDeviceconnMapper.java
  8. 56 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/mapper/TosDeviceclassMapper.java
  9. 57 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/mapper/TosDevicetypeMapper.java
  10. 57 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/mapper/TosFirmMapper.java
  11. 18 107
      src/main/java/com/yunfeiyun/agmp/iotm/device/service/IIotDeviceService.java
  12. 62 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/service/IIotDeviceconnService.java
  13. 55 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/service/ITosDeviceclassService.java
  14. 55 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/service/ITosDevicetypeService.java
  15. 55 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/service/ITosFirmService.java
  16. 37 623
      src/main/java/com/yunfeiyun/agmp/iotm/device/service/impl/IotDeviceServiceImpl.java
  17. 94 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/service/impl/IotDeviceconnServiceImpl.java
  18. 78 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/service/impl/TosDeviceclassServiceImpl.java
  19. 80 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/service/impl/TosDevicetypeServiceImpl.java
  20. 80 0
      src/main/java/com/yunfeiyun/agmp/iotm/device/service/impl/TosFirmServiceImpl.java
  21. 127 708
      src/main/resources/mapper/IotDeviceMapper.xml
  22. 101 0
      src/main/resources/mapper/IotDeviceconnMapper.xml
  23. 84 0
      src/main/resources/mapper/TosDeviceclassMapper.xml
  24. 105 0
      src/main/resources/mapper/TosDevicetypeMapper.xml
  25. 106 0
      src/main/resources/mapper/TosFirmMapper.xml

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 48 - 1669
src/main/java/com/yunfeiyun/agmp/iotm/device/controller/IotDeviceController.java


+ 105 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/controller/IotDeviceconnController.java

@@ -0,0 +1,105 @@
+package com.yunfeiyun.agmp.iotm.device.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.yunfeiyun.agmp.common.utils.poi.ExcelUtil;
+import com.yunfeiyun.agmp.iot.common.domain.IotDeviceconn;
+import com.yunfeiyun.agmp.iotm.device.service.IIotDeviceconnService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.yunfeiyun.agmp.common.annotation.Log;
+import com.yunfeiyun.agmp.common.core.controller.BaseController;
+import com.yunfeiyun.agmp.common.core.domain.AjaxResult;
+import com.yunfeiyun.agmp.common.enums.BusinessType;
+import com.yunfeiyun.agmp.common.core.page.TableDataInfo;
+
+/**
+ * 设备连接配置Controller
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+@RestController
+@RequestMapping("/yunfeiyun/IotDeviceconn")
+public class IotDeviceconnController extends BaseController
+{
+    @Autowired
+    private IIotDeviceconnService iotDeviceconnService;
+
+    /**
+     * 查询设备连接配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:IotDeviceconn:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(IotDeviceconn iotDeviceconn)
+    {
+        startPage();
+        List<IotDeviceconn> list = iotDeviceconnService.selectIotDeviceconnList(iotDeviceconn);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出设备连接配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:IotDeviceconn:export')")
+    @Log(title = "设备连接配置", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, IotDeviceconn iotDeviceconn)
+    {
+        List<IotDeviceconn> list = iotDeviceconnService.selectIotDeviceconnList(iotDeviceconn);
+        ExcelUtil<IotDeviceconn> util = new ExcelUtil<IotDeviceconn>(IotDeviceconn.class);
+        util.exportExcel(response, list, "设备连接配置数据");
+    }
+
+    /**
+     * 获取设备连接配置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:IotDeviceconn:query')")
+    @GetMapping(value = "/info/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(iotDeviceconnService.selectIotDeviceconnById(id));
+    }
+
+    /**
+     * 新增设备连接配置
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:IotDeviceconn:add')")
+    @Log(title = "设备连接配置", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody IotDeviceconn iotDeviceconn)
+    {
+        return toAjax(iotDeviceconnService.insertIotDeviceconn(iotDeviceconn));
+    }
+
+    /**
+     * 修改设备连接配置
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:IotDeviceconn:edit')")
+    @Log(title = "设备连接配置", businessType = BusinessType.UPDATE)
+    @PutMapping("/edit")
+    public AjaxResult edit(@RequestBody IotDeviceconn iotDeviceconn)
+    {
+        return toAjax(iotDeviceconnService.updateIotDeviceconn(iotDeviceconn));
+    }
+
+    /**
+     * 删除设备连接配置
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:IotDeviceconn:remove')")
+    @Log(title = "设备连接配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/delete/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(iotDeviceconnService.deleteIotDeviceconnByIds(ids));
+    }
+}

+ 101 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/controller/TosDeviceclassController.java

@@ -0,0 +1,101 @@
+package com.yunfeiyun.agmp.iotm.device.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.yunfeiyun.agmp.common.utils.uuid.IdUtils;
+import com.yunfeiyun.agmp.iot.common.domain.TosDeviceclass;
+import com.yunfeiyun.agmp.iotm.device.service.ITosDeviceclassService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.yunfeiyun.agmp.common.annotation.Log;
+import com.yunfeiyun.agmp.common.core.controller.BaseController;
+import com.yunfeiyun.agmp.common.core.domain.AjaxResult;
+import com.yunfeiyun.agmp.common.enums.BusinessType;
+
+import com.yunfeiyun.agmp.common.utils.poi.ExcelUtil;
+import com.yunfeiyun.agmp.common.core.page.TableDataInfo;
+
+/**
+ * 设备类型Controller
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+@RestController
+@RequestMapping("/tos/deviceclass")
+public class TosDeviceclassController extends BaseController
+{
+    @Autowired
+    private ITosDeviceclassService tosDeviceclassService;
+
+    /**
+     * 查询设备类型列表
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:TosDeviceclass:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TosDeviceclass tosDeviceclass) {
+        startPage();
+        List<TosDeviceclass> list = tosDeviceclassService.selectTosDeviceclassList(tosDeviceclass);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出设备类型列表
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:TosDeviceclass:export')")
+    @Log(title = "设备类型", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TosDeviceclass tosDeviceclass) {
+        List<TosDeviceclass> list = tosDeviceclassService.selectTosDeviceclassList(tosDeviceclass);
+        ExcelUtil<TosDeviceclass> util = new ExcelUtil<TosDeviceclass>(TosDeviceclass.class);
+        util.exportExcel(response, list, "设备类型数据");
+    }
+
+    /**
+     * 获取设备类型详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:TosDeviceclass:query')")
+    @GetMapping(value = "/info/{devclassBid}")
+    public AjaxResult getInfo(@PathVariable("devclassBid") String devclassBid) {
+        return success(tosDeviceclassService.selectTosDeviceclassByDevclassBid(devclassBid));
+    }
+
+    /**
+     * 新增设备类型
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:TosDeviceclass:add')")
+    @Log(title = "设备类型", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody TosDeviceclass tosDeviceclass) {
+        return toAjax(tosDeviceclassService.insertTosDeviceclass(tosDeviceclass));
+    }
+
+    /**
+     * 修改设备类型
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:TosDeviceclass:edit')")
+    @Log(title = "设备类型", businessType = BusinessType.UPDATE)
+    @PutMapping("/edit")
+    public AjaxResult edit(@RequestBody TosDeviceclass tosDeviceclass) {
+        return toAjax(tosDeviceclassService.updateTosDeviceclass(tosDeviceclass));
+    }
+
+    /**
+     * 删除设备类型
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:TosDeviceclass:remove')")
+    @Log(title = "设备类型", businessType = BusinessType.DELETE)
+	@DeleteMapping("/delete/{devclassBid}")
+    public AjaxResult remove(@PathVariable String devclassBid) {
+        return toAjax(tosDeviceclassService.deleteTosDeviceclassByDevclassBid(devclassBid));
+    }
+}

+ 101 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/controller/TosDevicetypeController.java

@@ -0,0 +1,101 @@
+package com.yunfeiyun.agmp.iotm.device.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.yunfeiyun.agmp.common.utils.uuid.IdUtils;
+import com.yunfeiyun.agmp.iot.common.domain.TosDevicetype;
+import com.yunfeiyun.agmp.iotm.device.service.ITosDevicetypeService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.yunfeiyun.agmp.common.annotation.Log;
+import com.yunfeiyun.agmp.common.core.controller.BaseController;
+import com.yunfeiyun.agmp.common.core.domain.AjaxResult;
+import com.yunfeiyun.agmp.common.enums.BusinessType;
+
+import com.yunfeiyun.agmp.common.utils.poi.ExcelUtil;
+import com.yunfeiyun.agmp.common.core.page.TableDataInfo;
+
+/**
+ * 设备类型Controller
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+@RestController
+@RequestMapping("/tos/devicetype")
+public class TosDevicetypeController extends BaseController
+{
+    @Autowired
+    private ITosDevicetypeService tosDevicetypeService;
+
+    /**
+     * 查询设备类型列表
+     */
+    @PreAuthorize("@ss.hasPermi('tos:devicetype:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TosDevicetype tosDevicetype) {
+        startPage();
+        List<TosDevicetype> list = tosDevicetypeService.selectTosDevicetypeList(tosDevicetype);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出设备类型列表
+     */
+    @PreAuthorize("@ss.hasPermi('tos:devicetype:export')")
+    @Log(title = "设备类型", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TosDevicetype tosDevicetype) {
+        List<TosDevicetype> list = tosDevicetypeService.selectTosDevicetypeList(tosDevicetype);
+        ExcelUtil<TosDevicetype> util = new ExcelUtil<TosDevicetype>(TosDevicetype.class);
+        util.exportExcel(response, list, "设备类型数据");
+    }
+
+    /**
+     * 获取设备类型详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('tos:devicetype:query')")
+    @GetMapping(value = "/info/{devtypeBid}")
+    public AjaxResult getInfo(@PathVariable("devtypeBid") String devtypeBid) {
+        return success(tosDevicetypeService.selectTosDevicetypeByDevtypeBid(devtypeBid));
+    }
+
+    /**
+     * 新增设备类型
+     */
+    @PreAuthorize("@ss.hasPermi('tos:devicetype:add')")
+    @Log(title = "设备类型", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody TosDevicetype tosDevicetype) {
+        return toAjax(tosDevicetypeService.insertTosDevicetype(tosDevicetype));
+    }
+
+    /**
+     * 修改设备类型
+     */
+    @PreAuthorize("@ss.hasPermi('tos:devicetype:edit')")
+    @Log(title = "设备类型", businessType = BusinessType.UPDATE)
+    @PutMapping("/edit")
+    public AjaxResult edit(@RequestBody TosDevicetype tosDevicetype) {
+        return toAjax(tosDevicetypeService.updateTosDevicetype(tosDevicetype));
+    }
+
+    /**
+     * 删除设备类型
+     */
+    @PreAuthorize("@ss.hasPermi('tos:devicetype:remove')")
+    @Log(title = "设备类型", businessType = BusinessType.DELETE)
+    @DeleteMapping("/delete/{devtypeBid}")
+    public AjaxResult remove(@PathVariable String devtypeBid) {
+        return toAjax(tosDevicetypeService.deleteTosDevicetypeByDevtypeBid(devtypeBid));
+    }
+}

+ 101 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/controller/TosFirmController.java

@@ -0,0 +1,101 @@
+package com.yunfeiyun.agmp.iotm.device.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.yunfeiyun.agmp.common.utils.uuid.IdUtils;
+import com.yunfeiyun.agmp.iot.common.domain.TosFirm;
+import com.yunfeiyun.agmp.iotm.device.service.ITosFirmService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.yunfeiyun.agmp.common.annotation.Log;
+import com.yunfeiyun.agmp.common.core.controller.BaseController;
+import com.yunfeiyun.agmp.common.core.domain.AjaxResult;
+import com.yunfeiyun.agmp.common.enums.BusinessType;
+
+import com.yunfeiyun.agmp.common.utils.poi.ExcelUtil;
+import com.yunfeiyun.agmp.common.core.page.TableDataInfo;
+
+/**
+ * 厂家信息Controller
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+@RestController
+@RequestMapping("/tos/firm")
+public class TosFirmController extends BaseController
+{
+    @Autowired
+    private ITosFirmService tosFirmService;
+
+    /**
+     * 查询厂家信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:TosFirm:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TosFirm tosFirm) {
+        startPage();
+        List<TosFirm> list = tosFirmService.selectTosFirmList(tosFirm);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出厂家信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:TosFirm:export')")
+    @Log(title = "厂家信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TosFirm tosFirm) {
+        List<TosFirm> list = tosFirmService.selectTosFirmList(tosFirm);
+        ExcelUtil<TosFirm> util = new ExcelUtil<TosFirm>(TosFirm.class);
+        util.exportExcel(response, list, "厂家信息数据");
+    }
+
+    /**
+     * 获取厂家信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:TosFirm:query')")
+    @GetMapping(value = "/info/{firmBid}")
+    public AjaxResult getInfo(@PathVariable("firmBid") String firmBid) {
+        return success(tosFirmService.selectTosFirmByFirmBid(firmBid));
+    }
+
+    /**
+     * 新增厂家信息
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:TosFirm:add')")
+    @Log(title = "厂家信息", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody TosFirm tosFirm) {
+        return toAjax(tosFirmService.insertTosFirm(tosFirm));
+    }
+
+    /**
+     * 修改厂家信息
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:TosFirm:edit')")
+    @Log(title = "厂家信息", businessType = BusinessType.UPDATE)
+    @PutMapping("/edit")
+    public AjaxResult edit(@RequestBody TosFirm tosFirm) {
+        return toAjax(tosFirmService.updateTosFirm(tosFirm));
+    }
+
+    /**
+     * 删除厂家信息
+     */
+    @PreAuthorize("@ss.hasPermi('yunfeiyun:TosFirm:remove')")
+    @Log(title = "厂家信息", businessType = BusinessType.DELETE)
+    @DeleteMapping("/delete/{firmBid}")
+    public AjaxResult remove(@PathVariable String firmBid) {
+        return toAjax(tosFirmService.deleteTosFirmByFirmBid(firmBid));
+    }
+}

+ 21 - 76
src/main/java/com/yunfeiyun/agmp/iotm/device/mapper/IotDeviceMapper.java

@@ -1,117 +1,62 @@
 package com.yunfeiyun.agmp.iotm.device.mapper;
 
-
 import com.yunfeiyun.agmp.iot.common.domain.IotDevice;
-import com.yunfeiyun.agmp.iot.common.domain.resvo.IotDeviceResVo;
-import com.yunfeiyun.agmp.iot.common.domain.resvo.IotDeviceWithConfigResVo;
-import com.yunfeiyun.agmp.iotm.device.domain.reqvo.IotDeviceCangLiWsmjListReqVo;
-import com.yunfeiyun.agmp.iotm.device.domain.reqvo.IotDeviceListReqVo;
-import com.yunfeiyun.agmp.iotm.device.domain.reqvo.IotMonitorDeviceListReqVo;
-import com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceAndTypeInfoResVo;
-import com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceListResVo;
-import com.yunfeiyun.agmp.iotm.device.service.IotDeviceAndConfigResVo;
-import org.apache.ibatis.annotations.MapKey;
-import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * 设备基础Mapper接口
- *
+ * 
  * @author 杨晓辉
- * @date 2024-01-04
+ * @date 2024-11-06
  */
-public interface IotDeviceMapper {
+public interface IotDeviceMapper 
+{
     /**
      * 查询设备基础
-     *
-     * @param devBid 设备基础主键
+     * 
+     * @param id 设备基础主键
      * @return 设备基础
      */
-    public IotDeviceResVo selectIotDeviceByDevBid(String devBid);
-
-    public Map<String, Object> selectTmnLandByDevBid(String devBid);
-
-    public Map<String, Object> selectTmnBlockByDevBid(String devBid);
+    public IotDevice selectIotDeviceById(Long id);
 
     /**
      * 查询设备基础列表
-     *
-     * @param reqVo 设备基础
+     * 
+     * @param iotDevice 设备基础
      * @return 设备基础集合
      */
-    public List<IotDeviceListResVo> selectIotDeviceList(IotDeviceListReqVo reqVo);
+    public List<IotDevice> selectIotDeviceList(IotDevice iotDevice);
 
     /**
      * 新增设备基础
-     *
+     * 
      * @param iotDevice 设备基础
      * @return 结果
      */
     public int insertIotDevice(IotDevice iotDevice);
 
-    public int insertIotDeviceBatch(List<IotDevice> iotDevices);
-
     /**
      * 修改设备基础
-     *
+     * 
      * @param iotDevice 设备基础
      * @return 结果
      */
     public int updateIotDevice(IotDevice iotDevice);
 
-
     /**
-     * 批量删除设备基础
-     *
-     * @param ids 需要删除的数据主键集合
+     * 删除设备基础
+     * 
+     * @param id 设备基础主键
      * @return 结果
      */
-    public int deleteIotDeviceByDevBids(String[] ids);
-
-    List<IotDevice> selectIotDeviceByDevBids(String[] devBids);
-
-    IotDevice findOneByBizId(@Param("devBid") String devBid);
-
-    List<IotDeviceAndConfigResVo> selectIotDeviceAndConfigResVoList(IotMonitorDeviceListReqVo iotMonitorDeviceListReqVo);
-
-    public List<IotDevice> selectIotDeviceListBatchBySubTopic(String[] devCodes);
-
-    List<IotDevice> selectIotDeviceListByFirmCode(@Param("firmId") String firmId, @Param("code") String code, @Param("devtypeBid") String devtypeBid);
-
-    List<IotDevice> selectIotDeviceListByDevtypeBids(String[] devtypeBids);
-
-    IotDeviceResVo selectIotDeviceByDevCodeAndType(@Param("devCode") String devCode, @Param("ctDevtype") String ctDevtype);
-
-    List<IotDeviceListResVo> selectIotSfDeviceList(IotDeviceListReqVo reqVo);
-
-    List<IotDeviceListResVo> selectIotDeviceListByLandId(@Param("devTypePid") String devTypePid, @Param("landId") String landId);
-    List<IotDeviceListResVo> selectIotDeviceListByLandIdAndPids(@Param("devTypePids") List<String> devTypePids, @Param("landId") String landId);
-    List<IotDeviceListResVo> selectIotDeviceListByBlockId(@Param("devTypePid") String devTypePid, @Param("blockId") String blockId);
-    List<IotDeviceListResVo> selectIotDeviceListByBlockIdAndPids(@Param("devTypePids") List<String> devTypePids, @Param("blockId") String blockId);
-
-    List<IotDeviceListResVo> selectIotDeviceListByDevTypePid(@Param("devTypePid") String devTypePid);
-    List<IotDeviceListResVo> selectIotDeviceListByDevTypePids(@Param("devTypePids") List<String> devTypePids);
-
-    IotDeviceAndTypeInfoResVo findIotDeviceAndTypeInfoResVoByBizId(String devBid);
-
-    List<IotDevice> selectIotDeviceListByFirmdevBids(String[] firmdevBids);
-    List<IotDeviceListResVo> selectIotDeviceListByDevtypeBidsWithLand(@Param("devTypeBids")  String[] devtypeBids,@Param("landId")  String landId);
-    List<IotDeviceListResVo> selectIotDeviceListByDevtypeBidsWithBlock(@Param("devTypeBids")  String[] devtypeBids,@Param("blockId")  String blockId);
-
-    @MapKey(value = "devtypePid")
-    Map<String, Integer> selectIotDeviceTypeSum(String landId);
+    public int deleteIotDeviceById(Long id);
 
     /**
-     * 查询查询昌黎温室灭菌列表
-     *
-     * @param reqVo 设备基础
-     * @return 设备基础集合
+     * 批量删除设备基础
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
      */
-    public List<IotDeviceListResVo> selectCangLiWsmjIotDeviceList(IotDeviceCangLiWsmjListReqVo reqVo);
-
-    List<IotDeviceWithConfigResVo> selectBlockBindDevices(@Param("blockId") String blockId, @Param("devTypeBids") List<String> devTypeBids);
-
-    IotDevice findIotDeviceByDevCodeAndDevTypeBid(@Param("devCode") String devCode,@Param("devtypeBid") String devtypeBid);
+    public int deleteIotDeviceByIds(Long[] ids);
 }

+ 62 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/mapper/IotDeviceconnMapper.java

@@ -0,0 +1,62 @@
+package com.yunfeiyun.agmp.iotm.device.mapper;
+
+import com.yunfeiyun.agmp.iot.common.domain.IotDeviceconn;
+
+import java.util.List;
+
+/**
+ * 设备连接配置Mapper接口
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+public interface IotDeviceconnMapper 
+{
+    /**
+     * 查询设备连接配置
+     * 
+     * @param id 设备连接配置主键
+     * @return 设备连接配置
+     */
+    public IotDeviceconn selectIotDeviceconnById(Long id);
+
+    /**
+     * 查询设备连接配置列表
+     * 
+     * @param iotDeviceconn 设备连接配置
+     * @return 设备连接配置集合
+     */
+    public List<IotDeviceconn> selectIotDeviceconnList(IotDeviceconn iotDeviceconn);
+
+    /**
+     * 新增设备连接配置
+     * 
+     * @param iotDeviceconn 设备连接配置
+     * @return 结果
+     */
+    public int insertIotDeviceconn(IotDeviceconn iotDeviceconn);
+
+    /**
+     * 修改设备连接配置
+     * 
+     * @param iotDeviceconn 设备连接配置
+     * @return 结果
+     */
+    public int updateIotDeviceconn(IotDeviceconn iotDeviceconn);
+
+    /**
+     * 删除设备连接配置
+     * 
+     * @param id 设备连接配置主键
+     * @return 结果
+     */
+    public int deleteIotDeviceconnById(Long id);
+
+    /**
+     * 批量删除设备连接配置
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteIotDeviceconnByIds(Long[] ids);
+}

+ 56 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/mapper/TosDeviceclassMapper.java

@@ -0,0 +1,56 @@
+package com.yunfeiyun.agmp.iotm.device.mapper;
+
+import com.yunfeiyun.agmp.iot.common.domain.TosDeviceclass;
+
+import java.util.List;
+
+
+/**
+ * 设备类型Mapper接口
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+public interface TosDeviceclassMapper {
+    /**
+     * 查询设备类型
+     * 
+     * @param id 设备类型主键
+     * @return 设备类型
+     */
+    public TosDeviceclass selectTosDeviceclassByDevclassBid(String devclassBid);
+
+    /**
+     * 查询设备类型列表
+     * 
+     * @param tosDeviceclass 设备类型
+     * @return 设备类型集合
+     */
+    public List<TosDeviceclass> selectTosDeviceclassList(TosDeviceclass tosDeviceclass);
+
+    /**
+     * 新增设备类型
+     * 
+     * @param tosDeviceclass 设备类型
+     * @return 结果
+     */
+    public int insertTosDeviceclass(TosDeviceclass tosDeviceclass);
+
+    /**
+     * 修改设备类型
+     * 
+     * @param tosDeviceclass 设备类型
+     * @return 结果
+     */
+    public int updateTosDeviceclass(TosDeviceclass tosDeviceclass);
+
+    /**
+     * 删除设备类型
+     * 
+     * @param id 设备类型主键
+     * @return 结果
+     */
+    public int deleteTosDeviceclassByDevclassBid(String devclassBid);
+
+
+}

+ 57 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/mapper/TosDevicetypeMapper.java

@@ -0,0 +1,57 @@
+package com.yunfeiyun.agmp.iotm.device.mapper;
+
+
+import com.yunfeiyun.agmp.iot.common.domain.TosDevicetype;
+
+import java.util.List;
+
+
+/**
+ * 设备类型Mapper接口
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+public interface TosDevicetypeMapper {
+    /**
+     * 查询设备类型
+     *
+     * @param devtypeBid 设备类型主键
+     * @return 设备类型
+     */
+    public TosDevicetype selectTosDevicetypeByDevtypeBid(String devtypeBid);
+
+    /**
+     * 查询设备类型列表
+     * 
+     * @param tosDevicetype 设备类型
+     * @return 设备类型集合
+     */
+    public List<TosDevicetype> selectTosDevicetypeList(TosDevicetype tosDevicetype);
+
+    /**
+     * 新增设备类型
+     * 
+     * @param tosDevicetype 设备类型
+     * @return 结果
+     */
+    public int insertTosDevicetype(TosDevicetype tosDevicetype);
+
+    /**
+     * 修改设备类型
+     * 
+     * @param tosDevicetype 设备类型
+     * @return 结果
+     */
+    public int updateTosDevicetype(TosDevicetype tosDevicetype);
+
+    /**
+     * 删除设备类型
+     * 
+     * @param id 设备类型主键
+     * @return 结果
+     */
+    public int deleteTosDevicetypeByDevtypeBid(String devtypeBid);
+
+
+}

+ 57 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/mapper/TosFirmMapper.java

@@ -0,0 +1,57 @@
+package com.yunfeiyun.agmp.iotm.device.mapper;
+
+
+import com.yunfeiyun.agmp.iot.common.domain.TosFirm;
+
+import java.util.List;
+
+
+/**
+ * 厂家信息Mapper接口
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+public interface TosFirmMapper {
+    /**
+     * 查询厂家信息
+     *
+     * @param firmBid 厂家信息主键
+     * @return 厂家信息
+     */
+    public TosFirm selectTosFirmByFirmBid(String firmBid);
+
+    /**
+     * 查询厂家信息列表
+     * 
+     * @param tosFirm 厂家信息
+     * @return 厂家信息集合
+     */
+    public List<TosFirm> selectTosFirmList(TosFirm tosFirm);
+
+    /**
+     * 新增厂家信息
+     * 
+     * @param tosFirm 厂家信息
+     * @return 结果
+     */
+    public int insertTosFirm(TosFirm tosFirm);
+
+    /**
+     * 修改厂家信息
+     * 
+     * @param tosFirm 厂家信息
+     * @return 结果
+     */
+    public int updateTosFirm(TosFirm tosFirm);
+
+    /**
+     * 删除厂家信息
+     *
+     * @param Bid 厂家信息主键
+     * @return 结果
+     */
+    public int deleteTosFirmByFirmBid(String firmBid);
+
+
+}

+ 18 - 107
src/main/java/com/yunfeiyun/agmp/iotm/device/service/IIotDeviceService.java

@@ -1,58 +1,44 @@
 package com.yunfeiyun.agmp.iotm.device.service;
 
-
-import com.alibaba.fastjson2.JSONObject;
-import com.yunfeiyun.agmp.common.core.page.TableDataInfo;
-import com.yunfeiyun.agmp.iot.common.constant.devicetype.IotDeviceTypeLv1Enum;
 import com.yunfeiyun.agmp.iot.common.domain.IotDevice;
-import com.yunfeiyun.agmp.iot.common.domain.resvo.IotDeviceResVo;
-import com.yunfeiyun.agmp.iotm.device.domain.reqvo.IotDeviceDataListReqVo;
-import com.yunfeiyun.agmp.iotm.device.domain.reqvo.IotDeviceListReqVo;
-import com.yunfeiyun.agmp.iotm.device.domain.reqvo.IotMonitorDeviceListReqVo;
-import com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceAndTypeInfoResVo;
-import com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceListResVo;
 
 import java.util.List;
 
 /**
  * 设备基础Service接口
- *
+ * 
  * @author 杨晓辉
- * @date 2024-01-04
+ * @date 2024-11-06
  */
-public interface IIotDeviceService {
+public interface IIotDeviceService 
+{
     /**
      * 查询设备基础
-     *
+     * 
      * @param id 设备基础主键
      * @return 设备基础
      */
-    public IotDeviceResVo selectIotDeviceByDevBid(String devBid);
-
-
-    public IotDevice findOneByBizId(String devBid);
+    public IotDevice selectIotDeviceById(Long id);
 
     /**
      * 查询设备基础列表
-     *
-     * @param reqVo 设备基础
+     * 
+     * @param iotDevice 设备基础
      * @return 设备基础集合
      */
-    public List<IotDeviceListResVo> selectIotDeviceList(IotDeviceListReqVo reqVo);
+    public List<IotDevice> selectIotDeviceList(IotDevice iotDevice);
 
     /**
      * 新增设备基础
-     *
+     * 
      * @param iotDevice 设备基础
      * @return 结果
      */
     public int insertIotDevice(IotDevice iotDevice);
 
-    public int insertIotDeviceBatch(List<IotDevice> iotDevices);
-
     /**
      * 修改设备基础
-     *
+     * 
      * @param iotDevice 设备基础
      * @return 结果
      */
@@ -60,92 +46,17 @@ public interface IIotDeviceService {
 
     /**
      * 批量删除设备基础
-     *
+     * 
      * @param ids 需要删除的设备基础主键集合
      * @return 结果
      */
-    public int deleteIotDeviceByDevBids(String[] ids, List<IotDevice> iotDevices);
-
-
-    List<IotDevice> selectIotDeviceByDevBids(String[] devBids);
-
-    public int subscribeTopics(List<IotDevice> iotDeviceList);
-
-    public List<IotDevice> selectIotDeviceListBatchBySubTopic(String[] devCodes);
-
-    public void sendDeviceRefresh(String devBid);
-
-    public void createDeviceRefresh(String devtypeBid, String devBid);
-
-    List<IotDevice> selectIotDeviceListByFirmCode(String firmId, String code, String devtypeBid);
-
-    public JSONObject getDeviceRefreshConfig(String devtypeBid);
-
-    List<IotDeviceAndConfigResVo> selectIotDeviceAndConfigResVoList(IotMonitorDeviceListReqVo iotMonitorDeviceListReqVo);
-
-    /**
-     * 查询设备列表  预警设置用,根据 子设备类型查询
-     *
-     * @param devtypeBids 子类型
-     * @return 设备基础集合
-     */
-    List<IotDevice> selectIotDeviceListByDevtypeBids(String[] devtypeBids);
-
-    IotDeviceResVo selectIotDeviceByDevCodeAndType(String devCode, String ctDevtype);
-
-    List<IotDeviceListResVo> selectIotSfDeviceList(IotDeviceListReqVo reqVo);
+    public int deleteIotDeviceByIds(Long[] ids);
 
     /**
-     * 统一设置图片
-     *
-     * @param iotDevices
-     */
-    void setDevPicByDevList(List<IotDeviceListResVo> iotDevices);
-
-    /**
-     * 根据基地和基地查询设备信息
-     * 供大屏列表查询使用
-     *
-     * @param landId  基地必传
-     * @param blockId 地块可不填
-     * @return
-     */
-    List<IotDeviceListResVo> selectIotDeviceListByLandIdAndBlockId(IotDeviceTypeLv1Enum iotDeviceTypeLv1Enum, String landId, String blockId);
-    /**
-     * 根据基地和基地查询设备信息
-     * 供大屏列表查询使用
-     *
-     * @param landId  基地必传
-     * @param blockId 地块可不填
-     * @return
-     */
-    List<IotDeviceListResVo> selectIotDeviceListByLandIdAndBlockId(List<String> devTypePids, String landId, String blockId);
-
-
-    IotDeviceAndTypeInfoResVo findIotDeviceAndTypeInfoResVoByBizId(String devBid);
-
-    List<IotDevice> selectIotDeviceListByFirmdevBids(String[] firmdevBids);
-
-    List<IotDeviceListResVo> selectIotDeviceListByDevtypeBidsWithLand(String[] devtypeBids, String landId);
-
-    List<IotDeviceListResVo> selectIotDeviceListByDevtypeBidsWithBlock(String[] devtypeBids, String blockId);
-
-    /**
-     * 查询设备数据列表
-     * @param reqVo
-     * @param findDevice
-     * @return
-     */
-    public TableDataInfo dataList(IotDeviceDataListReqVo reqVo, IotDeviceResVo findDevice);
-
-    /**
-     * 查询设备数据图表列表
-     * @param reqVo
-     * @param findDevice
-     * @return
+     * 删除设备基础信息
+     * 
+     * @param id 设备基础主键
+     * @return 结果
      */
-    public TableDataInfo dataChartList(IotDeviceDataListReqVo reqVo, IotDeviceResVo findDevice);
-
-    public String ctl(String devBid,String ctlMethodName,Object params);
-    public String ctl(IotDevice iotDevice,String ctlMethodName,Object params);
+    public int deleteIotDeviceById(Long id);
 }

+ 62 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/service/IIotDeviceconnService.java

@@ -0,0 +1,62 @@
+package com.yunfeiyun.agmp.iotm.device.service;
+
+import com.yunfeiyun.agmp.iot.common.domain.IotDeviceconn;
+
+import java.util.List;
+
+/**
+ * 设备连接配置Service接口
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+public interface IIotDeviceconnService 
+{
+    /**
+     * 查询设备连接配置
+     * 
+     * @param id 设备连接配置主键
+     * @return 设备连接配置
+     */
+    public IotDeviceconn selectIotDeviceconnById(Long id);
+
+    /**
+     * 查询设备连接配置列表
+     * 
+     * @param iotDeviceconn 设备连接配置
+     * @return 设备连接配置集合
+     */
+    public List<IotDeviceconn> selectIotDeviceconnList(IotDeviceconn iotDeviceconn);
+
+    /**
+     * 新增设备连接配置
+     * 
+     * @param iotDeviceconn 设备连接配置
+     * @return 结果
+     */
+    public int insertIotDeviceconn(IotDeviceconn iotDeviceconn);
+
+    /**
+     * 修改设备连接配置
+     * 
+     * @param iotDeviceconn 设备连接配置
+     * @return 结果
+     */
+    public int updateIotDeviceconn(IotDeviceconn iotDeviceconn);
+
+    /**
+     * 批量删除设备连接配置
+     * 
+     * @param ids 需要删除的设备连接配置主键集合
+     * @return 结果
+     */
+    public int deleteIotDeviceconnByIds(Long[] ids);
+
+    /**
+     * 删除设备连接配置信息
+     * 
+     * @param id 设备连接配置主键
+     * @return 结果
+     */
+    public int deleteIotDeviceconnById(Long id);
+}

+ 55 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/service/ITosDeviceclassService.java

@@ -0,0 +1,55 @@
+package com.yunfeiyun.agmp.iotm.device.service;
+
+import com.yunfeiyun.agmp.iot.common.domain.TosDeviceclass;
+
+import java.util.List;
+
+
+/**
+ * 设备类型Service接口
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+public interface ITosDeviceclassService {
+    /**
+     * 查询设备类型
+     *
+     * @param devclassBid 设备类型主键
+     * @return 设备类型
+     */
+    public TosDeviceclass selectTosDeviceclassByDevclassBid(String devclassBid);
+
+    /**
+     * 查询设备类型列表
+     * 
+     * @param tosDeviceclass 设备类型
+     * @return 设备类型集合
+     */
+    public List<TosDeviceclass> selectTosDeviceclassList(TosDeviceclass tosDeviceclass);
+
+    /**
+     * 新增设备类型
+     * 
+     * @param tosDeviceclass 设备类型
+     * @return 结果
+     */
+    public int insertTosDeviceclass(TosDeviceclass tosDeviceclass);
+
+    /**
+     * 修改设备类型
+     * 
+     * @param tosDeviceclass 设备类型
+     * @return 结果
+     */
+    public int updateTosDeviceclass(TosDeviceclass tosDeviceclass);
+
+
+    /**
+     * 删除设备类型信息
+     * 
+     * @param id 设备类型主键
+     * @return 结果
+     */
+    public int deleteTosDeviceclassByDevclassBid(String devclassBid);
+}

+ 55 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/service/ITosDevicetypeService.java

@@ -0,0 +1,55 @@
+package com.yunfeiyun.agmp.iotm.device.service;
+
+import com.yunfeiyun.agmp.iot.common.domain.TosDevicetype;
+
+import java.util.List;
+
+
+/**
+ * 设备类型Service接口
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+public interface ITosDevicetypeService {
+    /**
+     * 查询设备类型
+     *
+     * @param devtypeBid 设备类型主键
+     * @return 设备类型
+     */
+    public TosDevicetype selectTosDevicetypeByDevtypeBid(String devtypeBid);
+
+    /**
+     * 查询设备类型列表
+     * 
+     * @param tosDevicetype 设备类型
+     * @return 设备类型集合
+     */
+    public List<TosDevicetype> selectTosDevicetypeList(TosDevicetype tosDevicetype);
+
+    /**
+     * 新增设备类型
+     * 
+     * @param tosDevicetype 设备类型
+     * @return 结果
+     */
+    public int insertTosDevicetype(TosDevicetype tosDevicetype);
+
+    /**
+     * 修改设备类型
+     * 
+     * @param tosDevicetype 设备类型
+     * @return 结果
+     */
+    public int updateTosDevicetype(TosDevicetype tosDevicetype);
+
+
+    /**
+     * 删除设备类型信息
+     * 
+     * @param id 设备类型主键
+     * @return 结果
+     */
+    public int deleteTosDevicetypeByDevtypeBid(String devtypeBid);
+}

+ 55 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/service/ITosFirmService.java

@@ -0,0 +1,55 @@
+package com.yunfeiyun.agmp.iotm.device.service;
+
+import com.yunfeiyun.agmp.iot.common.domain.TosFirm;
+
+import java.util.List;
+
+
+/**
+ * 厂家信息Service接口
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+public interface ITosFirmService {
+    /**
+     * 查询厂家信息
+     *
+     * @param firmBid 厂家信息主键
+     * @return 厂家信息
+     */
+    public TosFirm selectTosFirmByFirmBid(String firmBid);
+
+    /**
+     * 查询厂家信息列表
+     * 
+     * @param tosFirm 厂家信息
+     * @return 厂家信息集合
+     */
+    public List<TosFirm> selectTosFirmList(TosFirm tosFirm);
+
+    /**
+     * 新增厂家信息
+     * 
+     * @param tosFirm 厂家信息
+     * @return 结果
+     */
+    public int insertTosFirm(TosFirm tosFirm);
+
+    /**
+     * 修改厂家信息
+     * 
+     * @param tosFirm 厂家信息
+     * @return 结果
+     */
+    public int updateTosFirm(TosFirm tosFirm);
+
+
+    /**
+     * 删除厂家信息信息
+     *
+     * @param Bid 厂家信息主键
+     * @return 结果
+     */
+    public int deleteTosFirmByFirmBid(String Bid);
+}

+ 37 - 623
src/main/java/com/yunfeiyun/agmp/iotm/device/service/impl/IotDeviceServiceImpl.java

@@ -1,680 +1,94 @@
 package com.yunfeiyun.agmp.iotm.device.service.impl;
 
-import com.alibaba.fastjson2.JSONObject;
-import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.yunfeiyun.agmp.common.constant.ErrorCode;
-import com.yunfeiyun.agmp.common.core.page.TableDataInfo;
-import com.yunfeiyun.agmp.common.utils.JSONUtils;
-import com.yunfeiyun.agmp.common.utils.StringUtils;
-import com.yunfeiyun.agmp.common.utils.uuid.IdUtils;
-import com.yunfeiyun.agmp.iot.common.constant.IotErrorCode;
-import com.yunfeiyun.agmp.iot.common.constant.device.xph.XphRelayEnum;
-import com.yunfeiyun.agmp.iot.common.constant.devicetype.IotDeviceDictConst;
-import com.yunfeiyun.agmp.iot.common.constant.devicetype.IotDeviceDictEnum;
-import com.yunfeiyun.agmp.iot.common.constant.devicetype.IotDeviceTypeLv1Enum;
-import com.yunfeiyun.agmp.iot.common.constant.mq.IotMqConstant;
-import com.yunfeiyun.agmp.iot.common.domain.*;
-import com.yunfeiyun.agmp.iot.common.domain.resvo.IotDeviceResVo;
-import com.yunfeiyun.agmp.iot.common.domain.resvo.IotXmzndeviceResVo;
-import com.yunfeiyun.agmp.iot.common.exception.IotBizException;
-import com.yunfeiyun.agmp.iot.common.model.cmd.CmdGroupModel;
-import com.yunfeiyun.agmp.iot.common.service.MongoService;
-import com.yunfeiyun.agmp.iot.common.util.tmn.CustomerIdUtil;
-import com.yunfeiyun.agmp.iotm.common.service.IotDeviceBaseService;
-import com.yunfeiyun.agmp.iotm.common.vo.reqVo.IotDeviceBaseCtlReqVo;
-import com.yunfeiyun.agmp.iotm.device.domain.dtovo.IotXyinfoDto;
-import com.yunfeiyun.agmp.iotm.device.domain.dtovo.IotXyinfoPestTotalDto;
-import com.yunfeiyun.agmp.iotm.device.domain.dtovo.IotYfScdDataVo;
-import com.yunfeiyun.agmp.iotm.device.domain.reqvo.IotDeviceCangLiWsmjListReqVo;
-import com.yunfeiyun.agmp.iotm.device.domain.reqvo.IotDeviceDataListReqVo;
-import com.yunfeiyun.agmp.iotm.device.domain.reqvo.IotDeviceListReqVo;
-import com.yunfeiyun.agmp.iotm.device.domain.reqvo.IotMonitorDeviceListReqVo;
-import com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceAndTypeInfoResVo;
-import com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceListResVo;
+import java.util.List;
+
+import com.yunfeiyun.agmp.iot.common.domain.IotDevice;
 import com.yunfeiyun.agmp.iotm.device.mapper.IotDeviceMapper;
-import com.yunfeiyun.agmp.iotm.device.service.*;
-import com.yunfeiyun.agmp.iotm.device.translator.DeviceConfigurationTranslator;
-import com.yunfeiyun.agmp.iotm.device.translator.DeviceLogService;
-import com.yunfeiyun.agmp.iotm.device.translator.imp.*;
-import com.yunfeiyun.agmp.iotm.mq.IotmMqService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.BeanUtils;
+import com.yunfeiyun.agmp.iotm.device.service.IIotDeviceService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
-import java.util.*;
-
 
 /**
  * 设备基础Service业务层处理
- *
+ * 
  * @author 杨晓辉
- * @date 2024-01-04
+ * @date 2024-11-06
  */
-@Slf4j
 @Service
-public class IotDeviceServiceImpl implements IIotDeviceService {
-
-    @Autowired
-    private DeviceLogService deviceLogService;
-
+public class IotDeviceServiceImpl implements IIotDeviceService
+{
     @Autowired
     private IotDeviceMapper iotDeviceMapper;
 
-    @Autowired
-    private MongoService mongoService;
-
-    @Autowired
-    private IIotXmzndeviceService iotXmzndeviceService;
-
-    @Autowired
-    private IIotDeviceconfigService iIotDeviceconfigService;
-    @Autowired
-    private IIotYfScdService iIotYfScdService;
-
-    @Resource
-    private IotmMqService iotmMqService;
-
-    @Resource
-    private IIotCmdtaskService iIotCmdtaskService;
-    @Resource
-    private IotObckDeviceService iotObckDeviceService;
-    @Resource
-    private IotJsyStQfService iotJsyStQfService;
-
-    @Autowired
-    IIotFirmdevService iIotFirmdevService;
-
-    @Autowired
-    IIotXyinfoService iIotXyinfoService;
-
-    @Autowired
-    IIotPestrecogService iIotPestrecogService;
-    @Resource
-    private IIotDevicetypeService iotDevicetypeService;
-    @Resource
-    private Map<String, IotDeviceBaseService> iotDeviceBaseServiceMap;
-
-
     /**
      * 查询设备基础
-     *
-     * @param devBid 设备基础主键
+     * 
+     * @param id 设备基础主键
      * @return 设备基础
      */
     @Override
-    public IotDeviceResVo selectIotDeviceByDevBid(String devBid) {
-        IotDeviceResVo resVo = iotDeviceMapper.selectIotDeviceByDevBid(devBid);
-        if(resVo == null){
-            log.error(IotErrorCode.DB_NOT_FOUND.getCode());
-            return null;
-        }
-        Map<String, Object> landMap = iotDeviceMapper.selectTmnLandByDevBid(devBid);
-        Map<String, Object> blockMap = iotDeviceMapper.selectTmnBlockByDevBid(devBid);
-        if (landMap != null) {
-            resVo.setLandId(landMap.get("landId") == null ? null : landMap.get("landId").toString());
-            resVo.setLandName(landMap.get("landName") == null ? null : landMap.get("landName").toString());
-        }
-        if (blockMap != null) {
-            resVo.setBlockId(blockMap.get("blockId") == null ? null : blockMap.get("blockId").toString());
-            resVo.setBlockName(blockMap.get("blockName") == null ? null : blockMap.get("blockName").toString());
-        }
-        return resVo;
-    }
-
-    @Override
-    public IotDevice findOneByBizId(String devBid) {
-        return iotDeviceMapper.findOneByBizId(devBid);
+    public IotDevice selectIotDeviceById(Long id)
+    {
+        return iotDeviceMapper.selectIotDeviceById(id);
     }
 
     /**
      * 查询设备基础列表
-     *
-     * @param reqVo 设备基础
+     * 
+     * @param iotDevice 设备基础
      * @return 设备基础
      */
     @Override
-    public List<IotDeviceListResVo> selectIotDeviceList(IotDeviceListReqVo reqVo) {
-        String devtypeBid = reqVo.getDevtypeBid();
-        String devSubtype = reqVo.getDevSubtype();
-        List<IotDeviceListResVo> iotDevices = new ArrayList<>();
-        if(Objects.equals(devtypeBid, IotDeviceTypeLv1Enum.WSKZ.getCode()) && Objects.equals(devSubtype, XphRelayEnum.MIE_JUN.getCode())) {
-            IotDeviceCangLiWsmjListReqVo iotDeviceCangLiWsmjListReqVo = new IotDeviceCangLiWsmjListReqVo();
-            iotDeviceCangLiWsmjListReqVo.setDevSubtype(devSubtype);
-            iotDeviceCangLiWsmjListReqVo.setDevtypeBidByKzg(devtypeBid);
-            iotDeviceCangLiWsmjListReqVo.setDevtypeBidByZnkg(IotDeviceTypeLv1Enum.HPF_WSMJ_ZNKG.getCode());
-            iotDeviceCangLiWsmjListReqVo.setLandId(reqVo.getLandId());
-            iotDeviceCangLiWsmjListReqVo.setBlockId(reqVo.getBlockId());
-            iotDeviceCangLiWsmjListReqVo.setDevCode(reqVo.getDevCode());
-            iotDevices = iotDeviceMapper.selectCangLiWsmjIotDeviceList(iotDeviceCangLiWsmjListReqVo);
-        }else{
-            iotDevices = iotDeviceMapper.selectIotDeviceList(reqVo);
-        }
-
-        //云飞测报灯
-        if (IotDeviceTypeLv1Enum.CBD.getCode().equals(devtypeBid)) {
-            for (IotDeviceListResVo resVo : iotDevices) {
-                //查询图片数量
-                Map<String, Object> map = new HashMap<>();
-                map.put("devBid", resVo.getDevBid());
-                map.put("cbdimgDelstatus", "0");
-                long count = mongoService.count(IotCbdimg.class, map);
-                resVo.setImgCount(count);
-
-            }
-
-        } else if (IotDeviceTypeLv1Enum.BZY.getCode().equals(devtypeBid)
-            || IotDeviceTypeLv1Enum.BZBZY.getCode().equals(devtypeBid)
-        ) {
-            for (IotDeviceListResVo resVo : iotDevices) {
-                //查询图片数量
-                Map<String, Object> map = new HashMap<>();
-                map.put("devBid", resVo.getDevBid());
-                map.put("bzyimgDelstatus", "0");
-                long count = mongoService.count(IotBzyimg.class, map);
-                resVo.setImgCount(count);
-
-            }
-
-        } else if (IotDeviceTypeLv1Enum.JB.getCode().equals(devtypeBid)||IotDeviceTypeLv1Enum.JM.getCode().equals(devtypeBid)) {    //卷被、卷膜
-
-            for (IotDeviceListResVo item : iotDevices) {
-                IotXmzndeviceResVo findDevice = iotXmzndeviceService.selectIotXmzndeviceByDevBid(item.getDevBid());
-                if (findDevice != null) {
-                    item.setDevCtrlstatus(findDevice.getXdCtrlstatus());
-                }
-
-            }
-        } else if (IotDeviceTypeLv1Enum.SCD.getCode().equals(devtypeBid)
-                || IotDeviceTypeLv1Enum.FXSSCD.getCode().equals(devtypeBid)
-                || IotDeviceTypeLv1Enum.JGFXSSCD.getCode().equals(devtypeBid)
-        ) {
-            List<String> devBidList = new ArrayList<>();
-            for (IotDeviceListResVo item : iotDevices) {
-                devBidList.add(item.getDevBid());
-            }
-            Map<String, IotDeviceconfig> devConfigMap = iIotDeviceconfigService.selectIotDeviceConfigMapByDevBidList(devBidList);
-            for (IotDeviceListResVo item : iotDevices) {
-                String devBid = item.getDevBid();
-                if (devConfigMap.containsKey(devBid)) {
-                    IotDeviceconfig deviceconfig = devConfigMap.get(devBid);
-                    JSONObject devConfig = JSONObject.parseObject(deviceconfig.getDevcfgContext());
-                    IotYfScdDataVo iotYfScdDataVo = new IotYfScdDataVo();
-                    iotYfScdDataVo.setTimingTime(devConfig.getString("tt"));
-                    iotYfScdDataVo.setClearTime(devConfig.getString("clt_t"));
-                    iotYfScdDataVo.setTimingMode(devConfig.getString("ts"));
-                    iotYfScdDataVo.setStartHour(devConfig.getString("st"));
-                    iotYfScdDataVo.setEndHour(devConfig.getString("et"));
-
-                    item.setIotYfScdDataVo(iotYfScdDataVo);
-                }
-
-            }
-
-        } else if (IotDeviceTypeLv1Enum.XYCB.getCode().equals(devtypeBid)) {
-            // 性诱测报设备
-            List<String> devBidList = new ArrayList<>();
-            for (IotDeviceListResVo item : iotDevices) {
-                String devBid = item.getDevBid();
-                devBidList.add(devBid);
-            }
-            if (devBidList.size() > 0) {
-                List<IotXyinfoDto> iotXyinfoListResVoList = iIotXyinfoService.selectIotXyinfoListByDevBidList(devBidList);
-                Map<String, IotXyinfoDto> iotXyinfoListResVoMap = new HashMap<>();
-                for (IotXyinfoDto iotXyinfoListResVo : iotXyinfoListResVoList) {
-                    iotXyinfoListResVoMap.put(iotXyinfoListResVo.getDevBid(), iotXyinfoListResVo);
-                }
-
-                Map<String, IotXyinfoPestTotalDto> iotXyinfoPestTotalDtoMap = iIotPestrecogService.getIotXyinfoPestTotalMap(devBidList);
-
-                for (IotDeviceListResVo item : iotDevices) {
-                    String devBid = item.getDevBid();
-                    if (iotXyinfoListResVoMap.containsKey(devBid)) {
-                        item.setIotXyinfoDto(iotXyinfoListResVoMap.get(devBid));
-                    }
-                    if (iotXyinfoPestTotalDtoMap.containsKey(devBid)) {
-                        item.setXyPestTotal(iotXyinfoPestTotalDtoMap.get(devBid).getPestTotal());
-                    }
-                }
-            }
-        }else if(IotDeviceTypeLv1Enum.SZ.getCode().equals(devtypeBid)){
-            // 水闸设备
-            iotObckDeviceService.packageLastData(iotDevices);
-        }else if(IotDeviceTypeLv1Enum.QF.getCode().equals(devtypeBid)){
-            iotJsyStQfService.packageData(iotDevices);
-        }
-        return iotDevices;
+    public List<IotDevice> selectIotDeviceList(IotDevice iotDevice)
+    {
+        return iotDeviceMapper.selectIotDeviceList(iotDevice);
     }
 
     /**
      * 新增设备基础
-     *
+     * 
      * @param iotDevice 设备基础
      * @return 结果
      */
     @Override
-    @Transactional
-    public int insertIotDevice(IotDevice iotDevice) {
-        int re = iotDeviceMapper.insertIotDevice(iotDevice);
-        // 添加日志
-        deviceLogService.logAddDevice(iotDevice);
-        return re;
-    }
-
-    @Override
-    @Transactional
-    public int insertIotDeviceBatch(List<IotDevice> iotDevices) {
-        int re = iotDeviceMapper.insertIotDeviceBatch(iotDevices);
-        for (IotDevice iotDevice : iotDevices) {
-            // 添加日志
-            deviceLogService.logAddDevice(iotDevice);
-        }
-        return re;
+    public int insertIotDevice(IotDevice iotDevice)
+    {
+        return iotDeviceMapper.insertIotDevice(iotDevice);
     }
 
     /**
      * 修改设备基础
-     *
+     * 
      * @param iotDevice 设备基础
      * @return 结果
      */
     @Override
-    @Transactional
-    public int updateIotDevice(IotDevice iotDevice) {
-        deviceLogService.logUpdateDevice(iotDevice);
-        int re = iotDeviceMapper.updateIotDevice(iotDevice);
-        return re;
+    public int updateIotDevice(IotDevice iotDevice)
+    {
+        return iotDeviceMapper.updateIotDevice(iotDevice);
     }
 
     /**
      * 批量删除设备基础
-     *
+     * 
      * @param ids 需要删除的设备基础主键
      * @return 结果
      */
     @Override
-    @Transactional
-    public int deleteIotDeviceByDevBids(String[] ids, List<IotDevice> iotDevices) {
-        int re = iotDeviceMapper.deleteIotDeviceByDevBids(ids);
-        // 添加日志
-        for (IotDevice iotDevice : iotDevices) {
-            deviceLogService.logDeleteDevice(iotDevice);
-        }
-        return re;
-    }
-
-    @Override
-    public List<IotDevice> selectIotDeviceByDevBids(String[] devBids) {
-        return iotDeviceMapper.selectIotDeviceByDevBids(devBids);
-    }
-
-    @Override
-    public List<IotDeviceAndConfigResVo> selectIotDeviceAndConfigResVoList(IotMonitorDeviceListReqVo iotMonitorDeviceListReqVo) {
-        return iotDeviceMapper.selectIotDeviceAndConfigResVoList(iotMonitorDeviceListReqVo);
-    }
-
-    /**
-     * @param iotDeviceList
-     * @return
-     */
-    @Override
-    public int subscribeTopics(List<IotDevice> iotDeviceList) {
-        int status = insertIotDeviceBatch(iotDeviceList);
-        // 用于创建设备后需要主动获取最新信息,但是又不是mqtt协议,默认的mqtt走之前的,其他的进行走新的通道,  2024年6月5日 zhangn
-        String devType = iotDeviceList.get(0).getDevtypeBid();
-        // 该方法结合新的业务增加拓展,不改之前mqtt处理逻辑
-        if (IotDeviceDictConst.TYPE_HS_YBQ_DWB.equals(devType) || IotDeviceDictConst.TYPE_HS_YBQ_CMB.equals(devType)
-                || IotDeviceDictConst.TYPE_XPH_WSKZ.equals(devType)
-                || IotDeviceDictConst.TYPE_XPH_TRSH_CL.equals(devType)
-                || IotDeviceDictConst.TYPE_XPH_WSHJ_JC.equals(devType)
-                || IotDeviceDictConst.TYPE_XPH_GP_QXZ.equals(devType)
-        ) {
-            iotmMqService.sendMsg("createDeviceV2", IotMqConstant.DEVICE_CREATE_V2, iotDeviceList);
-        } else {
-            // 该方法默认认为是mqtt的
-            iotmMqService.sendMsg("createDevice", IotMqConstant.DEVICE_CREATE, iotDeviceList);
-            Map<String, IotDevice> iotDeviceMap = selectIotDeviceMapBatchBySubTopic(iotDeviceList);
-            for (IotDevice iotDevice : iotDeviceList) {
-                String devCode = iotDevice.getDevCode();
-                String devtypeBid = iotDevice.getDevtypeBid();
-                String firmBid = iotDevice.getFirmBid();
-                String key = firmBid + devtypeBid + devCode;
-                if (iotDeviceMap.containsKey(key)) {
-                    IotDevice newIotDevice = iotDeviceMap.get(key);
-                    String devBid = newIotDevice.getDevBid();
-                    createDeviceRefresh(devtypeBid, devBid);
-                }
-            }
-        }
-
-        return status;
-    }
-
-
-    /**
-     * @param
-     * @return
-     */
-    @Override
-    public List<IotDevice> selectIotDeviceListBatchBySubTopic(String[] devCodes) {
-        return iotDeviceMapper.selectIotDeviceListBatchBySubTopic(devCodes);
-    }
-
-    @Override
-    public JSONObject getDeviceRefreshConfig(String devtypeBid) {
-        JSONObject payload = null;
-        switch (devtypeBid) {
-            case IotDeviceDictConst.TYPE_YF_SCD:
-            case IotDeviceDictConst.TYPE_YF_FXSSCD:
-            case IotDeviceDictConst.TYPE_YF_JGFXSSCD:
-            case IotDeviceDictConst.TYPE_YF_CBD:
-            case IotDeviceDictConst.TYPE_YF_GKCBD:
-            case IotDeviceDictConst.TYPE_YF_BZY: {
-                payload = new JSONObject();
-                payload.put("cmd", "read");
-                payload.put("ext", "data");
-                break;
-            }
-            case IotDeviceDictConst.TYPE_YF_QXZ:
-            case IotDeviceDictConst.TYPE_YF_SQZ:
-                JSONObject ext = new JSONObject();
-                ext.put("type", "data");
-
-                payload = new JSONObject();
-                payload.put("cmd", "read");
-                payload.put("ext", ext);
-                break;
-            case IotDeviceDictConst.TYPE_XMZN_GSSQ:
-            case IotDeviceDictConst.TYPE_XMZN_PNHJJC:
-            case IotDeviceDictConst.TYPE_XMZN_QXZ:
-            case IotDeviceDictConst.TYPE_XMZN_SQZ:
-                payload = new JSONObject();
-                break;
-            case IotDeviceDictConst.TYPE_ADZN_GSSQ:
-                payload = new JSONObject();
-                break;
-            case IotDeviceDictConst.TYPE_XPH_WSKZ:
-                payload = new JSONObject();
-                break;
-            case IotDeviceDictConst.TYPE_HPF_WSMJ_ZNKG:
-                payload = new JSONObject();
-                break;
-        }
-        return payload;
+    public int deleteIotDeviceByIds(Long[] ids)
+    {
+        return iotDeviceMapper.deleteIotDeviceByIds(ids);
     }
 
     /**
-     * @param devBid
-     */
-    @Override
-    public void createDeviceRefresh(String devtypeBid, String devBid) {
-        log.info("创建【“刷新”指令集任务】,设备类型:{}", devtypeBid);
-        JSONObject payload = getDeviceRefreshConfig(devtypeBid);
-        if (payload != null) {
-            IotDeviceconfig iotDeviceconfig = new IotDeviceconfig();
-            iotDeviceconfig.setCId(CustomerIdUtil.getCustomerId());
-            iotDeviceconfig.setDevBid(devBid);
-            iotDeviceconfig.setDevcfgContext(JSONUtils.toJSONString(payload));
-
-            CmdGroupModel cmdGroupModel = iIotDeviceconfigService.createRefreshCmd(iotDeviceconfig);
-
-            // 构建日志需要用的内容
-            cmdGroupModel.setRequestId(IdUtils.fastUUID());
-            IotDevice iotDevice = iotDeviceMapper.findOneByBizId(devBid);
-            if (iotDevice == null) {
-                throw new IotBizException(IotErrorCode.FAILURE.getCode(), "设备不存在" + devBid);
-            }
-            cmdGroupModel.setDevCode(iotDevice.getDevCode());
-            cmdGroupModel.setCtBiztype("3");
-            cmdGroupModel.setCtDevtype(iotDevice.getDevtypeBid());
-            switch (devtypeBid) {
-                case IotDeviceDictConst.TYPE_YF_SCD:
-                    DeviceConfigurationTranslator scdConfigurationTranslator = new ScdConfigurationTranslator();
-                    cmdGroupModel.setCtParam(scdConfigurationTranslator.logTakeRefresh(iotDevice.getDevBid()));
-                    cmdGroupModel.setCtBiztitle(IotDeviceTypeLv1Enum.SCD.getName() + ":" + iotDevice.getDevCode());
-                    break;
-                case IotDeviceDictConst.TYPE_YF_FXSSCD:
-                    DeviceConfigurationTranslator fxsscdConfigurationTranslator = new FxsscdConfigurationTranslator();
-                    cmdGroupModel.setCtParam(fxsscdConfigurationTranslator.logTakeRefresh(iotDevice.getDevBid()));
-                    cmdGroupModel.setCtBiztitle(IotDeviceTypeLv1Enum.FXSSCD.getName() + ":" + iotDevice.getDevCode());
-                    break;
-                case IotDeviceDictConst.TYPE_YF_JGFXSSCD:
-                    DeviceConfigurationTranslator jgfxsscdConfigurationTranslator = new JgfxsscdConfigurationTranslator();
-                    cmdGroupModel.setCtParam(jgfxsscdConfigurationTranslator.logTakeRefresh(iotDevice.getDevBid()));
-                    cmdGroupModel.setCtBiztitle(IotDeviceTypeLv1Enum.JGFXSSCD.getName() + ":" + iotDevice.getDevCode());
-                    break;
-                case IotDeviceDictConst.TYPE_YF_GKCBD:
-                case IotDeviceDictConst.TYPE_YF_CBD:
-                    DeviceConfigurationTranslator cbdDeviceConfigurationTranslator = new CbdConfigurationTranslator();
-                    cmdGroupModel.setCtBiztitle(IotDeviceTypeLv1Enum.CBD.getName() + ":" + iotDevice.getDevCode());
-                    cmdGroupModel.setCtParam(cbdDeviceConfigurationTranslator.logTakeRefresh(iotDevice.getDevBid()));
-                    break;
-                case IotDeviceDictConst.TYPE_YF_BZY: {
-                    DeviceConfigurationTranslator bzyDeviceConfigurationTranslator = new BzyConfigurationTranslator();
-                    cmdGroupModel.setCtBiztitle(IotDeviceTypeLv1Enum.BZY.getName() + ":" + iotDevice.getDevCode());
-                    cmdGroupModel.setCtParam(bzyDeviceConfigurationTranslator.logTakeRefresh(iotDevice.getDevBid()));
-                    break;
-                }
-                case IotDeviceDictConst.TYPE_YF_QXZ:
-                case IotDeviceDictConst.TYPE_XMZN_QXZ:
-                    DeviceConfigurationTranslator deviceConfigurationTranslator = new QxzConfigurationTranslator();
-                    cmdGroupModel.setCtParam(deviceConfigurationTranslator.logTakeRefresh(iotDevice.getDevBid()));
-                    cmdGroupModel.setCtBiztitle(IotDeviceTypeLv1Enum.QXZ.getName() + ":" + iotDevice.getDevCode());
-                    break;
-                case IotDeviceDictConst.TYPE_YF_SQZ:
-                case IotDeviceDictConst.TYPE_XMZN_SQZ:
-                    DeviceConfigurationTranslator sqzConfigurationTranslator = new SqzConfigurationTranslator();
-                    cmdGroupModel.setCtParam(sqzConfigurationTranslator.logTakeRefresh(iotDevice.getDevBid()));
-                    cmdGroupModel.setCtBiztitle(IotDeviceTypeLv1Enum.SQZ.getName() + ":" + iotDevice.getDevCode());
-                    break;
-                case IotDeviceDictConst.TYPE_ADZN_GSSQ:
-                case IotDeviceDictConst.TYPE_XMZN_GSSQ:
-                    DeviceConfigurationTranslator gssqConfigurationTranslator = new GssqConfigurationTranslator();
-                    cmdGroupModel.setCtParam(gssqConfigurationTranslator.logTakeRefresh(iotDevice.getDevBid()));
-                    cmdGroupModel.setCtBiztitle(IotDeviceTypeLv1Enum.GSSQ.getName() + ":" + iotDevice.getDevCode());
-                    break;
-                case IotDeviceDictConst.TYPE_XMZN_PNHJJC:
-                    DeviceConfigurationTranslator pnhjjcConfigurationTranslator = new PnhjjcConfigurationTranslator();
-                    cmdGroupModel.setCtParam(pnhjjcConfigurationTranslator.logTakeRefresh(iotDevice.getDevBid()));
-                    cmdGroupModel.setCtBiztitle(IotDeviceTypeLv1Enum.PNHJJC.getName() + ":" + iotDevice.getDevCode());
-                    break;
-                case IotDeviceDictConst.TYPE_XPH_WSKZ:
-                    DeviceConfigurationTranslator xphWskzDeviceConfigurationTranslator = new XphWskzDeviceConfigurationTranslator();
-                    cmdGroupModel.setCtParam(xphWskzDeviceConfigurationTranslator.logTakeRefresh(iotDevice.getDevBid()));
-                    cmdGroupModel.setCtBiztitle(IotDeviceTypeLv1Enum.WSKZ.getName() + ":" + iotDevice.getDevCode());
-                    break;
-                case IotDeviceDictConst.TYPE_HPF_WSMJ_ZNKG:
-                    DeviceConfigurationTranslator hpfZnkgDeviceConfigurationTranslator = new HpfZnkgDeviceConfigurationTranslator();
-                    cmdGroupModel.setCtParam(hpfZnkgDeviceConfigurationTranslator.logTakeRefresh(iotDevice.getDevBid()));
-                    cmdGroupModel.setCtBiztitle(IotDeviceTypeLv1Enum.HPF_WSMJ_ZNKG.getName() + ":" + iotDevice.getDevCode());
-                    break;
-            }
-            iIotCmdtaskService.handInternalCmd(cmdGroupModel);
-
-
-        }
-    }
-
-    @Override
-    public List<IotDevice> selectIotDeviceListByFirmCode(String firmId, String code, String devtypeBid) {
-        return iotDeviceMapper.selectIotDeviceListByFirmCode(firmId, code, devtypeBid);
-    }
-
-    @Override
-    public void sendDeviceRefresh(String devBid) {
-        IotDevice iotDevice = findOneByBizId(devBid);
-        String devtypeBid = iotDevice.getDevtypeBid();
-        if (Objects.equals(iotDevice.getDevStatus(), "0")) {
-            throw new IotBizException(IotErrorCode.FAILURE.getCode(), "设备离线无法操作");
-        }
-        createDeviceRefresh(devtypeBid, devBid);
-    }
-
-    public Map<String, IotDevice> selectIotDeviceMapBatchBySubTopic(List<IotDevice> oldIotDeviceList) {
-        List<String> devCodeList = new ArrayList<>();
-        for (IotDevice iotDevice : oldIotDeviceList) {
-            devCodeList.add(iotDevice.getDevCode());
-        }
-        String[] devCodes = devCodeList.toArray(new String[0]);
-        Map<String, IotDevice> iotDeviceHashMap = new HashMap<>();
-        List<IotDevice> iotDeviceList = selectIotDeviceListBatchBySubTopic(devCodes);
-        for (IotDevice iotDevice : iotDeviceList) {
-            String devCode = iotDevice.getDevCode();
-            String devtypeBid = iotDevice.getDevtypeBid();
-            String firmBid = iotDevice.getFirmBid();
-            String key = firmBid + devtypeBid + devCode;
-
-            iotDeviceHashMap.put(key, iotDevice);
-        }
-        return iotDeviceHashMap;
-    }
-
-
-    @Override
-    public List<IotDevice> selectIotDeviceListByDevtypeBids(String[] devtypeBids) {
-        return iotDeviceMapper.selectIotDeviceListByDevtypeBids(devtypeBids);
-    }
-
-    @Override
-    public IotDeviceResVo selectIotDeviceByDevCodeAndType(String devCode, String ctDevtype) {
-
-        return iotDeviceMapper.selectIotDeviceByDevCodeAndType(devCode, ctDevtype);
-    }
-
-    @Override
-    public List<IotDeviceListResVo> selectIotSfDeviceList(IotDeviceListReqVo reqVo) {
-        List<IotDeviceListResVo> iotDevices = iotDeviceMapper.selectIotSfDeviceList(reqVo);
-
-        return iotDevices;
-    }
-
-    /**
-     * 将设备统一加上图片
-     *
-     * @param iotDeviceListResVos
-     */
-    @Override
-    public void setDevPicByDevList(List<IotDeviceListResVo> iotDeviceListResVos) {
-        for (IotDeviceListResVo iotDeviceListResVo1 : iotDeviceListResVos) {
-            iotDeviceListResVo1.setDevPic(iIotFirmdevService.getFirmDevPic(iotDeviceListResVo1.getDevtypeBid()));
-        }
-    }
-
-    @Override
-    public List<IotDeviceListResVo> selectIotDeviceListByLandIdAndBlockId(IotDeviceTypeLv1Enum iotDeviceTypeLv1Enum, String landId, String blockId) {
-        List<IotDeviceListResVo> iotDeviceListResVo = null;
-        if (StringUtils.isNotEmpty(blockId)) {
-            iotDeviceListResVo = iotDeviceMapper.selectIotDeviceListByBlockId(iotDeviceTypeLv1Enum.getCode(), blockId);
-        }
-        if (StringUtils.isNotEmpty(landId)) {
-            iotDeviceListResVo = iotDeviceMapper.selectIotDeviceListByLandId(iotDeviceTypeLv1Enum.getCode(), landId);
-        }
-        if (StringUtils.isEmpty(landId) && StringUtils.isEmpty(blockId)) {
-            iotDeviceListResVo = iotDeviceMapper.selectIotDeviceListByDevTypePid(iotDeviceTypeLv1Enum.getCode());
-        }
-        if (iotDeviceListResVo != null) {
-            iotDeviceListResVo.forEach((a) -> {
-                a.setDevLv1Code(IotDeviceDictEnum.getLv1CodeByCode(a.getDevtypeBid()));
-            });
-        }
-        return iotDeviceListResVo;
-    }
-    @Override
-    public List<IotDeviceListResVo> selectIotDeviceListByLandIdAndBlockId(List<String> devTypePids, String landId, String blockId) {
-        List<IotDeviceListResVo> iotDeviceListResVo = null;
-        if (StringUtils.isNotEmpty(blockId)) {
-            iotDeviceListResVo = iotDeviceMapper.selectIotDeviceListByBlockIdAndPids(devTypePids, blockId);
-        }
-        if (StringUtils.isNotEmpty(landId)) {
-            iotDeviceListResVo = iotDeviceMapper.selectIotDeviceListByLandIdAndPids(devTypePids, landId);
-        }
-        if (StringUtils.isEmpty(landId) && StringUtils.isEmpty(blockId)) {
-            iotDeviceListResVo = iotDeviceMapper.selectIotDeviceListByDevTypePids(devTypePids);
-        }
-        if (iotDeviceListResVo != null) {
-            iotDeviceListResVo.forEach((a) -> {
-                a.setDevLv1Code(IotDeviceDictEnum.getLv1CodeByCode(a.getDevtypeBid()));
-            });
-        }
-        return iotDeviceListResVo;
-    }
-
-    @Override
-    public IotDeviceAndTypeInfoResVo findIotDeviceAndTypeInfoResVoByBizId(String devBid) {
-        return iotDeviceMapper.findIotDeviceAndTypeInfoResVoByBizId(devBid);
-    }
-
-    /**
-     * @param firmdevBids
-     * @return
-     */
-    @Override
-    public List<IotDevice> selectIotDeviceListByFirmdevBids(String[] firmdevBids) {
-        return iotDeviceMapper.selectIotDeviceListByFirmdevBids(firmdevBids);
-    }
-
-    @Override
-    public List<IotDeviceListResVo> selectIotDeviceListByDevtypeBidsWithLand(String[] devTypeBids,String landId) {
-        return iotDeviceMapper.selectIotDeviceListByDevtypeBidsWithLand(devTypeBids,landId);
-    }
-
-    @Override
-    public List<IotDeviceListResVo> selectIotDeviceListByDevtypeBidsWithBlock(String[] devTypeBids,String blockId) {
-        return iotDeviceMapper.selectIotDeviceListByDevtypeBidsWithBlock(devTypeBids,blockId);
-    }
-
-    /**
-     * 查询设备数据列表
-     *
-     * @param reqVo
-     * @param findDevice
-     * @return
-     */
-    @Override
-    public TableDataInfo dataList(IotDeviceDataListReqVo reqVo, IotDeviceResVo findDevice) {
-        String devtypeBid = findDevice.getDevtypeBid();
-
-        return null;
-    }
-
-    /**
-     * 查询设备数据图表列表
-     *
-     * @param reqVo
-     * @param findDevice
-     * @return
+     * 删除设备基础信息
+     * 
+     * @param id 设备基础主键
+     * @return 结果
      */
     @Override
-    public TableDataInfo dataChartList(IotDeviceDataListReqVo reqVo, IotDeviceResVo findDevice) {
-        return null;
-    }
-
-    @Override
-    public String ctl(String devBid,String ctlMethodName, Object params) {
-        if(StringUtils.isEmpty(devBid)){
-            throw new IotBizException(ErrorCode.INVALID_PARAMETER.getCode(),"设备标识不能为空");
-        }
-        IotDeviceResVo iotDeviceResVo = iotDeviceMapper.selectIotDeviceByDevBid(devBid);
-        if(ObjectUtils.isNull(iotDeviceResVo)){
-            throw new IotBizException(ErrorCode.INVALID_PARAMETER.getCode(),"设备信息不存在");
-        }
-        IotDevice iotDevice = new IotDevice();
-        BeanUtils.copyProperties(iotDeviceResVo,iotDevice);
-        return ctl(iotDevice,ctlMethodName,params);
-    }
-    @Override
-    public String ctl(IotDevice iotDevice,String ctlMethodName, Object params) {
-        if(ObjectUtils.isNull(iotDevice)){
-            throw new IotBizException(ErrorCode.INVALID_PARAMETER.getCode(),"设备信息不存在");
-        }
-        IotDevicetype iotDevicetype = iotDevicetypeService.selectIotDevicetypeByBid(iotDevice.getDevtypeBid());
-        if(ObjectUtils.isNull(iotDevicetype)){
-            throw new IotBizException(ErrorCode.INVALID_PARAMETER.getCode(),"设备类型丢失");
-        }
-        IotDeviceBaseService iotDeviceBaseService = iotDeviceBaseServiceMap.get(iotDevicetype.getDevtypeServicename());
-        IotDeviceBaseCtlReqVo iotDeviceBaseCtlReqVo = new IotDeviceBaseCtlReqVo(ctlMethodName,params);
-        return iotDeviceBaseService.ctl(iotDeviceBaseCtlReqVo);
+    public int deleteIotDeviceById(Long id)
+    {
+        return iotDeviceMapper.deleteIotDeviceById(id);
     }
 }

+ 94 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/service/impl/IotDeviceconnServiceImpl.java

@@ -0,0 +1,94 @@
+package com.yunfeiyun.agmp.iotm.device.service.impl;
+
+import java.util.List;
+
+import com.yunfeiyun.agmp.iot.common.domain.IotDeviceconn;
+import com.yunfeiyun.agmp.iotm.device.mapper.IotDeviceconnMapper;
+import com.yunfeiyun.agmp.iotm.device.service.IIotDeviceconnService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 设备连接配置Service业务层处理
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+@Service
+public class IotDeviceconnServiceImpl implements IIotDeviceconnService
+{
+    @Autowired
+    private IotDeviceconnMapper iotDeviceconnMapper;
+
+    /**
+     * 查询设备连接配置
+     * 
+     * @param id 设备连接配置主键
+     * @return 设备连接配置
+     */
+    @Override
+    public IotDeviceconn selectIotDeviceconnById(Long id)
+    {
+        return iotDeviceconnMapper.selectIotDeviceconnById(id);
+    }
+
+    /**
+     * 查询设备连接配置列表
+     * 
+     * @param iotDeviceconn 设备连接配置
+     * @return 设备连接配置
+     */
+    @Override
+    public List<IotDeviceconn> selectIotDeviceconnList(IotDeviceconn iotDeviceconn)
+    {
+        return iotDeviceconnMapper.selectIotDeviceconnList(iotDeviceconn);
+    }
+
+    /**
+     * 新增设备连接配置
+     * 
+     * @param iotDeviceconn 设备连接配置
+     * @return 结果
+     */
+    @Override
+    public int insertIotDeviceconn(IotDeviceconn iotDeviceconn)
+    {
+        return iotDeviceconnMapper.insertIotDeviceconn(iotDeviceconn);
+    }
+
+    /**
+     * 修改设备连接配置
+     * 
+     * @param iotDeviceconn 设备连接配置
+     * @return 结果
+     */
+    @Override
+    public int updateIotDeviceconn(IotDeviceconn iotDeviceconn)
+    {
+        return iotDeviceconnMapper.updateIotDeviceconn(iotDeviceconn);
+    }
+
+    /**
+     * 批量删除设备连接配置
+     * 
+     * @param ids 需要删除的设备连接配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteIotDeviceconnByIds(Long[] ids)
+    {
+        return iotDeviceconnMapper.deleteIotDeviceconnByIds(ids);
+    }
+
+    /**
+     * 删除设备连接配置信息
+     * 
+     * @param id 设备连接配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteIotDeviceconnById(Long id)
+    {
+        return iotDeviceconnMapper.deleteIotDeviceconnById(id);
+    }
+}

+ 78 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/service/impl/TosDeviceclassServiceImpl.java

@@ -0,0 +1,78 @@
+package com.yunfeiyun.agmp.iotm.device.service.impl;
+
+import java.util.List;
+
+import com.yunfeiyun.agmp.iot.common.domain.TosDeviceclass;
+import com.yunfeiyun.agmp.iotm.device.mapper.TosDeviceclassMapper;
+import com.yunfeiyun.agmp.iotm.device.service.ITosDeviceclassService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * 设备类型Service业务层处理
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+@Service
+public class TosDeviceclassServiceImpl implements ITosDeviceclassService
+{
+    @Autowired
+    private TosDeviceclassMapper tosDeviceclassMapper;
+
+    /**
+     * 查询设备类型
+     *
+     * @param devclassBid 设备类型主键
+     * @return 设备类型
+     */
+    @Override
+    public TosDeviceclass selectTosDeviceclassByDevclassBid(String devclassBid){
+        return tosDeviceclassMapper.selectTosDeviceclassByDevclassBid(devclassBid);
+    }
+
+    /**
+     * 查询设备类型列表
+     * 
+     * @param tosDeviceclass 设备类型
+     * @return 设备类型
+     */
+    @Override
+    public List<TosDeviceclass> selectTosDeviceclassList(TosDeviceclass tosDeviceclass){
+        return tosDeviceclassMapper.selectTosDeviceclassList(tosDeviceclass);
+    }
+
+    /**
+     * 新增设备类型
+     * 
+     * @param tosDeviceclass 设备类型
+     * @return 结果
+     */
+    @Override
+    public int insertTosDeviceclass(TosDeviceclass tosDeviceclass){
+        return tosDeviceclassMapper.insertTosDeviceclass(tosDeviceclass);
+    }
+
+    /**
+     * 修改设备类型
+     * 
+     * @param tosDeviceclass 设备类型
+     * @return 结果
+     */
+    @Override
+    public int updateTosDeviceclass(TosDeviceclass tosDeviceclass){
+        return tosDeviceclassMapper.updateTosDeviceclass(tosDeviceclass);
+    }
+
+    /**
+     * 删除设备类型信息
+     * 
+     * @param id 设备类型主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTosDeviceclassByDevclassBid(String devclassBid){
+        return tosDeviceclassMapper.deleteTosDeviceclassByDevclassBid(devclassBid);
+    }
+}

+ 80 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/service/impl/TosDevicetypeServiceImpl.java

@@ -0,0 +1,80 @@
+package com.yunfeiyun.agmp.iotm.device.service.impl;
+
+import java.util.List;
+
+import com.yunfeiyun.agmp.iot.common.domain.TosDevicetype;
+import com.yunfeiyun.agmp.iotm.device.mapper.TosDevicetypeMapper;
+import com.yunfeiyun.agmp.iotm.device.service.ITosDevicetypeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * 设备类型Service业务层处理
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+@Service
+public class TosDevicetypeServiceImpl implements ITosDevicetypeService
+{
+    @Autowired
+    private TosDevicetypeMapper tosDevicetypeMapper;
+
+    /**
+     * 查询设备类型
+     *
+     * @param devtypeBid 设备类型主键
+     * @return 设备类型
+     */
+    @Override
+    public TosDevicetype selectTosDevicetypeByDevtypeBid(String devtypeBid){
+        return tosDevicetypeMapper.selectTosDevicetypeByDevtypeBid(devtypeBid);
+    }
+
+    /**
+     * 查询设备类型列表
+     * 
+     * @param tosDevicetype 设备类型
+     * @return 设备类型
+     */
+    @Override
+    public List<TosDevicetype> selectTosDevicetypeList(TosDevicetype tosDevicetype){
+        return tosDevicetypeMapper.selectTosDevicetypeList(tosDevicetype);
+    }
+
+    /**
+     * 新增设备类型
+     * 
+     * @param tosDevicetype 设备类型
+     * @return 结果
+     */
+    @Override
+    public int insertTosDevicetype(TosDevicetype tosDevicetype){
+        return tosDevicetypeMapper.insertTosDevicetype(tosDevicetype);
+    }
+
+    /**
+     * 修改设备类型
+     * 
+     * @param tosDevicetype 设备类型
+     * @return 结果
+     */
+    @Override
+    public int updateTosDevicetype(TosDevicetype tosDevicetype){
+        return tosDevicetypeMapper.updateTosDevicetype(tosDevicetype);
+    }
+
+
+
+    /**
+     * 删除设备类型信息
+     * 
+     * @param id 设备类型主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTosDevicetypeByDevtypeBid(String devtypeBid){
+        return tosDevicetypeMapper.deleteTosDevicetypeByDevtypeBid(devtypeBid);
+    }
+}

+ 80 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/service/impl/TosFirmServiceImpl.java

@@ -0,0 +1,80 @@
+package com.yunfeiyun.agmp.iotm.device.service.impl;
+
+import java.util.List;
+
+import com.yunfeiyun.agmp.iot.common.domain.TosFirm;
+import com.yunfeiyun.agmp.iotm.device.mapper.TosFirmMapper;
+import com.yunfeiyun.agmp.iotm.device.service.ITosFirmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * 厂家信息Service业务层处理
+ * 
+ * @author 杨晓辉
+ * @date 2024-11-06
+ */
+@Service
+public class TosFirmServiceImpl implements ITosFirmService
+{
+    @Autowired
+    private TosFirmMapper tosFirmMapper;
+
+    /**
+     * 查询厂家信息
+     *
+     * @param firmBid 厂家信息主键
+     * @return 厂家信息
+     */
+    @Override
+    public TosFirm selectTosFirmByFirmBid(String firmBid){
+        return tosFirmMapper.selectTosFirmByFirmBid(firmBid);
+    }
+
+    /**
+     * 查询厂家信息列表
+     * 
+     * @param tosFirm 厂家信息
+     * @return 厂家信息
+     */
+    @Override
+    public List<TosFirm> selectTosFirmList(TosFirm tosFirm){
+        return tosFirmMapper.selectTosFirmList(tosFirm);
+    }
+
+    /**
+     * 新增厂家信息
+     * 
+     * @param tosFirm 厂家信息
+     * @return 结果
+     */
+    @Override
+    public int insertTosFirm(TosFirm tosFirm){
+        return tosFirmMapper.insertTosFirm(tosFirm);
+    }
+
+    /**
+     * 修改厂家信息
+     * 
+     * @param tosFirm 厂家信息
+     * @return 结果
+     */
+    @Override
+    public int updateTosFirm(TosFirm tosFirm){
+        return tosFirmMapper.updateTosFirm(tosFirm);
+    }
+
+
+
+    /**
+     * 删除厂家信息信息
+     *
+     * @param Bid 厂家信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTosFirmByFirmBid(String firmBid){
+        return tosFirmMapper.deleteTosFirmByFirmBid(firmBid);
+    }
+}

+ 127 - 708
src/main/resources/mapper/IotDeviceMapper.xml

@@ -1,203 +1,107 @@
 <?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">
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yunfeiyun.agmp.iotm.device.mapper.IotDeviceMapper">
-
+    
     <resultMap type="IotDevice" id="IotDeviceResult">
-        <result property="id" column="id"/>
-        <result property="devBid" column="devBid"/>
-        <result property="cId" column="cId"/>
-        <result property="devtypeBid" column="devtypeBid"/>
-        <result property="firmBid" column="firmBid"/>
-        <result property="devCode" column="devCode"/>
-        <result property="devVersion" column="devVersion"/>
-        <result property="devStatus" column="devStatus"/>
-        <result property="devProvince" column="devProvince"/>
-        <result property="devCity" column="devCity"/>
-        <result property="devDistrict" column="devDistrict"/>
-        <result property="devLng" column="devLng"/>
-        <result property="devLat" column="devLat"/>
-        <result property="devProvincealign" column="devProvincealign"/>
-        <result property="devCityalign" column="devCityalign"/>
-        <result property="devDistrictalign" column="devDistrictalign"/>
-        <result property="devLngalign" column="devLngalign"/>
-        <result property="devLatalign" column="devLatalign"/>
-        <result property="devPositionstatus" column="devPositionstatus"/>
-        <result property="devPositiontype" column="devPositiontype"/>
-        <result property="devTag" column="devTag"/>
-        <result property="devRecogtype" column="devRecogtype"/>
-        <result property="devNetworktype" column="devNetworktype"/>
-        <result property="devOnlinedate" column="devOnlinedate"/>
-        <result property="devOfflinedate" column="devOfflinedate"/>
-        <result property="devSubtype" column="devSubtype"/>
-        <result property="devCreator" column="devCreator"/>
-        <result property="devModifier" column="devModifier"/>
-        <result property="devUpdateddate" column="devUpdateddate"/>
-        <result property="devModifieddate" column="devModifieddate"/>
-        <result property="devCreateddate" column="devCreateddate"/>
-        <result property="devDelstatus" column="devDelstatus"/>
-        <result property="devName" column="devName"/>
-        <result property="devContacts" column="devContacts"/>
-        <result property="devTel" column="devTel"/>
-        <result property="devOriginalid" column="devOriginalid"/>
+        <result property="id"    column="id"    />
+        <result property="devBid"    column="devBid"    />
+        <result property="tid"    column="tid"    />
+        <result property="devtypeBid"    column="devtypeBid"    />
+        <result property="firmBid"    column="firmBid"    />
+        <result property="devclassBid"    column="devclassBid"    />
+        <result property="devconnBid"    column="devconnBid"    />
+        <result property="devCode"    column="devCode"    />
+        <result property="devName"    column="devName"    />
+        <result property="devVersion"    column="devVersion"    />
+        <result property="devStatus"    column="devStatus"    />
+        <result property="devProvince"    column="devProvince"    />
+        <result property="devCity"    column="devCity"    />
+        <result property="devDistrict"    column="devDistrict"    />
+        <result property="devLng"    column="devLng"    />
+        <result property="devLat"    column="devLat"    />
+        <result property="devPositionstatus"    column="devPositionstatus"    />
+        <result property="devPositiontype"    column="devPositiontype"    />
+        <result property="devTag"    column="devTag"    />
+        <result property="devRecogtype"    column="devRecogtype"    />
+        <result property="devNetworktype"    column="devNetworktype"    />
+        <result property="devOfflinedate"    column="devOfflinedate"    />
+        <result property="devProvincealign"    column="devProvincealign"    />
+        <result property="devCityalign"    column="devCityalign"    />
+        <result property="devDistrictalign"    column="devDistrictalign"    />
+        <result property="devLngalign"    column="devLngalign"    />
+        <result property="devLatalign"    column="devLatalign"    />
+        <result property="devContacts"    column="devContacts"    />
+        <result property="devTel"    column="devTel"    />
+        <result property="devCreator"    column="devCreator"    />
+        <result property="devModifier"    column="devModifier"    />
+        <result property="devUpdateddate"    column="devUpdateddate"    />
+        <result property="devModifieddate"    column="devModifieddate"    />
+        <result property="devCreateddate"    column="devCreateddate"    />
+        <result property="devDelstatus"    column="devDelstatus"    />
     </resultMap>
 
     <sql id="selectIotDeviceVo">
-        select d.devBid, d.cId, d.devtypeBid, d.firmBid, d.devCode, d.devVersion, d.devStatus, d.devProvince, d.devCity,
-        d.devDistrict, d.devLng, d.devLat, d.devProvincealign, d.devCityalign, d.devDistrictalign, d.devLngalign,
-        d.devLatalign, d.devPositionstatus, d.devPositiontype, d.devTag, d.devRecogtype, d.devNetworktype, d.devOfflinedate,
-        d.devCreator, d.devModifier, d.devUpdateddate, d.devModifieddate, d.devCreateddate, d.devDelstatus,d.extInfo,
-        d.devName, f.firmName,f.firmTel devTel,f.firmDesc devContacts,
-        d.devOnlinedate, d.devSubtype,d.devOriginalid,d.devHostingstatus
-        ,FmsBlock.blockId,FmsBlock.blockName,FmsBlock.landId,FmsLand.landName,e.devtypePid
-        ,e.devtypeName
-        from IotDevice d
-        left join TmnLand on d.devBid = TmnLand.tmnId
-        LEFT JOIN  FmsLand  on  TmnLand.landId=FmsLand.landId
-        left join TmnBlock on d.devBid = TmnBlock.tmnId AND TmnBlock.blockId IN ( SELECT fb.blockId FROM FmsBlock AS fb )
-        left join FmsBlock on FmsBlock.blockId = TmnBlock.blockId
-        LEFT join IotDevicetype e on d.devtypeBid=e.devtypeBid
-        left join IotFirm f on d.firmBid = f.firmBid
+        select id, devBid, tid, devtypeBid, firmBid, devclassBid, devconnBid, devCode, devName, devVersion, devStatus, devProvince, devCity, devDistrict, devLng, devLat, devPositionstatus, devPositiontype, devTag, devRecogtype, devNetworktype, devOfflinedate, devProvincealign, devCityalign, devDistrictalign, devLngalign, devLatalign, devContacts, devTel, devCreator, devModifier, devUpdateddate, devModifieddate, devCreateddate, devDelstatus from IotDevice
     </sql>
 
-    <!-- 注意:这里保持前端查询列表类型字段不变,devtypeBid 但是实际查询的是类型的Pid-->
-    <select id="selectIotDeviceList" parameterType="IotDeviceListReqVo" resultType="IotDeviceListResVo">
+    <select id="selectIotDeviceList" parameterType="IotDevice" resultMap="IotDeviceResult">
         <include refid="selectIotDeviceVo"/>
-        <where>
-            devDelstatus = '0'
-            <if test="devBid != null  and devBid != ''">and d.devBid = #{devBid}</if>
-            <if test="cId != null  and cId != ''">and d.cId = #{cId}</if>
-            <if test="devtypeBids != null  and devtypeBids != ''">and e.devtypePid in (${devtypeBids})</if>
-            <if test="devtypeBid != null  and devtypeBid != ''">and e.devtypePid = #{devtypeBid}</if>
-            <if test="firmBid != null  and firmBid != ''">and d.firmBid = #{firmBid}</if>
-            <if test="devSubtype != null  and devSubtype != ''">and d.devSubtype = #{devSubtype}</if>
-            <if test="devTel != null  and devTel != ''">and d.devTel like concat('%', #{devTel}, '%')</if>
-            <if test="devName != null  and devName != ''">and d.devName like concat('%', #{devName}, '%')</if>
-            <if test="devCode != null  and devCode != ''">and d.devCode like concat('%', #{devCode}, '%')</if>
-            <if test="devStatus != null  and devStatus != ''">and d.devStatus = #{devStatus}</if>
-            <if test="devHostingstatus != null  and devHostingstatus != ''">and d.devHostingstatus =
-                #{devHostingstatus}
-            </if>
-            <if test="landId != null  and landId != ''">and FmsBlock.landId = #{landId}</if>
-            <if test="blockId != null  and blockId != ''">and FmsBlock.blockId = #{blockId}</if>
-            <if test="noQueryTypePids != null and noQueryTypePids != ''">
-                and e.devtypePid not in
-                <foreach collection="noQueryTypePids" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="noQueryTypeBids != null and noQueryTypeBids != ''">
-                and d.devtypeBid not in
-                <foreach collection="noQueryTypeBids" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="devtypeBidList != null  and devtypeBidList.size() != 0">
-                and d.devtypeBid in
-                <foreach collection="devtypeBidList" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="blockIds != null and blockIds.size() != 0">
-                and FmsBlock.blockId in
-                <foreach collection="blockIds" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="devtypePidList != null  and devtypePidList.size() != 0">
-                and e.devtypePid in
-                <foreach collection="devtypePidList" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-        </where>
-        GROUP BY d.devBid
-    </select>
-
-    <select id="selectIotDeviceByDevBid" parameterType="String" resultType="IotDeviceResVo">
+        <where>  
+            <if test="devBid != null  and devBid != ''"> and devBid = #{devBid}</if>
+            <if test="tid != null  and tid != ''"> and tid = #{tid}</if>
+            <if test="devtypeBid != null  and devtypeBid != ''"> and devtypeBid = #{devtypeBid}</if>
+            <if test="firmBid != null  and firmBid != ''"> and firmBid = #{firmBid}</if>
+            <if test="devclassBid != null  and devclassBid != ''"> and devclassBid = #{devclassBid}</if>
+            <if test="devconnBid != null  and devconnBid != ''"> and devconnBid = #{devconnBid}</if>
+            <if test="devCode != null  and devCode != ''"> and devCode = #{devCode}</if>
+            <if test="devName != null  and devName != ''"> and devName like concat('%', #{devName}, '%')</if>
+            <if test="devVersion != null  and devVersion != ''"> and devVersion = #{devVersion}</if>
+            <if test="devStatus != null  and devStatus != ''"> and devStatus = #{devStatus}</if>
+            <if test="devProvince != null  and devProvince != ''"> and devProvince = #{devProvince}</if>
+            <if test="devCity != null  and devCity != ''"> and devCity = #{devCity}</if>
+            <if test="devDistrict != null  and devDistrict != ''"> and devDistrict = #{devDistrict}</if>
+            <if test="devLng != null "> and devLng = #{devLng}</if>
+            <if test="devLat != null "> and devLat = #{devLat}</if>
+            <if test="devPositionstatus != null  and devPositionstatus != ''"> and devPositionstatus = #{devPositionstatus}</if>
+            <if test="devPositiontype != null  and devPositiontype != ''"> and devPositiontype = #{devPositiontype}</if>
+            <if test="devTag != null  and devTag != ''"> and devTag = #{devTag}</if>
+            <if test="devRecogtype != null  and devRecogtype != ''"> and devRecogtype = #{devRecogtype}</if>
+            <if test="devNetworktype != null  and devNetworktype != ''"> and devNetworktype = #{devNetworktype}</if>
+            <if test="devOfflinedate != null  and devOfflinedate != ''"> and devOfflinedate = #{devOfflinedate}</if>
+            <if test="devProvincealign != null  and devProvincealign != ''"> and devProvincealign = #{devProvincealign}</if>
+            <if test="devCityalign != null  and devCityalign != ''"> and devCityalign = #{devCityalign}</if>
+            <if test="devDistrictalign != null  and devDistrictalign != ''"> and devDistrictalign = #{devDistrictalign}</if>
+            <if test="devLngalign != null "> and devLngalign = #{devLngalign}</if>
+            <if test="devLatalign != null "> and devLatalign = #{devLatalign}</if>
+            <if test="devContacts != null  and devContacts != ''"> and devContacts = #{devContacts}</if>
+            <if test="devTel != null  and devTel != ''"> and devTel = #{devTel}</if>
+            <if test="devCreator != null  and devCreator != ''"> and devCreator = #{devCreator}</if>
+            <if test="devModifier != null  and devModifier != ''"> and devModifier = #{devModifier}</if>
+            <if test="devUpdateddate != null  and devUpdateddate != ''"> and devUpdateddate = #{devUpdateddate}</if>
+            <if test="devModifieddate != null  and devModifieddate != ''"> and devModifieddate = #{devModifieddate}</if>
+            <if test="devCreateddate != null  and devCreateddate != ''"> and devCreateddate = #{devCreateddate}</if>
+            <if test="devDelstatus != null  and devDelstatus != ''"> and devDelstatus = #{devDelstatus}</if>
+        </where>
+    </select>
+    
+    <select id="selectIotDeviceById" parameterType="Long" resultMap="IotDeviceResult">
         <include refid="selectIotDeviceVo"/>
-        where devBid = #{devBid}
-        GROUP BY d.devBid
-        ORDER BY TmnBlock.tmnblockAssigndate limit 1
+        where id = #{id}
     </select>
-
-    <select id="selectTmnLandByDevBid" parameterType="String" resultType="map">
-        select tl.*, l.landName from TmnLand tl left join FmsLand l on tl.landId = l.landId
-        where tmnId = #{devBid} order by tl.tmnlandAssigndate desc limit 1
-    </select>
-
-    <select id="selectTmnBlockByDevBid" parameterType="String" resultType="map">
-        select tb.*, b.blockName from TmnBlock tb left join FmsBlock b on tb.blockId = b.blockId
-        where tmnId = #{devBid} order by tb.tmnblockAssigndate desc limit 1
-    </select>
-    <select id="selectIotDeviceByDevBids" resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
-        <include refid="selectIotDeviceVo"/>
-        <where>
-            devBid in
-            <foreach collection="array" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </where>
-        GROUP BY d.devBid
-    </select>
-    <select id="findOneByBizId" resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
-        select * from IotDevice  where devBid = #{devBid}
-
-    </select>
-    <select id="selectIotDeviceAndConfigResVoList"
-            resultType="com.yunfeiyun.agmp.iotm.device.service.IotDeviceAndConfigResVo">
-        SELECT
-        idv.*,
-        idvc.devcfgContext
-        FROM
-        IotDevice idv
-        LEFT JOIN IotDeviceconfig idvc ON idv.devBid = idvc.devBid
-        LEFT join IotDevicetype e on idv.devtypeBid=e.devtypeBid
-        LEFT JOIN TmnLand tl on tl.tmnId = idv.devBid
-        LEFT JOIN TmnBlock tb on tb.tmnId = idv.devBid
-        <where>
-            devDelstatus = '0'
-            <if test="devBid != null  and devBid != ''">and idv.devBid = #{devBid}</if>
-            <if test="cId != null  and cId != ''">and idv.cId = #{cId}</if>
-            <if test="devtypeBid != null  and devtypeBid != ''">and e.devtypePid = #{devtypeBid}</if>
-            <if test="firmBid != null  and firmBid != ''">and idv.firmBid = #{firmBid}</if>
-            <if test="devSubtype != null  and devSubtype != ''">and idv.devSubtype = #{devSubtype}</if>
-            <if test="devTel != null  and devTel != ''">and idv.devTel like concat('%', #{devTel}, '%')</if>
-            <if test="devName != null  and devName != ''">and idv.devName like concat('%', #{devName}, '%')</if>
-            <if test="devCode != null  and devCode != ''">and idv.devCode like concat('%', #{devCode}, '%')</if>
-            <if test="devStatus != null  and devStatus != ''">and idv.devStatus = #{devStatus}</if>
-            <if test="devHostingstatus != null  and devHostingstatus != ''">and idv.devHostingstatus =
-                #{devHostingstatus}
-            </if>
-            <if test="devtypeBids !=null and devtypeBids.size() != 0 " >
-                and idv.devtypeBid in
-                <foreach collection="devtypeBids" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="devQuery != null and devQuery != ''">
-                and (idv.devName like concat('%',#{devQuery},'%') or idv.devCode like concat('%',#{devQuery},'%') )
-            </if>
-            <if test="blockId != null and blockId != ''">
-                and tb.blockId = #{blockId}
-            </if>
-            <if test="landId != null and landId != ''">
-                and tl.landId = #{landId}
-            </if>
-        </where>
-        group by idv.devBid
-    </select>
-
-    <!-- 联系人和联系电话用厂家的信息,这里不再使用 张宁-->
+        
     <insert id="insertIotDevice" parameterType="IotDevice" useGeneratedKeys="true" keyProperty="id">
         insert into IotDevice
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="devBid != null">devBid,</if>
-            <if test="cId != null">cId,</if>
+            <if test="tid != null">tid,</if>
             <if test="devtypeBid != null and devtypeBid != ''">devtypeBid,</if>
             <if test="firmBid != null">firmBid,</if>
+            <if test="devclassBid != null">devclassBid,</if>
+            <if test="devconnBid != null">devconnBid,</if>
             <if test="devCode != null">devCode,</if>
+            <if test="devName != null">devName,</if>
             <if test="devVersion != null">devVersion,</if>
             <if test="devStatus != null">devStatus,</if>
             <if test="devProvince != null">devProvince,</if>
@@ -205,34 +109,35 @@
             <if test="devDistrict != null">devDistrict,</if>
             <if test="devLng != null">devLng,</if>
             <if test="devLat != null">devLat,</if>
-            <if test="devProvincealign != null">devProvincealign,</if>
-            <if test="devCityalign != null">devCityalign,</if>
-            <if test="devDistrictalign != null">devDistrictalign,</if>
-            <if test="devLngalign != null">devLngalign,</if>
-            <if test="devLatalign != null">devLatalign,</if>
             <if test="devPositionstatus != null">devPositionstatus,</if>
             <if test="devPositiontype != null">devPositiontype,</if>
             <if test="devTag != null">devTag,</if>
             <if test="devRecogtype != null">devRecogtype,</if>
             <if test="devNetworktype != null">devNetworktype,</if>
-            <if test="devOnlinedate != null">devOnlinedate,</if>
             <if test="devOfflinedate != null">devOfflinedate,</if>
-            <if test="devSubtype != null">devSubtype,</if>
+            <if test="devProvincealign != null">devProvincealign,</if>
+            <if test="devCityalign != null">devCityalign,</if>
+            <if test="devDistrictalign != null">devDistrictalign,</if>
+            <if test="devLngalign != null">devLngalign,</if>
+            <if test="devLatalign != null">devLatalign,</if>
+            <if test="devContacts != null">devContacts,</if>
+            <if test="devTel != null">devTel,</if>
             <if test="devCreator != null">devCreator,</if>
             <if test="devModifier != null">devModifier,</if>
             <if test="devUpdateddate != null">devUpdateddate,</if>
             <if test="devModifieddate != null">devModifieddate,</if>
             <if test="devCreateddate != null">devCreateddate,</if>
             <if test="devDelstatus != null">devDelstatus,</if>
-            <if test="devName != null">devName,</if>
-
-        </trim>
+         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="devBid != null">#{devBid},</if>
-            <if test="cId != null">#{cId},</if>
+            <if test="tid != null">#{tid},</if>
             <if test="devtypeBid != null and devtypeBid != ''">#{devtypeBid},</if>
             <if test="firmBid != null">#{firmBid},</if>
+            <if test="devclassBid != null">#{devclassBid},</if>
+            <if test="devconnBid != null">#{devconnBid},</if>
             <if test="devCode != null">#{devCode},</if>
+            <if test="devName != null">#{devName},</if>
             <if test="devVersion != null">#{devVersion},</if>
             <if test="devStatus != null">#{devStatus},</if>
             <if test="devProvince != null">#{devProvince},</if>
@@ -240,114 +145,39 @@
             <if test="devDistrict != null">#{devDistrict},</if>
             <if test="devLng != null">#{devLng},</if>
             <if test="devLat != null">#{devLat},</if>
-            <if test="devProvincealign != null">#{devProvincealign},</if>
-            <if test="devCityalign != null">#{devCityalign},</if>
-            <if test="devDistrictalign != null">#{devDistrictalign},</if>
-            <if test="devLngalign != null">#{devLngalign},</if>
-            <if test="devLatalign != null">#{devLatalign},</if>
             <if test="devPositionstatus != null">#{devPositionstatus},</if>
             <if test="devPositiontype != null">#{devPositiontype},</if>
             <if test="devTag != null">#{devTag},</if>
             <if test="devRecogtype != null">#{devRecogtype},</if>
             <if test="devNetworktype != null">#{devNetworktype},</if>
-            <if test="devOnlinedate != null">#{devOnlinedate},</if>
             <if test="devOfflinedate != null">#{devOfflinedate},</if>
-            <if test="devSubtype != null">#{devSubtype},</if>
+            <if test="devProvincealign != null">#{devProvincealign},</if>
+            <if test="devCityalign != null">#{devCityalign},</if>
+            <if test="devDistrictalign != null">#{devDistrictalign},</if>
+            <if test="devLngalign != null">#{devLngalign},</if>
+            <if test="devLatalign != null">#{devLatalign},</if>
+            <if test="devContacts != null">#{devContacts},</if>
+            <if test="devTel != null">#{devTel},</if>
             <if test="devCreator != null">#{devCreator},</if>
             <if test="devModifier != null">#{devModifier},</if>
             <if test="devUpdateddate != null">#{devUpdateddate},</if>
             <if test="devModifieddate != null">#{devModifieddate},</if>
             <if test="devCreateddate != null">#{devCreateddate},</if>
             <if test="devDelstatus != null">#{devDelstatus},</if>
-            <if test="devName != null">#{devName},</if>
-
-        </trim>
-    </insert>
-
-    <insert id="insertIotDeviceBatch" parameterType="IotDevice" useGeneratedKeys="true" keyProperty="id">
-        insert into IotDevice
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            devBid,
-            cId,
-            devtypeBid,
-            firmBid,
-            devCode,
-            devVersion,
-            devStatus,
-            devProvince,
-            devCity,
-            devDistrict,
-            devLng,
-            devLat,
-            devProvincealign,
-            devCityalign,
-            devDistrictalign,
-            devLngalign,
-            devLatalign,
-            devPositionstatus,
-            devPositiontype,
-            devTag,
-            devRecogtype,
-            devNetworktype,
-            devOnlinedate,
-            devOfflinedate,
-            devSubtype,
-            devCreator,
-            devModifier,
-            devUpdateddate,
-            devModifieddate,
-            devCreateddate,
-            devDelstatus,
-            devName,
-            extInfo,
-        </trim>
-        values
-        <foreach item="data" collection="list" separator=",">
-            (
-            #{data.devBid},
-            #{data.cId},
-            #{data.devtypeBid},
-            #{data.firmBid},
-            #{data.devCode},
-            #{data.devVersion},
-            #{data.devStatus},
-            #{data.devProvince},
-            #{data.devCity},
-            #{data.devDistrict},
-            #{data.devLng},
-            #{data.devLat},
-            #{data.devProvincealign},
-            #{data.devCityalign},
-            #{data.devDistrictalign},
-            #{data.devLngalign},
-            #{data.devLatalign},
-            #{data.devPositionstatus},
-            #{data.devPositiontype},
-            #{data.devTag},
-            #{data.devRecogtype},
-            #{data.devNetworktype},
-            #{data.devOnlinedate},
-            #{data.devOfflinedate},
-            #{data.devSubtype},
-            #{data.devCreator},
-            #{data.devModifier},
-            #{data.devUpdateddate},
-            #{data.devModifieddate},
-            #{data.devCreateddate},
-            #{data.devDelstatus},
-            #{data.devName},
-            #{data.extInfo}
-            )
-        </foreach>
+         </trim>
     </insert>
 
     <update id="updateIotDevice" parameterType="IotDevice">
         update IotDevice
         <trim prefix="SET" suffixOverrides=",">
-            <if test="cId != null">cId = #{cId},</if>
+            <if test="devBid != null">devBid = #{devBid},</if>
+            <if test="tid != null">tid = #{tid},</if>
             <if test="devtypeBid != null and devtypeBid != ''">devtypeBid = #{devtypeBid},</if>
             <if test="firmBid != null">firmBid = #{firmBid},</if>
+            <if test="devclassBid != null">devclassBid = #{devclassBid},</if>
+            <if test="devconnBid != null">devconnBid = #{devconnBid},</if>
             <if test="devCode != null">devCode = #{devCode},</if>
+            <if test="devName != null">devName = #{devName},</if>
             <if test="devVersion != null">devVersion = #{devVersion},</if>
             <if test="devStatus != null">devStatus = #{devStatus},</if>
             <if test="devProvince != null">devProvince = #{devProvince},</if>
@@ -355,448 +185,37 @@
             <if test="devDistrict != null">devDistrict = #{devDistrict},</if>
             <if test="devLng != null">devLng = #{devLng},</if>
             <if test="devLat != null">devLat = #{devLat},</if>
-            <if test="devProvincealign != null">devProvincealign = #{devProvincealign},</if>
-            <if test="devCityalign != null">devCityalign = #{devCityalign},</if>
-            <if test="devDistrictalign != null">devDistrictalign = #{devDistrictalign},</if>
-            <if test="devLngalign != null">devLngalign = #{devLngalign},</if>
-            <if test="devLatalign != null">devLatalign = #{devLatalign},</if>
             <if test="devPositionstatus != null">devPositionstatus = #{devPositionstatus},</if>
             <if test="devPositiontype != null">devPositiontype = #{devPositiontype},</if>
             <if test="devTag != null">devTag = #{devTag},</if>
             <if test="devRecogtype != null">devRecogtype = #{devRecogtype},</if>
             <if test="devNetworktype != null">devNetworktype = #{devNetworktype},</if>
-            <if test="devOnlinedate != null">devOnlinedate = #{devOnlinedate},</if>
             <if test="devOfflinedate != null">devOfflinedate = #{devOfflinedate},</if>
-            <if test="devSubtype != null">devSubtype = #{devSubtype},</if>
+            <if test="devProvincealign != null">devProvincealign = #{devProvincealign},</if>
+            <if test="devCityalign != null">devCityalign = #{devCityalign},</if>
+            <if test="devDistrictalign != null">devDistrictalign = #{devDistrictalign},</if>
+            <if test="devLngalign != null">devLngalign = #{devLngalign},</if>
+            <if test="devLatalign != null">devLatalign = #{devLatalign},</if>
+            <if test="devContacts != null">devContacts = #{devContacts},</if>
+            <if test="devTel != null">devTel = #{devTel},</if>
             <if test="devCreator != null">devCreator = #{devCreator},</if>
             <if test="devModifier != null">devModifier = #{devModifier},</if>
             <if test="devUpdateddate != null">devUpdateddate = #{devUpdateddate},</if>
             <if test="devModifieddate != null">devModifieddate = #{devModifieddate},</if>
             <if test="devCreateddate != null">devCreateddate = #{devCreateddate},</if>
-            <if test="devName != null">devName = #{devName},</if>
-            <if test="devHostingstatus != null">devHostingstatus = #{devHostingstatus},</if>
-            <if test="extInfo != null">extInfo = #{extInfo},</if>
+            <if test="devDelstatus != null">devDelstatus = #{devDelstatus},</if>
         </trim>
-        where devBid = #{devBid}
+        where id = #{id}
     </update>
 
+    <delete id="deleteIotDeviceById" parameterType="Long">
+        delete from IotDevice where id = #{id}
+    </delete>
 
-    <delete id="deleteIotDeviceByDevBids" parameterType="String">
-        update IotDevice set devDelstatus = '1' where devBid in
-        <foreach item="devBid" collection="array" open="(" separator="," close=")">
-            #{devBid}
+    <delete id="deleteIotDeviceByIds" parameterType="String">
+        delete from IotDevice where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
         </foreach>
     </delete>
-
-    <select id="selectIotDeviceListBatchBySubTopic" resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
-        select d.devBid, d.cId, d.devtypeBid, d.firmBid, d.devCode, d.devVersion, d.devStatus, d.devProvince, d.devCity,
-        d.devDistrict, d.devLng, d.devLat, d.devProvincealign, d.devCityalign, d.devDistrictalign, d.devLngalign,
-        d.devLatalign, d.devPositionstatus, d.devPositiontype, d.devTag, d.devRecogtype, d.devNetworktype,
-        d.devOfflinedate,
-        d.devCreator, d.devModifier, d.devUpdateddate, d.devModifieddate, d.devCreateddate, d.devDelstatus,d.extInfo,
-        d.devName, d.devContacts, d.devTel, d.devOnlinedate, d.devSubtype,d.devOriginalid,d.devHostingstatus
-        from IotDevice d
-        <where>
-            d.devCode in
-            <foreach collection="array" item="devCode" open="(" close=")" separator=",">
-                #{devCode}
-            </foreach>
-        </where>
-    </select>
-
-    <select id="selectIotDeviceListByFirmCode" resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
-            select * from IotDevice where firmBid=#{firmId} and devCode=#{code} and devtypeBid= #{devtypeBid} and devDelstatus='0'
-    </select>
-
-    <select id="selectIotDeviceListByDevtypeBids" resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
-        select * from IotDevice
-        <where>
-            devDelstatus='0'
-            and devtypeBid in
-            <foreach collection="array" item="devtypeBid" open="(" close=")" separator=",">
-                #{devtypeBid}
-            </foreach>
-
-        </where>
-    </select>
-    <select id="selectIotDeviceByDevCodeAndType"
-            resultType="com.yunfeiyun.agmp.iot.common.domain.resvo.IotDeviceResVo">
-
-SELECT e.*, c.landId,
-	c.landName from (
-
-SELECT a.* ,b.landId
-FROM
-	(
-		SELECT
-			*
-		FROM
-			IotDevice
-		WHERE
-			devCode =#{devCode}
-		AND devtypeBid =#{ctDevtype}
-		AND devDelstatus = '0'
-	) a
-LEFT JOIN TmnLand b ON a.devBid = b.tmnId
-
-) e LEFT JOIN FmsLand c ON c.landId = e.landId
-limit 1
-
-    </select>
-    <select id="selectIotSfDeviceList"
-            resultType="com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceListResVo">
-        select d.devBid, d.cId, d.devtypeBid, d.firmBid, d.devCode, d.devVersion, d.devStatus, d.devProvince, d.devCity,
-        d.devDistrict, d.devLng, d.devLat, d.devProvincealign, d.devCityalign, d.devDistrictalign, d.devLngalign,
-        d.devLatalign, d.devPositionstatus, d.devPositiontype, d.devTag, d.devRecogtype, d.devNetworktype,
-        d.devOfflinedate,
-        d.devCreator, d.devModifier, d.devUpdateddate, d.devModifieddate, d.devCreateddate, d.devDelstatus,d.extInfo,
-        d.devName, f.firmName,f.firmTel devTel,f.firmDesc devContacts,
-        d.devOnlinedate, d.devSubtype,d.devOriginalid,d.devHostingstatus
-        ,FmsLand.landId,FmsLand.landName
-        from IotDevice d
-        left join IotFirm f on d.firmBid = f.firmBid
-        left join TmnLand on d.devBid = TmnLand.tmnId
-        LEFT join IotDevicetype e on d.devtypeBid=e.devtypeBid
-        LEFT JOIN FmsLand on TmnLand.landId=FmsLand.landId
-        <where>
-            devDelstatus = '0'
-            <if test="devBid != null  and devBid != ''">and d.devBid = #{devBid}</if>
-            <if test="cId != null  and cId != ''">and d.cId = #{cId}</if>
-            <if test="devtypeBids != null  and devtypeBids != ''">and d.devtypeBid in (${devtypeBids})</if>
-            <if test="devtypeBid != null  and devtypeBid != ''">and e.devtypePid = #{devtypeBid}</if>
-            <if test="firmBid != null  and firmBid != ''">and d.firmBid = #{firmBid}</if>
-            <if test="devSubtype != null  and devSubtype != ''">and d.devSubtype = #{devSubtype}</if>
-            <if test="devTel != null  and devTel != ''">and d.devTel like concat('%', #{devTel}, '%')</if>
-            <if test="devName != null  and devName != ''">and d.devName like concat('%', #{devName}, '%')</if>
-            <if test="devCode != null  and devCode != ''">and d.devCode like concat('%', #{devCode}, '%')</if>
-            <if test="devStatus != null  and devStatus != ''">and d.devStatus = #{devStatus}</if>
-            <if test="landId != null  and landId != ''">and FmsBlock.landId = #{landId}</if>
-            <if test="blockId != null  and blockId != ''">and FmsBlock.blockId = #{blockId}</if>
-            <if test="devtypeBid != null  and devtypeBid != ''">and e.devtypePid=#{devtypeBid}</if>
-        </where>
-        GROUP BY d.devBid
-
-
-    </select>
-    <select id="selectIotDeviceListByLandId"
-            resultType="com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceListResVo">
-        SELECT d.*,c.tmnId from IotDevice d
-        LEFT join IotDevicetype e on d.devtypeBid=e.devtypeBid
-        left join (
-            SELECT tmnId from TmnLand where landId=#{landId}
-        ) c on c.tmnId=d.devBid
-        <where>
-            devDelstatus = '0'
-            <if test="devTypePid != null and devTypePid != ''">
-                and e.devtypePid = #{devTypePid}
-            </if>
-            and c.tmnId is not null
-            GROUP BY
-            d.devBid
-
-        </where>
-    </select>
-
-    <select id="selectIotDeviceListByBlockId"
-            resultType="com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceListResVo">
-
-        SELECT d.*,c.tmnId from IotDevice d
-
-        LEFT join IotDevicetype e on d.devtypeBid=e.devtypeBid
-
-        left join (
-            SELECT tmnId from TmnBlock where blockId=#{blockId}
-        ) c on c.tmnId=d.devBid
-        <where>
-            devDelstatus = '0'
-            <if test="devTypePid != null and devTypePid != ''">
-                and e.devtypePid = #{devTypePid}
-            </if>
-            and c.tmnId is not null
-            GROUP BY
-            d.devBid
-
-        </where>
-    </select>
-<!-- 查询已经绑定的设备,可能绑在基地/地块 -->
-    <select id="selectIotDeviceListByDevTypePid"
-            resultType="com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceListResVo">
-
-        SELECT
-        d.*
-        FROM
-        IotDevice d
-        LEFT JOIN IotDevicetype e ON d.devtypeBid = e.devtypeBid
-        LEFT JOIN (SELECT tmnId FROM TmnBlock) c ON c.tmnId = d.devBid
-        LEFT JOIN (SELECT tmnId FROM TmnLand) e ON e.tmnId = d.devBid
-
-        WHERE
-        devDelstatus = '0'
-        <if test="devTypePid != null and devTypePid != ''">
-            and e.devtypePid = #{devTypePid}
-        </if>
-        AND (c.tmnId IS NOT NULL
-        or e.tmnId IS NOT NULL)
-
-        GROUP BY
-        d.devBid
-
-    </select>
-    <select id="findIotDeviceAndTypeInfoResVoByBizId"
-            resultType="com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceAndTypeInfoResVo">
-        select idv.*,idt.devtypePid,idt.devtypeName from IotDevice idv LEFT JOIN IotDevicetype idt on idv.devtypeBid = idt.devtypeBid
-        <where>
-            idv.devBid = #{devBid}
-        </where>
-    </select>
-
-    <select id="selectIotDeviceListByFirmdevBids" resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
-        select *
-        from IotDevice as d
-            LEFT JOIN IotFirmdev AS fd ON fd.firmBid = d.firmBid AND fd.devtypeBid = d.devtypeBid
-        <where>
-            d.devDelstatus='0' and fd.firmdevBid in
-            <foreach collection="array" item="firmdevBid" open="(" close=")" separator=",">
-                #{firmdevBid}
-            </foreach>
-        </where>
-    </select>
-
-    <select id="selectIotDeviceListByDevtypeBidsWithLand" resultType="com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceListResVo">
-        select IotDevice.id,IotDevice.devBid,IotDevice.devtypeBid
-        ,IotDevice.firmBid,IotDevice.devCode,IotDevice.devStatus
-        ,IotDevice.devOnlinedate,IotDevice.devDelstatus,IotDevice.devName
-        ,IotDevice.devContacts,IotDevice.devTel,IotDevice.devSubtype,IotDevice.devHostingstatus,
-        FmsLand.landId,FmsLand.landName,IF(devLng ,devLng,FmsLand.landLongitude) as devLng,IF(devLat ,devLat,FmsLand.landLatitude) as devLat
-        ,IotDevicetype.devtypePid
-        from IotDevice
-        left join TmnLand on TmnLand.TmnId = IotDevice.devBid
-        left join FmsLand on FmsLand.landId = TmnLand.landId
-        left join IotDevicetype on IotDevicetype.devtypeBid = IotDevice.devtypeBid
-        <where>
-            devDelstatus='0'
-            <if test="devTypeBids != null and devTypeBids.length > 0">
-                and IotDevice.devtypeBid in
-                <foreach collection="devTypeBids" item="devtypeBid" open="(" close=")" separator=",">
-                    #{devtypeBid}
-                </foreach>
-            </if>
-            <if test="landId != null and landId != ''">
-                and FmsLand.landId = #{landId}
-            </if>
-
-        </where>
-    </select>
-
-    <select id="selectIotDeviceListByDevtypeBidsWithBlock" resultType="com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceListResVo">
-        select IotDevice.id,IotDevice.devBid,IotDevice.devtypeBid
-        ,IotDevice.firmBid,IotDevice.devCode,IotDevice.devStatus
-        ,IotDevice.devOnlinedate,IotDevice.devDelstatus,IotDevice.devName
-        ,IotDevice.devContacts,IotDevice.devTel,IotDevice.devSubtype,IotDevice.devHostingstatus,
-        FmsBlock.blockId,FmsBlock.blockName
-        ,IF(devLng ,devLng,FmsLand.landLongitude) as devLng,IF(devLat ,devLat,FmsLand.landLatitude) as devLat
-        ,FmsLand.landId,FmsLand.landName
-        ,IotDevicetype.devtypePid
-        from IotDevice
-        left join TmnBlock on TmnBlock.TmnId = IotDevice.devBid
-        left join FmsBlock on FmsBlock.blockId = TmnBlock.blockId
-        left join FmsLand on FmsLand.landId = FmsBlock.landId
-        left join IotDevicetype on IotDevicetype.devtypeBid = IotDevice.devtypeBid
-        <where>
-            devDelstatus='0'
-            <if test="devTypeBids != null and devTypeBids.length > 0">
-                and IotDevice.devtypeBid in
-                <foreach collection="devTypeBids" item="devtypeBid" open="(" close=")" separator=",">
-                    #{devtypeBid}
-                </foreach>
-            </if>
-
-            <if test="blockId != null and blockId != ''">
-                and FmsBlock.blockId = #{blockId}
-            </if>
-
-        </where>
-    </select>
-    <select id="selectIotDeviceTypeSum" resultType="java.util.Map">
-        SELECT
-        devtypePid ,
-        count(devtypePid) as typeSum
-        FROM
-        IotDevice idv LEFT JOIN IotDevicetype idt ON idv.devTypeBid = idt.devTypeBid
-        LEFT JOIN TmnBlock tb on tb.tmnId = idv.devBid
-        LEFT JOIN FmsBlock fb on fb.blockId = tb.blockId
-        where tb.tmnId is not null
-        <where>
-            <if test="landId != null and landId != ''">
-                and fb.landId = #{landId}
-            </if>
-        </where>
-        GROUP BY devtypePid
-    </select>
-
-    <!-- 注意:这里保持前端查询列表类型字段不变,devtypeBid 但是实际查询的是类型的Pid-->
-    <select id="selectCangLiWsmjIotDeviceList" parameterType="IotDeviceCangLiWsmjListReqVo" resultType="IotDeviceListResVo">
-        <include refid="selectIotDeviceVo"/>
-        <where>
-            devDelstatus = '0'
-            and ((e.devtypePid = #{devtypeBidByKzg} and d.devSubtype = #{devSubtype} ) or (e.devtypePid = #{devtypeBidByZnkg}))
-            <if test="devCode != null  and devCode != ''">and d.devCode like concat('%', #{devCode}, '%')</if>
-            <if test="landId != null  and landId != ''">and FmsBlock.landId = #{landId}</if>
-            <if test="blockId != null  and blockId != ''">and FmsBlock.blockId = #{blockId}</if>
-        </where>
-        GROUP BY d.devBid
-    </select>
-    <select id="selectBlockBindDevices" resultType="com.yunfeiyun.agmp.iot.common.domain.resvo.IotDeviceWithConfigResVo">
-        select id.*,idc.devcfgContext
-        from IotDevice id
-        LEFT JOIN IotDeviceconfig idc on idc.devBid = id.devBid
-        LEFT JOIN TmnBlock tb on id.devBid = tb.tmnId
-        <where>
-            <if test="blockId != null and blockId !=''">
-                and tb.blockId = #{blockId}
-            </if>
-            <if test="devTypeBids != null and devTypeBids.size() != 0">
-                and id.devtypeBid in
-                <foreach collection="devTypeBids" item="item" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-        </where>
-    </select>
-    <select id="findIotDeviceByDevCodeAndDevTypeBid"
-            resultType="com.yunfeiyun.agmp.iot.common.domain.IotDevice">
-        select * from IotDevice
-        where devCode = #{devCode} and devtypeBid = #{devtypeBid}
-        limit 1
-    </select>
-    <select id="selectIotDeviceStatusSum" resultType="java.util.Map">
-        SELECT
-        d.devStatus,
-        sum(d.devStatus) as devStatusSum
-        FROM
-        IotDevice d
-        LEFT JOIN TmnLand ON d.devBid = TmnLand.tmnId
-        LEFT JOIN FmsLand ON TmnLand.landId = FmsLand.landId
-        LEFT JOIN TmnBlock ON d.devBid = TmnBlock.tmnId
-        AND TmnBlock.blockId IN ( SELECT fb.blockId FROM FmsBlock AS fb )
-        LEFT JOIN FmsBlock ON FmsBlock.blockId = TmnBlock.blockId
-        LEFT JOIN IotDevicetype e ON d.devtypeBid = e.devtypeBid
-        LEFT JOIN IotFirm f ON d.firmBid = f.firmBid
-        <where>
-            devDelstatus = '0'
-            <if test="devBid != null  and devBid != ''">and d.devBid = #{devBid}</if>
-            <if test="cId != null  and cId != ''">and d.cId = #{cId}</if>
-            <if test="devtypeBids != null  and devtypeBids != ''">and e.devtypePid in (${devtypeBids})</if>
-            <if test="devtypeBid != null  and devtypeBid != ''">and e.devtypePid = #{devtypeBid}</if>
-            <if test="firmBid != null  and firmBid != ''">and d.firmBid = #{firmBid}</if>
-            <if test="devSubtype != null  and devSubtype != ''">and d.devSubtype = #{devSubtype}</if>
-            <if test="devTel != null  and devTel != ''">and d.devTel like concat('%', #{devTel}, '%')</if>
-            <if test="devName != null  and devName != ''">and d.devName like concat('%', #{devName}, '%')</if>
-            <if test="devCode != null  and devCode != ''">and d.devCode like concat('%', #{devCode}, '%')</if>
-            <if test="devStatus != null  and devStatus != ''">and d.devStatus = #{devStatus}</if>
-            <if test="devHostingstatus != null  and devHostingstatus != ''">and d.devHostingstatus =
-                #{devHostingstatus}
-            </if>
-            <if test="landId != null  and landId != ''">and FmsBlock.landId = #{landId}</if>
-            <if test="blockId != null  and blockId != ''">and FmsBlock.blockId = #{blockId}</if>
-            <if test="noQueryTypePids != null and noQueryTypePids != ''">
-                and e.devtypePid not in
-                <foreach collection="noQueryTypePids" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="noQueryTypeBids != null and noQueryTypeBids != ''">
-                and d.devtypeBid not in
-                <foreach collection="noQueryTypeBids" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="devtypeBidList != null  and devtypeBidList.size() != 0">
-                and d.devtypeBid in
-                <foreach collection="devtypeBidList" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="blockIds != null and blockIds.size() != 0">
-                and FmsBlock.blockId in
-                <foreach collection="blockIds" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="devtypePidList != null  and devtypePidList.size() != 0">
-                and e.devtypePid in
-                <foreach collection="devtypePidList" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-        </where>
-        GROUP BY d.devStatus
-    </select>
-    <select id="selectIotDeviceListByDevTypePids"
-            resultType="com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceListResVo">
-        SELECT
-        d.*
-        FROM
-        IotDevice d
-        LEFT JOIN IotDevicetype e ON d.devtypeBid = e.devtypeBid
-        LEFT JOIN (SELECT tmnId FROM TmnBlock) c ON c.tmnId = d.devBid
-        LEFT JOIN (SELECT tmnId FROM TmnLand) e ON e.tmnId = d.devBid
-        WHERE
-        devDelstatus = '0'
-        <if test="devTypePids != null and devTypePids.size() != 0">
-            and e.devtypePid in
-            <foreach collection="devTypePids" item="item" open="(" separator="," close=")" index="index">
-               #{item}
-            </foreach>
-        </if>
-        AND (c.tmnId IS NOT NULL
-        or e.tmnId IS NOT NULL)
-
-        GROUP BY
-        d.devBid
-    </select>
-    <select id="selectIotDeviceListByLandIdAndPids"
-            resultType="com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceListResVo">
-        SELECT d.*,c.tmnId from IotDevice d
-        LEFT join IotDevicetype e on d.devtypeBid=e.devtypeBid
-        left join (
-        SELECT tmnId from TmnLand where landId=#{landId}
-        ) c on c.tmnId=d.devBid
-        <where>
-            devDelstatus = '0'
-            <if test="devTypePids != null and devTypePids.size() != 0">
-                and e.devtypePid in
-                <foreach collection="devTypePids" index="index" item="item" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-            and c.tmnId is not null
-            GROUP BY
-            d.devBid
-        </where>
-    </select>
-    <select id="selectIotDeviceListByBlockIdAndPids"
-            resultType="com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDeviceListResVo">
-        SELECT d.*,c.tmnId from IotDevice d
-
-        LEFT join IotDevicetype e on d.devtypeBid=e.devtypeBid
-
-        left join (
-        SELECT tmnId from TmnBlock where blockId=#{blockId}
-        ) c on c.tmnId=d.devBid
-        <where>
-            devDelstatus = '0'
-            <if test="devTypePids != null and devTypePids.size() != 0">
-                and e.devtypePid in
-                <foreach collection="devTypePids" index="index" item="item" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-            and c.tmnId is not null
-            GROUP BY
-            d.devBid
-
-        </where>
-    </select>
-
-</mapper>
+</mapper>

+ 101 - 0
src/main/resources/mapper/IotDeviceconnMapper.xml

@@ -0,0 +1,101 @@
+<?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.yunfeiyun.agmp.iotm.device.mapper.IotDeviceconnMapper">
+    
+    <resultMap type="IotDeviceconn" id="IotDeviceconnResult">
+        <result property="id"    column="id"    />
+        <result property="devconnBid"    column="devconnBid"    />
+        <result property="devtypeBid"    column="devtypeBid"    />
+        <result property="devconnType"    column="devconnType"    />
+        <result property="devconnName"    column="devconnName"    />
+        <result property="devconnConfig"    column="devconnConfig"    />
+        <result property="devconnCreator"    column="devconnCreator"    />
+        <result property="devconnModifier"    column="devconnModifier"    />
+        <result property="devconnModifieddate"    column="devconnModifieddate"    />
+        <result property="devconnCreateddate"    column="devconnCreateddate"    />
+        <result property="tid"    column="tid"    />
+    </resultMap>
+
+    <sql id="selectIotDeviceconnVo">
+        select id, devconnBid, devtypeBid, devconnType, devconnName, devconnConfig, devconnCreator, devconnModifier, devconnModifieddate, devconnCreateddate, tid from IotDeviceconn
+    </sql>
+
+    <select id="selectIotDeviceconnList" parameterType="IotDeviceconn" resultMap="IotDeviceconnResult">
+        <include refid="selectIotDeviceconnVo"/>
+        <where>  
+            <if test="devconnBid != null  and devconnBid != ''"> and devconnBid = #{devconnBid}</if>
+            <if test="devtypeBid != null  and devtypeBid != ''"> and devtypeBid = #{devtypeBid}</if>
+            <if test="devconnType != null  and devconnType != ''"> and devconnType = #{devconnType}</if>
+            <if test="devconnName != null  and devconnName != ''"> and devconnName like concat('%', #{devconnName}, '%')</if>
+            <if test="devconnConfig != null  and devconnConfig != ''"> and devconnConfig = #{devconnConfig}</if>
+            <if test="devconnCreator != null  and devconnCreator != ''"> and devconnCreator = #{devconnCreator}</if>
+            <if test="devconnModifier != null  and devconnModifier != ''"> and devconnModifier = #{devconnModifier}</if>
+            <if test="devconnModifieddate != null  and devconnModifieddate != ''"> and devconnModifieddate = #{devconnModifieddate}</if>
+            <if test="devconnCreateddate != null  and devconnCreateddate != ''"> and devconnCreateddate = #{devconnCreateddate}</if>
+            <if test="tid != null  and tid != ''"> and tid = #{tid}</if>
+        </where>
+    </select>
+    
+    <select id="selectIotDeviceconnById" parameterType="Long" resultMap="IotDeviceconnResult">
+        <include refid="selectIotDeviceconnVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertIotDeviceconn" parameterType="IotDeviceconn" useGeneratedKeys="true" keyProperty="id">
+        insert into IotDeviceconn
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="devconnBid != null">devconnBid,</if>
+            <if test="devtypeBid != null">devtypeBid,</if>
+            <if test="devconnType != null">devconnType,</if>
+            <if test="devconnName != null">devconnName,</if>
+            <if test="devconnConfig != null">devconnConfig,</if>
+            <if test="devconnCreator != null">devconnCreator,</if>
+            <if test="devconnModifier != null">devconnModifier,</if>
+            <if test="devconnModifieddate != null">devconnModifieddate,</if>
+            <if test="devconnCreateddate != null">devconnCreateddate,</if>
+            <if test="tid != null">tid,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="devconnBid != null">#{devconnBid},</if>
+            <if test="devtypeBid != null">#{devtypeBid},</if>
+            <if test="devconnType != null">#{devconnType},</if>
+            <if test="devconnName != null">#{devconnName},</if>
+            <if test="devconnConfig != null">#{devconnConfig},</if>
+            <if test="devconnCreator != null">#{devconnCreator},</if>
+            <if test="devconnModifier != null">#{devconnModifier},</if>
+            <if test="devconnModifieddate != null">#{devconnModifieddate},</if>
+            <if test="devconnCreateddate != null">#{devconnCreateddate},</if>
+            <if test="tid != null">#{tid},</if>
+         </trim>
+    </insert>
+
+    <update id="updateIotDeviceconn" parameterType="IotDeviceconn">
+        update IotDeviceconn
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="devconnBid != null">devconnBid = #{devconnBid},</if>
+            <if test="devtypeBid != null">devtypeBid = #{devtypeBid},</if>
+            <if test="devconnType != null">devconnType = #{devconnType},</if>
+            <if test="devconnName != null">devconnName = #{devconnName},</if>
+            <if test="devconnConfig != null">devconnConfig = #{devconnConfig},</if>
+            <if test="devconnCreator != null">devconnCreator = #{devconnCreator},</if>
+            <if test="devconnModifier != null">devconnModifier = #{devconnModifier},</if>
+            <if test="devconnModifieddate != null">devconnModifieddate = #{devconnModifieddate},</if>
+            <if test="devconnCreateddate != null">devconnCreateddate = #{devconnCreateddate},</if>
+            <if test="tid != null">tid = #{tid},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteIotDeviceconnById" parameterType="Long">
+        delete from IotDeviceconn where id = #{id}
+    </delete>
+
+    <delete id="deleteIotDeviceconnByIds" parameterType="String">
+        delete from IotDeviceconn where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 84 - 0
src/main/resources/mapper/TosDeviceclassMapper.xml

@@ -0,0 +1,84 @@
+<?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.yunfeiyun.agmp.iotm.device.mapper.TosDeviceclassMapper">
+    
+    <resultMap type="TosDeviceclass" id="TosDeviceclassResult">
+        <result property="id"    column="id"    />
+        <result property="devclassBid"    column="devclassBid"    />
+        <result property="devclassCode"    column="devclassCode"    />
+        <result property="devclassName"    column="devclassName"    />
+        <result property="devclassRemark"    column="devclassRemark"    />
+        <result property="devclassCreator"    column="devclassCreator"    />
+        <result property="devclassModifier"    column="devclassModifier"    />
+        <result property="devclassModifieddate"    column="devclassModifieddate"    />
+        <result property="devclassCreateddate"    column="devclassCreateddate"    />
+    </resultMap>
+
+    <sql id="selectTosDeviceclassVo">
+        select id, devclassBid, devclassCode, devclassName, devclassRemark, devclassCreator, devclassModifier, devclassModifieddate, devclassCreateddate from TosDeviceclass
+    </sql>
+
+    <select id="selectTosDeviceclassList" parameterType="TosDeviceclass" resultMap="TosDeviceclassResult">
+        <include refid="selectTosDeviceclassVo"/>
+        <where>  
+            <if test="devclassBid != null  and devclassBid != ''"> and devclassBid = #{devclassBid}</if>
+            <if test="devclassCode != null  and devclassCode != ''"> and devclassCode = #{devclassCode}</if>
+            <if test="devclassName != null  and devclassName != ''"> and devclassName like concat('%', #{devclassName}, '%')</if>
+            <if test="devclassRemark != null  and devclassRemark != ''"> and devclassRemark = #{devclassRemark}</if>
+            <if test="devclassCreator != null  and devclassCreator != ''"> and devclassCreator = #{devclassCreator}</if>
+            <if test="devclassModifier != null  and devclassModifier != ''"> and devclassModifier = #{devclassModifier}</if>
+            <if test="devclassModifieddate != null  and devclassModifieddate != ''"> and devclassModifieddate = #{devclassModifieddate}</if>
+            <if test="devclassCreateddate != null  and devclassCreateddate != ''"> and devclassCreateddate = #{devclassCreateddate}</if>
+        </where>
+    </select>
+    
+    <select id="selectTosDeviceclassByDevclassBid" parameterType="Long" resultMap="TosDeviceclassResult">
+        <include refid="selectTosDeviceclassVo"/>
+        where String = #{devclassBid}
+    </select>
+        
+    <insert id="insertTosDeviceclass" parameterType="TosDeviceclass" useGeneratedKeys="true" keyProperty="id">
+        insert into TosDeviceclass
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="devclassBid != null">devclassBid,</if>
+            <if test="devclassCode != null">devclassCode,</if>
+            <if test="devclassName != null">devclassName,</if>
+            <if test="devclassRemark != null">devclassRemark,</if>
+            <if test="devclassCreator != null">devclassCreator,</if>
+            <if test="devclassModifier != null">devclassModifier,</if>
+            <if test="devclassModifieddate != null">devclassModifieddate,</if>
+            <if test="devclassCreateddate != null">devclassCreateddate,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="devclassBid != null">#{devclassBid},</if>
+            <if test="devclassCode != null">#{devclassCode},</if>
+            <if test="devclassName != null">#{devclassName},</if>
+            <if test="devclassRemark != null">#{devclassRemark},</if>
+            <if test="devclassCreator != null">#{devclassCreator},</if>
+            <if test="devclassModifier != null">#{devclassModifier},</if>
+            <if test="devclassModifieddate != null">#{devclassModifieddate},</if>
+            <if test="devclassCreateddate != null">#{devclassCreateddate},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTosDeviceclass" parameterType="TosDeviceclass">
+        update TosDeviceclass
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="devclassBid != null">devclassBid = #{devclassBid},</if>
+            <if test="devclassCode != null">devclassCode = #{devclassCode},</if>
+            <if test="devclassName != null">devclassName = #{devclassName},</if>
+            <if test="devclassRemark != null">devclassRemark = #{devclassRemark},</if>
+            <if test="devclassCreator != null">devclassCreator = #{devclassCreator},</if>
+            <if test="devclassModifier != null">devclassModifier = #{devclassModifier},</if>
+            <if test="devclassModifieddate != null">devclassModifieddate = #{devclassModifieddate},</if>
+            <if test="devclassCreateddate != null">devclassCreateddate = #{devclassCreateddate},</if>
+        </trim>
+        where devclassBid = #{devclassBid}
+    </update>
+
+    <delete id="deleteTosDeviceclassByDevclassBid" parameterType="String">
+        delete from TosDeviceclass where devclassBid = #{devclassBid}
+    </delete>
+</mapper>

+ 105 - 0
src/main/resources/mapper/TosDevicetypeMapper.xml

@@ -0,0 +1,105 @@
+<?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.yunfeiyun.agmp.iotm.device.mapper.TosDevicetypeMapper">
+    
+    <resultMap type="TosDevicetype" id="TosDevicetypeResult">
+        <result property="id"    column="id"    />
+        <result property="devtypeBid"    column="devtypeBid"    />
+        <result property="devclassBid"    column="devclassBid"    />
+        <result property="devtypeName"    column="devtypeName"    />
+        <result property="devtypeCode"    column="devtypeCode"    />
+        <result property="firmBid"    column="firmBid"    />
+        <result property="devtypePreview"    column="devtypePreview"    />
+        <result property="devtypeRemark"    column="devtypeRemark"    />
+        <result property="devTypeConfig"    column="devTypeConfig"    />
+        <result property="devtypeCreator"    column="devtypeCreator"    />
+        <result property="devtypeModifier"    column="devtypeModifier"    />
+        <result property="devtypeModifieddate"    column="devtypeModifieddate"    />
+        <result property="devtypeCreateddate"    column="devtypeCreateddate"    />
+    </resultMap>
+
+    <sql id="selectTosDevicetypeVo">
+        select id, devtypeBid, devclassBid, devtypeName, devtypeCode, firmBid, devtypePreview, devtypeRemark, devTypeConfig, devtypeCreator, devtypeModifier, devtypeModifieddate, devtypeCreateddate from TosDevicetype
+    </sql>
+
+    <select id="selectTosDevicetypeList" parameterType="TosDevicetype" resultMap="TosDevicetypeResult">
+        <include refid="selectTosDevicetypeVo"/>
+        <where>  
+            <if test="devtypeBid != null  and devtypeBid != ''"> and devtypeBid = #{devtypeBid}</if>
+            <if test="devclassBid != null  and devclassBid != ''"> and devclassBid = #{devclassBid}</if>
+            <if test="devtypeName != null  and devtypeName != ''"> and devtypeName like concat('%', #{devtypeName}, '%')</if>
+            <if test="devtypeCode != null  and devtypeCode != ''"> and devtypeCode = #{devtypeCode}</if>
+            <if test="firmBid != null  and firmBid != ''"> and firmBid = #{firmBid}</if>
+            <if test="devtypePreview != null  and devtypePreview != ''"> and devtypePreview = #{devtypePreview}</if>
+            <if test="devtypeRemark != null  and devtypeRemark != ''"> and devtypeRemark = #{devtypeRemark}</if>
+            <if test="devTypeConfig != null  and devTypeConfig != ''"> and devTypeConfig = #{devTypeConfig}</if>
+            <if test="devtypeCreator != null  and devtypeCreator != ''"> and devtypeCreator = #{devtypeCreator}</if>
+            <if test="devtypeModifier != null  and devtypeModifier != ''"> and devtypeModifier = #{devtypeModifier}</if>
+            <if test="devtypeModifieddate != null  and devtypeModifieddate != ''"> and devtypeModifieddate = #{devtypeModifieddate}</if>
+            <if test="devtypeCreateddate != null  and devtypeCreateddate != ''"> and devtypeCreateddate = #{devtypeCreateddate}</if>
+        </where>
+    </select>
+    
+    <select id="selectTosDevicetypeByDevtypeBid" parameterType="String" resultMap="TosDevicetypeResult">
+        <include refid="selectTosDevicetypeVo"/>
+        where devtypeBid = #{devtypeBid}
+    </select>
+        
+    <insert id="insertTosDevicetype" parameterType="TosDevicetype" useGeneratedKeys="true" keyProperty="id">
+        insert into TosDevicetype
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="devtypeBid != null">devtypeBid,</if>
+            <if test="devclassBid != null">devclassBid,</if>
+            <if test="devtypeName != null">devtypeName,</if>
+            <if test="devtypeCode != null">devtypeCode,</if>
+            <if test="firmBid != null">firmBid,</if>
+            <if test="devtypePreview != null">devtypePreview,</if>
+            <if test="devtypeRemark != null">devtypeRemark,</if>
+            <if test="devTypeConfig != null">devTypeConfig,</if>
+            <if test="devtypeCreator != null">devtypeCreator,</if>
+            <if test="devtypeModifier != null">devtypeModifier,</if>
+            <if test="devtypeModifieddate != null">devtypeModifieddate,</if>
+            <if test="devtypeCreateddate != null">devtypeCreateddate,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="devtypeBid != null">#{devtypeBid},</if>
+            <if test="devclassBid != null">#{devclassBid},</if>
+            <if test="devtypeName != null">#{devtypeName},</if>
+            <if test="devtypeCode != null">#{devtypeCode},</if>
+            <if test="firmBid != null">#{firmBid},</if>
+            <if test="devtypePreview != null">#{devtypePreview},</if>
+            <if test="devtypeRemark != null">#{devtypeRemark},</if>
+            <if test="devTypeConfig != null">#{devTypeConfig},</if>
+            <if test="devtypeCreator != null">#{devtypeCreator},</if>
+            <if test="devtypeModifier != null">#{devtypeModifier},</if>
+            <if test="devtypeModifieddate != null">#{devtypeModifieddate},</if>
+            <if test="devtypeCreateddate != null">#{devtypeCreateddate},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTosDevicetype" parameterType="TosDevicetype">
+        update TosDevicetype
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="devtypeBid != null">devtypeBid = #{devtypeBid},</if>
+            <if test="devclassBid != null">devclassBid = #{devclassBid},</if>
+            <if test="devtypeName != null">devtypeName = #{devtypeName},</if>
+            <if test="devtypeCode != null">devtypeCode = #{devtypeCode},</if>
+            <if test="firmBid != null">firmBid = #{firmBid},</if>
+            <if test="devtypePreview != null">devtypePreview = #{devtypePreview},</if>
+            <if test="devtypeRemark != null">devtypeRemark = #{devtypeRemark},</if>
+            <if test="devTypeConfig != null">devTypeConfig = #{devTypeConfig},</if>
+            <if test="devtypeCreator != null">devtypeCreator = #{devtypeCreator},</if>
+            <if test="devtypeModifier != null">devtypeModifier = #{devtypeModifier},</if>
+            <if test="devtypeModifieddate != null">devtypeModifieddate = #{devtypeModifieddate},</if>
+            <if test="devtypeCreateddate != null">devtypeCreateddate = #{devtypeCreateddate},</if>
+        </trim>
+        where devtypeBid = #{devtypeBid}
+    </update>
+
+    <delete id="deleteTosDevicetypeByDevtypeBid" parameterType="String">
+        delete from TosDevicetype where devtypeBid = #{devtypeBid}
+    </delete>
+
+</mapper>

+ 106 - 0
src/main/resources/mapper/TosFirmMapper.xml

@@ -0,0 +1,106 @@
+<?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.yunfeiyun.agmp.iotm.device.mapper.TosFirmMapper">
+    
+    <resultMap type="TosFirm" id="TosFirmResult">
+        <result property="id"    column="id"    />
+        <result property="firmBid"    column="firmBid"    />
+        <result property="firmName"    column="firmName"    />
+        <result property="firmCode"    column="firmCode"    />
+        <result property="firmShortname"    column="firmShortname"    />
+        <result property="firmLiaison"    column="firmLiaison"    />
+        <result property="firmTel"    column="firmTel"    />
+        <result property="firmRemark"    column="firmRemark"    />
+        <result property="firmCreator"    column="firmCreator"    />
+        <result property="firmModifier"    column="firmModifier"    />
+        <result property="firmModifieddate"    column="firmModifieddate"    />
+        <result property="firmCreateddate"    column="firmCreateddate"    />
+        <result property="firmStatus"    column="firmStatus"    />
+    </resultMap>
+
+    <sql id="selectTosFirmVo">
+        select id, firmBid, firmName, firmCode, firmShortname, firmLiaison, firmTel, firmRemark, firmCreator, firmModifier, firmModifieddate, firmCreateddate, firmStatus from TosFirm
+    </sql>
+
+    <select id="selectTosFirmList" parameterType="TosFirm" resultMap="TosFirmResult">
+        <include refid="selectTosFirmVo"/>
+        <where>  
+            <if test="firmBid != null  and firmBid != ''"> and firmBid = #{firmBid}</if>
+            <if test="firmName != null  and firmName != ''"> and firmName like concat('%', #{firmName}, '%')</if>
+            <if test="firmCode != null  and firmCode != ''"> and firmCode = #{firmCode}</if>
+            <if test="firmShortname != null  and firmShortname != ''"> and firmShortname like concat('%', #{firmShortname}, '%')</if>
+            <if test="firmLiaison != null  and firmLiaison != ''"> and firmLiaison = #{firmLiaison}</if>
+            <if test="firmTel != null  and firmTel != ''"> and firmTel = #{firmTel}</if>
+            <if test="firmRemark != null  and firmRemark != ''"> and firmRemark = #{firmRemark}</if>
+            <if test="firmCreator != null  and firmCreator != ''"> and firmCreator = #{firmCreator}</if>
+            <if test="firmModifier != null  and firmModifier != ''"> and firmModifier = #{firmModifier}</if>
+            <if test="firmModifieddate != null  and firmModifieddate != ''"> and firmModifieddate = #{firmModifieddate}</if>
+            <if test="firmCreateddate != null  and firmCreateddate != ''"> and firmCreateddate = #{firmCreateddate}</if>
+            <if test="firmStatus != null  and firmStatus != ''"> and firmStatus = #{firmStatus}</if>
+        </where>
+    </select>
+    
+    <select id="selectTosFirmByFirmBid" parameterType="String" resultMap="TosFirmResult">
+        <include refid="selectTosFirmVo"/>
+        where firmBid = #{firmBid}
+    </select>
+        
+    <insert id="insertTosFirm" parameterType="TosFirm" useGeneratedKeys="true" keyProperty="id">
+        insert into TosFirm
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="firmBid != null">firmBid,</if>
+            <if test="firmName != null">firmName,</if>
+            <if test="firmCode != null">firmCode,</if>
+            <if test="firmShortname != null">firmShortname,</if>
+            <if test="firmLiaison != null">firmLiaison,</if>
+            <if test="firmTel != null">firmTel,</if>
+            <if test="firmRemark != null">firmRemark,</if>
+            <if test="firmCreator != null">firmCreator,</if>
+            <if test="firmModifier != null">firmModifier,</if>
+            <if test="firmModifieddate != null">firmModifieddate,</if>
+            <if test="firmCreateddate != null">firmCreateddate,</if>
+            <if test="firmStatus != null">firmStatus,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="firmBid != null">#{firmBid},</if>
+            <if test="firmName != null">#{firmName},</if>
+            <if test="firmCode != null">#{firmCode},</if>
+            <if test="firmShortname != null">#{firmShortname},</if>
+            <if test="firmLiaison != null">#{firmLiaison},</if>
+            <if test="firmTel != null">#{firmTel},</if>
+            <if test="firmRemark != null">#{firmRemark},</if>
+            <if test="firmCreator != null">#{firmCreator},</if>
+            <if test="firmModifier != null">#{firmModifier},</if>
+            <if test="firmModifieddate != null">#{firmModifieddate},</if>
+            <if test="firmCreateddate != null">#{firmCreateddate},</if>
+            <if test="firmStatus != null">#{firmStatus},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTosFirm" parameterType="TosFirm">
+        update TosFirm
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="firmBid != null">firmBid = #{firmBid},</if>
+            <if test="firmName != null">firmName = #{firmName},</if>
+            <if test="firmCode != null">firmCode = #{firmCode},</if>
+            <if test="firmShortname != null">firmShortname = #{firmShortname},</if>
+            <if test="firmLiaison != null">firmLiaison = #{firmLiaison},</if>
+            <if test="firmTel != null">firmTel = #{firmTel},</if>
+            <if test="firmRemark != null">firmRemark = #{firmRemark},</if>
+            <if test="firmCreator != null">firmCreator = #{firmCreator},</if>
+            <if test="firmModifier != null">firmModifier = #{firmModifier},</if>
+            <if test="firmModifieddate != null">firmModifieddate = #{firmModifieddate},</if>
+            <if test="firmCreateddate != null">firmCreateddate = #{firmCreateddate},</if>
+            <if test="firmStatus != null">firmStatus = #{firmStatus},</if>
+        </trim>
+        where firmBid = #{firmBid}
+    </update>
+
+    <delete id="deleteTosFirmByFirmBid" parameterType="Long">
+        delete from TosFirm where firmBid = #{firmBid}
+    </delete>
+
+
+</mapper>