Bladeren bron

新增 获取气象站设备列表功能

zhaiyifei 1 jaar geleden
bovenliggende
commit
3b6e801f00

+ 43 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/qxz/controller/IotDeviceQxzController.java

@@ -0,0 +1,43 @@
+package com.yunfeiyun.agmp.iotm.device.qxz.controller;
+
+import com.yunfeiyun.agmp.common.core.page.TableDataInfo;
+import com.yunfeiyun.agmp.iot.common.constant.devicetype.IotDeviceDictConst;
+import com.yunfeiyun.agmp.iotm.common.controller.BaseController;
+import com.yunfeiyun.agmp.iotm.web.domain.reqvo.IotDeviceListReqVo;
+import com.yunfeiyun.agmp.iotm.web.domain.resvo.IotDeviceListResVo;
+import com.yunfeiyun.agmp.iotm.web.service.IIotDeviceService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 气象站设备控制器
+ */
+@RestController
+@RequestMapping("/iot/device/qxz")
+@Slf4j
+public class IotDeviceQxzController extends BaseController {
+
+    @Autowired
+    private IIotDeviceService iIotDeviceService;
+
+    /**
+     * 气象站列表
+     * @param reqVo
+     * @return
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(IotDeviceListReqVo reqVo) {
+        startPage();
+        String[] devTypeList = new String[]{IotDeviceDictConst.TYPE_YF_QXZ};
+        reqVo.setDevtypeBidList(Arrays.asList(devTypeList));
+
+        List<IotDeviceListResVo> list = iIotDeviceService.selectIotDeviceListByType(reqVo);
+        return getDataTable(list);
+    }
+}

+ 6 - 0
src/main/java/com/yunfeiyun/agmp/iotm/web/domain/reqvo/IotDeviceListReqVo.java

@@ -27,6 +27,12 @@ public class IotDeviceListReqVo extends IotDevice {
     /** 设备状态 */
     /** 设备状态 */
     @Excel(name = "设备状态")
     @Excel(name = "设备状态")
     private String devStatus;
     private String devStatus;
+    /** 厂商信息标识 */
+    @Excel(name = "厂商信息")
+    private String firmBid;
+
+    /** 联系方式 */
+    private String devTel;
 
 
     private String tid;
     private String tid;
 
 

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

@@ -135,7 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="devLngalign != null "> and d.devLngalign = #{devLngalign}</if>
             <if test="devLngalign != null "> and d.devLngalign = #{devLngalign}</if>
             <if test="devLatalign != null "> and d.devLatalign = #{devLatalign}</if>
             <if test="devLatalign != null "> and d.devLatalign = #{devLatalign}</if>
             <if test="devContacts != null  and devContacts != ''"> and d.devContacts = #{devContacts}</if>
             <if test="devContacts != null  and devContacts != ''"> and d.devContacts = #{devContacts}</if>
-            <if test="devTel != null  and devTel != ''"> and d.devTel = #{devTel}</if>
+            <if test="devTel != null  and devTel != ''"> and d.devTel like concat('%', #{devTel}, '%')</if>
             <if test="devCreator != null  and devCreator != ''"> and d.devCreator = #{devCreator}</if>
             <if test="devCreator != null  and devCreator != ''"> and d.devCreator = #{devCreator}</if>
             <if test="devModifier != null  and devModifier != ''"> and d.devModifier = #{devModifier}</if>
             <if test="devModifier != null  and devModifier != ''"> and d.devModifier = #{devModifier}</if>
             <if test="devUpdateddate != null  and devUpdateddate != ''"> and d.devUpdateddate = #{devUpdateddate}</if>
             <if test="devUpdateddate != null  and devUpdateddate != ''"> and d.devUpdateddate = #{devUpdateddate}</if>