From 2234cee8e872fd7633b95eef5b0c760cbbb8eabf Mon Sep 17 00:00:00 2001
From: Van333 <van666666@foxmail.com>
Date: 星期五, 02 九月 2022 17:00:00 +0800
Subject: [PATCH] 20220902林平凡离职交接(新增北理工大气数据获取)

---
 src/main/java/api/controller/CameraController.java                                 |   71 +++
 .idea/git_toolbox_prj.xml                                                          |    6 
 src/main/resources/mapper/WeatherV2Dao.xml                                         |  257 ++++++++++++
 src/main/java/api/bean/PoleSensorV2VOEntity.java                                   |   70 +++
 src/main/java/api/service/SinglelampDataServer.java                                |   35 +
 pom.xml                                                                            |    7 
 .idea/misc.xml                                                                     |    2 
 .idea/sonarlint/issuestore/index.pb                                                |    3 
 src/main/resources/mapper/PoleSinglelampDataMapper.xml                             |    2 
 target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst |    9 
 src/main/java/api/bean/AccessEntity.java                                           |   14 
 target/api-1.0-SNAPSHOT.jar.original                                               |    0 
 target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst   |   27 
 src/main/java/api/dao/SinglelampDataDao.java                                       |    4 
 src/main/java/api/controller/WeatherV2Controller.java                              |   81 +++
 src/main/java/api/service/AccessService.java                                       |   11 
 target/classes/mapper/PoleSinglelampDataMapper.xml                                 |    2 
 src/main/java/api/bean/PoleSensorV2SoilVOEntity.java                               |   36 +
 src/main/java/api/service/WeatherV2Service.java                                    |  101 ++++
 src/main/java/api/controller/TimerController.java                                  |  268 ++++++++++++
 /dev/null                                                                          |  144 ------
 src/main/java/api/bean/TimerRequest.java                                           |   38 +
 src/main/java/api/APIApplication.java                                              |    2 
 src/main/java/api/controller/SinglelampDataController.java                         |   10 
 src/main/java/api/bean/ReqParams.java                                              |   12 
 src/main/java/api/dao/AccessDao.java                                               |    2 
 src/main/java/api/dao/WeatherV2Dao.java                                            |   33 +
 27 files changed, 1,065 insertions(+), 182 deletions(-)

diff --git a/.idea/git_toolbox_prj.xml b/.idea/git_toolbox_prj.xml
index b382006..02b915b 100644
--- a/.idea/git_toolbox_prj.xml
+++ b/.idea/git_toolbox_prj.xml
@@ -6,10 +6,10 @@
         <option name="enabled" value="true" />
       </BoolValueOverride>
     </option>
-    <option name="commitMessageValidationConfigOverride">
-      <CommitMessageValidationOverride>
+    <option name="commitMessageValidationEnabledOverride">
+      <BoolValueOverride>
         <option name="enabled" value="true" />
-      </CommitMessageValidationOverride>
+      </BoolValueOverride>
     </option>
   </component>
 </project>
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index e926432..55cf96d 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -24,7 +24,7 @@
       </list>
     </option>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="jdk8u322-b06" project-jdk-type="JavaSDK" />
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="temurin-1.8" project-jdk-type="JavaSDK" />
   <component name="ProjectType">
     <option name="id" value="jpab" />
   </component>
diff --git a/.idea/sonarlint/issuestore/index.pb b/.idea/sonarlint/issuestore/index.pb
index e69de29..1a2e89b 100644
--- a/.idea/sonarlint/issuestore/index.pb
+++ b/.idea/sonarlint/issuestore/index.pb
@@ -0,0 +1,3 @@
+
+c
+3src/main/java/api/controller/WeatherController.java,a\6\a679d63f2053a2d504b84084e321ec7f09f6cf28
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index b1c43a3..fa3db8e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,7 +86,12 @@
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>
             <artifactId>httpcore</artifactId>
-            <version>4.4.6</version>
+            <version>4.4.15</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.7.5</version>
         </dependency>
 
         <!--鍒嗛〉鎻掍欢-->
diff --git a/src/main/java/api/APIApplication.java b/src/main/java/api/APIApplication.java
index 307d583..06c49bd 100644
--- a/src/main/java/api/APIApplication.java
+++ b/src/main/java/api/APIApplication.java
@@ -3,6 +3,7 @@
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableScheduling;
 
 /**
  * @program: wog
@@ -13,6 +14,7 @@
 
 @SpringBootApplication
 @MapperScan(basePackages = "api.dao")
+@EnableScheduling
 public class APIApplication {
 
     public static void main(String[] args) {
diff --git a/src/main/java/api/bean/AccessEntity.java b/src/main/java/api/bean/AccessEntity.java
index f6a1c90..7bbb970 100644
--- a/src/main/java/api/bean/AccessEntity.java
+++ b/src/main/java/api/bean/AccessEntity.java
@@ -25,14 +25,8 @@
 
     private Date updateTime;
 
-    @Override
-    public String toString() {
-        return "AccessEntity{" +
-                "userId=" + userId +
-                ", accessId=" + accessId +
-                ", accessKey='" + accessKey + '\'' +
-                ", accessSercet='" + accessSercet + '\'' +
-                ", accessToken='" + accessToken + '\'' +
-                '}';
-    }
+    private String ys7AccessToken;
+
+    private String ys7AccountId;
+
 }
diff --git a/src/main/java/api/bean/PoleSensorV2SoilVOEntity.java b/src/main/java/api/bean/PoleSensorV2SoilVOEntity.java
new file mode 100644
index 0000000..c3cc7f4
--- /dev/null
+++ b/src/main/java/api/bean/PoleSensorV2SoilVOEntity.java
@@ -0,0 +1,36 @@
+package api.bean;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author van
+ * @version 1.0
+ * msg锛�
+ * @date 2022/9/1 15:20
+ */
+@Data
+public class PoleSensorV2SoilVOEntity  {
+
+    private Long id;
+
+    private String mac;
+    //鍦熷¥浣撶Н鍚按閲�
+    private Double soilMoisture;
+    //鍦熷¥娓╁害
+    private Double soilTemperature;
+    //鐢靛鐜�
+    private Double soilEc;
+
+    private Date soilCreateDate;
+    //ph
+    private Double soilPh;
+
+    private String deviceType;
+
+    private String streetlightName;
+
+    private Long streetlightId;
+
+}
diff --git a/src/main/java/api/bean/PoleSensorV2VOEntity.java b/src/main/java/api/bean/PoleSensorV2VOEntity.java
new file mode 100644
index 0000000..17fac06
--- /dev/null
+++ b/src/main/java/api/bean/PoleSensorV2VOEntity.java
@@ -0,0 +1,70 @@
+package api.bean;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 鑰曞啘澶ф皵 鍖楃悊宸ュ畾鍒� 7鐩告暟
+ * HCD6817涓冭绱犲井姘旇薄浠紙娓╁害銆佹箍搴︺�佸ぇ姘斿帇鍔涖�侀閫熴�侀鍚戙�侀檷闆ㄩ噺銆佸厜鐓у害锛�
+ */
+@Data
+public class PoleSensorV2VOEntity implements Serializable {
+    /**
+     * 涓婚敭ID
+     */
+    private Integer id;
+
+    private String streetlightName;
+
+    /**
+     * 璺伅ID
+     */
+    private Integer streetlightId;
+
+
+    /**
+     * 绌烘皵娓╁害
+     */
+    private BigDecimal airTemperature;
+
+    /**
+     * 绌烘皵婀垮害
+     */
+    private BigDecimal airHumidity;
+
+    /**
+     * 澶ф皵鍘嬪己
+     */
+    private BigDecimal airPressure;
+
+    /**
+     * 椋庡悜
+     */
+    private BigDecimal windDirection;
+
+    /**
+     * 椋庨��
+     */
+    private BigDecimal windSpeed;
+
+    /**
+     * 鍗佸垎閽熼洦閲�
+     */
+    private BigDecimal tenRainfallMin;
+
+
+    /**
+     * 鍏夌収
+     */
+    private BigDecimal illumination;
+
+    /**
+     * 鍒涘缓鏃堕棿
+     */
+    private Date createTime;
+
+
+}
diff --git a/src/main/java/api/bean/ReqParams.java b/src/main/java/api/bean/ReqParams.java
index 11e5697..9ffc464 100644
--- a/src/main/java/api/bean/ReqParams.java
+++ b/src/main/java/api/bean/ReqParams.java
@@ -3,6 +3,7 @@
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.Timer;
 
 /**
  * @program: wog
@@ -33,7 +34,18 @@
     private String key;
 //    鎺х伅鎺ユ敹
     private PoleLightBatchEntity poleLightBatch;
+//     瀹氭椂浠诲姟鎺ユ敹
+    private TimerRequest timerRequest;
 
+    private Long[] streetlightIds;
+
+    private Integer timerId;
+    //  瀹氭椂鍚嶇О
+    private String timerName;
+    //  瀹氭椂琛ㄨ揪寮�
+    private String timerExp;
+    //    鐏ご搴忓彿
+    private Integer lightNumber;
     public String getApiKey() {
         return "84b5f9d6b37c47edb1adae628aaaf3e5";
     }
diff --git a/src/main/java/api/bean/TimerRequest.java b/src/main/java/api/bean/TimerRequest.java
new file mode 100644
index 0000000..04bcac5
--- /dev/null
+++ b/src/main/java/api/bean/TimerRequest.java
@@ -0,0 +1,38 @@
+package api.bean;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author van
+ * @version 1.0
+ * msg锛�
+ * @date 2022/6/9 15:01
+ */
+@Data
+public class TimerRequest {
+
+    //  瀹氭椂鍚嶇О
+    private String timerName;
+    //  瀹氭椂琛ㄨ揪寮�
+    private String timerExp;
+    //  缁処D
+    private Long groupId;
+    //  鐏潌ID鍒楄〃
+    private List<Long> ids;
+    //  椤电爜
+    private Integer page;
+    //  椤规暟
+    private Integer limit;
+    //  鎼滅储璇�
+    private String key;
+    //  瀹氭椂ID
+    private Integer timerId;
+    //  鏃堕棿鎴�
+    private Long timestamp;
+    //  鎿嶄綔鏃�
+    private String operateHour;
+    //    鐏ご搴忓彿
+    private Integer lightNumber;
+}
diff --git a/src/main/java/api/controller/CameraController.java b/src/main/java/api/controller/CameraController.java
new file mode 100644
index 0000000..ba233fe
--- /dev/null
+++ b/src/main/java/api/controller/CameraController.java
@@ -0,0 +1,71 @@
+package api.controller;
+
+import api.bean.ReqParams;
+import api.result.Msg;
+import api.service.AccessService;
+import api.utils.HttpUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.util.concurrent.RateLimiter;
+import com.google.gson.Gson;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author van
+ * @version 1.0
+ * msg锛�
+ * @date 2022/8/9 13:57
+ */
+@RestController
+@RequestMapping("/Camera")
+public class CameraController {
+
+    @Autowired
+    private AccessService accessService;
+
+    RateLimiter rateLimiter = RateLimiter.create(10.0);
+
+
+    @RequestMapping(value = "/getToken",method = RequestMethod.POST)
+    public Msg listWithNotStatus(@RequestBody ReqParams reqParams){
+        rateLimiter.acquire(1);
+
+        Long userId = accessService.getUserId(reqParams.getAccessToken());
+
+
+        if(userId == null){
+            return Msg.error("accessToken exception!!!");
+        }
+
+        //鐖禷ccesstoken
+
+        Map<String, String> parms =new HashMap<>(2);
+
+        parms.put("appKey","51a534ebadf54c31a0848dc575dfa206");
+        parms.put("appSecret","8c32c67a73c87b9e461b2e3bdf58967a");
+        String post = HttpUtil.httpRequestToString("https://open.ys7.com/api/lapp/token/get","post",parms);
+        String accessToken= JSON.parseObject(JSON.parseObject(post).getString("data")).getString("accessToken");
+
+
+        //瀛恆ccesstoken
+
+        String ys7AccountId = accessService.getYs7AccountId(reqParams.getAccessToken());
+
+        Map<String, String> parms02 =new HashMap<>(2);
+
+        parms02.put("accessToken",accessToken);
+        parms02.put("accountId",ys7AccountId);
+        String post02 = HttpUtil.httpRequestToString("https://open.ys7.com/api/lapp/ram/token/get","post",parms02);
+        System.out.println(post02);
+        JSONObject data = JSON.parseObject(JSON.parseObject(post02).getString("data"));
+
+        return Msg.ok(data);
+    }
+}
diff --git a/src/main/java/api/controller/SinglelampDataController.java b/src/main/java/api/controller/SinglelampDataController.java
index 843f4c0..2afe3c3 100644
--- a/src/main/java/api/controller/SinglelampDataController.java
+++ b/src/main/java/api/controller/SinglelampDataController.java
@@ -36,13 +36,13 @@
     @RequestMapping(value = "/list",method = RequestMethod.POST)
     public Msg list(@RequestBody ReqParams reqParams){
         rateLimiter.acquire(1);
-        if (reqParams.getLimit()>50){
+        if (reqParams.getLimit()>200){
             return Msg.error("limit exception!!!");
         }
         Long userId = accessService.getUserId(reqParams.getAccessToken());
 
         if(userId == null){
-            return Msg.error("server exception!!!");
+            return Msg.error("accessToken exception!!!");
         }
         reqParams.toString();
 
@@ -50,7 +50,9 @@
 
         Map data = new HashMap();
 
-        data.put("total",info.getTotal());
+        data.put("dataSize",info.getStartRow());
+        data.put("lampSize",info.getEndRow());
+        data.put("totalPage",Math.ceil(info.getStartRow()*1.0/reqParams.getLimit()));
         data.put("list",info.getList());
 
         return Msg.ok().put("data",data);
@@ -65,7 +67,7 @@
         Long userId = accessService.getUserId(reqParams.getAccessToken());
 
         if(userId == null){
-            return Msg.error("server exception!!!");
+            return Msg.error("accessToken exception!!!");
         }
 
         PageInfo<SinglelampDataEntity> info = singlelampDataServer.selectByStreetlightId(reqParams);
diff --git a/src/main/java/api/controller/TimerController.java b/src/main/java/api/controller/TimerController.java
new file mode 100644
index 0000000..6d9461d
--- /dev/null
+++ b/src/main/java/api/controller/TimerController.java
@@ -0,0 +1,268 @@
+package api.controller;
+
+import api.bean.PoleLightBatchEntity;
+import api.bean.ReqParams;
+import api.bean.TimerRequest;
+import api.result.Msg;
+import api.service.AccessService;
+import api.utils.HttpUtil;
+import com.alibaba.fastjson.JSON;
+import com.google.common.util.concurrent.RateLimiter;
+import com.google.gson.Gson;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author van
+ * @version 1.0
+ * msg锛氬崟鐏畾鏃朵换鍔℃帶鍒跺眰
+ * @date 2021/11/2 15:04
+ */
+@RestController
+@RequestMapping("/pole/timer")
+public class TimerController {
+
+    @Autowired
+    private AccessService accessService;
+
+    RateLimiter rateLimiter = RateLimiter.create(10.0);
+
+    /**
+     * 瀹氭椂浠诲姟鍒楄〃
+     * */
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public Msg listWithNotStatus(@RequestBody ReqParams reqParams){
+        rateLimiter.acquire(1);
+        if (reqParams.getLimit()>50){
+            return Msg.error("limit exception!!!");
+        }
+        Long userId = accessService.getUserId(reqParams.getAccessToken());
+
+
+        if(userId == null){
+            return Msg.error("accessToken exception!!!");
+        }
+
+        reqParams.setApiKey(reqParams.getApiKey());
+        reqParams.setUserId(userId);
+
+        TimerRequest timerRequest = new TimerRequest();
+        timerRequest.setLimit(reqParams.getLimit());
+        timerRequest.setPage(reqParams.getPage());
+
+        timerRequest.setIds(new ArrayList<>());
+        timerRequest.setKey(reqParams.getKey());
+        reqParams.setTimerRequest(timerRequest);
+
+
+
+        String result = HttpUtil.Post(
+                "http://127.0.0.1:8888/machine-fast/serv/api/timer/list",
+                new Gson().toJson(reqParams)
+        );
+
+        Map msg = JSON.parseObject(result, HashMap.class);
+
+        if (msg.get("msg").equals("success")){
+
+            return Msg.ok().put("data",msg.get("list"));
+        }
+        else {
+            return Msg.error(msg.get("msg").toString());
+        }
+
+
+    }
+
+    /**
+     * 鏌ョ湅瀹氭椂浠诲姟ID瀵瑰簲缁戝畾鐨勭伅鏉嗗垪琛�
+     * */
+    @RequestMapping(value = "listByTimerId",method = RequestMethod.POST)
+    public Msg getStreetlightListByTimerId(@RequestBody ReqParams reqParams){
+        System.out.println(reqParams);
+        rateLimiter.acquire(1);
+
+        Long userId = accessService.getUserId(reqParams.getAccessToken());
+
+
+        if(userId == null){
+            return Msg.error("accessToken exception!!!");
+        }
+
+        reqParams.setApiKey(reqParams.getApiKey());
+        reqParams.setUserId(userId);
+
+        TimerRequest timerRequest = new TimerRequest();
+        timerRequest.setTimerId(reqParams.getTimerId());
+
+        reqParams.setTimerRequest(timerRequest);
+
+
+
+        String result = HttpUtil.Post(
+                "http://127.0.0.1:8888/machine-fast/serv/api/timer/listByTimerId",
+                new Gson().toJson(reqParams)
+        );
+
+        Map msg = JSON.parseObject(result, HashMap.class);
+
+        if (msg.get("msg").equals("success")){
+
+            return Msg.ok().put("data",msg.get("list"));
+        }
+        else {
+            return Msg.error(msg.get("msg").toString());
+        }
+
+    }
+
+    /**
+     * 鍒犻櫎瀹氭椂浠诲姟
+     * */
+    @RequestMapping(value = "deleteTimerByTimerId",method = RequestMethod.POST)
+    public Msg deleteTimerByTimerId(@RequestBody ReqParams reqParams){
+        rateLimiter.acquire(1);
+
+        Long userId = accessService.getUserId(reqParams.getAccessToken());
+
+        if(userId == null){
+            return Msg.error("accessToken exception!!!");
+        }
+
+        reqParams.setApiKey(reqParams.getApiKey());
+        reqParams.setUserId(userId);
+
+        TimerRequest timerRequest = new TimerRequest();
+
+
+        timerRequest.setTimerId(reqParams.getTimerId());
+        reqParams.setTimerRequest(timerRequest);
+
+
+        String result = HttpUtil.Post(
+                "http://127.0.0.1:8888/machine-fast/serv/api/timer/deleteTimerByTimerId",
+                new Gson().toJson(reqParams)
+        );
+
+        Map msg = JSON.parseObject(result, HashMap.class);
+
+
+        assert msg != null;
+        if (msg.get("msg").equals("success")){
+
+            return Msg.ok().put("data",msg.get("data"));
+        }
+        else {
+            return Msg.error(msg.get("msg").toString());
+        }
+
+
+    }
+
+    /**
+     * 娣诲姞瀹氭椂浠诲姟
+     * */
+    @RequestMapping(value = "addTimer",method = RequestMethod.POST)
+    public Msg addTimer(@RequestBody ReqParams reqParams){
+        rateLimiter.acquire(1);
+
+        Long userId = accessService.getUserId(reqParams.getAccessToken());
+
+        if(userId == null){
+            return Msg.error("accessToken exception!!!");
+        }
+
+        reqParams.setApiKey(reqParams.getApiKey());
+        reqParams.setUserId(userId);
+
+        TimerRequest timerRequest = new TimerRequest();
+
+        timerRequest.setIds(Arrays.asList(reqParams.getStreetlightIds()));
+        timerRequest.setTimerExp(reqParams.getTimerExp());
+        timerRequest.setTimerName(reqParams.getTimerName());
+        timerRequest.setLightNumber(reqParams.getLightNumber());
+
+        reqParams.setTimerRequest(timerRequest);
+
+
+
+        String result = HttpUtil.Post(
+                "http://127.0.0.1:8888/machine-fast/serv/api/timer/addTimer",
+                new Gson().toJson(reqParams)
+        );
+
+        Map msg = JSON.parseObject(result, HashMap.class);
+
+
+        assert msg != null;
+        if (msg.get("msg").equals("success")){
+
+            return Msg.ok().put("data",msg.get("data"));
+        }
+        else {
+            return Msg.error(msg.get("msg").toString());
+        }
+
+
+    }
+
+
+    /**
+     * 淇敼瀹氭椂浠诲姟
+     * */
+    @RequestMapping(value = "updateTimer",method = RequestMethod.POST)
+    public Msg updateTimer(@RequestBody ReqParams reqParams){
+        rateLimiter.acquire(1);
+
+        Long userId = accessService.getUserId(reqParams.getAccessToken());
+
+        if(userId == null){
+            return Msg.error("accessToken exception!!!");
+        }
+
+        reqParams.setApiKey(reqParams.getApiKey());
+        reqParams.setUserId(userId);
+
+        TimerRequest timerRequest = new TimerRequest();
+
+        timerRequest.setTimerId(reqParams.getTimerId());
+        timerRequest.setIds(Arrays.asList(reqParams.getStreetlightIds()));
+        timerRequest.setTimerExp(reqParams.getTimerExp());
+        timerRequest.setTimerName(reqParams.getTimerName());
+        timerRequest.setLightNumber(reqParams.getLightNumber());
+
+        reqParams.setTimerRequest(timerRequest);
+
+
+
+        String result = HttpUtil.Post(
+                "http://127.0.0.1:8888/machine-fast/serv/api/timer/updateTimer",
+                new Gson().toJson(reqParams)
+        );
+
+        Map msg = JSON.parseObject(result, HashMap.class);
+
+
+        assert msg != null;
+        if (msg.get("msg").equals("success")){
+
+            return Msg.ok().put("data",msg.get("data"));
+        }
+        else {
+            return Msg.error(msg.get("msg").toString());
+        }
+
+
+    }
+
+
+
+}
diff --git a/src/main/java/api/controller/WeatherV2Controller.java b/src/main/java/api/controller/WeatherV2Controller.java
new file mode 100644
index 0000000..ef5e76e
--- /dev/null
+++ b/src/main/java/api/controller/WeatherV2Controller.java
@@ -0,0 +1,81 @@
+package api.controller;
+
+import api.bean.PoleSensorV2SoilVOEntity;
+import api.bean.PoleSensorV2VOEntity;
+import api.bean.ReqParams;
+import api.bean.WeatherEntity;
+import api.result.Msg;
+import api.service.AccessService;
+import api.service.WeatherService;
+import api.service.WeatherV2Service;
+import com.github.pagehelper.PageInfo;
+import com.google.common.util.concurrent.RateLimiter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+@RestController
+@RequestMapping("/weather/v2")
+public class WeatherV2Controller {
+    @Autowired
+    private AccessService accessService;
+    @Autowired
+    private WeatherV2Service weatherV2Service;
+
+    RateLimiter rateLimiter = RateLimiter.create(10.0);
+
+    @RequestMapping(value = "/list")
+    public Msg list(@RequestBody ReqParams reqParams){
+        rateLimiter.acquire(1);
+        if(reqParams.getLimit() > 200){
+            return Msg.error("limit exception!!!");
+        }
+
+        Long userId = accessService.getUserId(reqParams.getAccessToken());
+
+        if(userId == null) {
+            return Msg.error("server exception");
+        }
+
+        PageInfo<PoleSensorV2VOEntity> info = weatherV2Service.list(userId, reqParams);
+
+        Map data = new HashMap();
+
+        data.put("total",info.getTotal());
+        data.put("list",info.getList());
+
+        return Msg.ok().put("data",data);
+
+    }
+
+    @RequestMapping(value = "/soil/list")
+    public Msg soilList(@RequestBody ReqParams reqParams){
+        rateLimiter.acquire(1);
+        if(reqParams.getLimit() > 200){
+            return Msg.error("limit exception!!!");
+        }
+
+        Long userId = accessService.getUserId(reqParams.getAccessToken());
+
+        if(userId == null) {
+            return Msg.error("server exception");
+        }
+
+        PageInfo<PoleSensorV2SoilVOEntity> info = weatherV2Service.soilList(userId, reqParams);
+
+        Map data = new HashMap();
+
+        data.put("total",info.getTotal());
+        data.put("list",info.getList());
+
+        return Msg.ok().put("data",data);
+
+    }
+
+}
diff --git a/src/main/java/api/dao/AccessDao.java b/src/main/java/api/dao/AccessDao.java
index 4ed8218..c19fa9b 100644
--- a/src/main/java/api/dao/AccessDao.java
+++ b/src/main/java/api/dao/AccessDao.java
@@ -26,4 +26,6 @@
     @Select("select role_id from sys_user_role where user_id = #{userId}")
     Long selectRoleIdByUserId(@Param("userId") Long userId);
 
+    @Select("select ys7_account_id from wog_user_access where access_token = #{accessToken} limit 1")
+    String selectYs7AccountIdByAccessToken(String accessToken);
 }
diff --git a/src/main/java/api/dao/SinglelampDataDao.java b/src/main/java/api/dao/SinglelampDataDao.java
index 0441d70..b50e8e5 100644
--- a/src/main/java/api/dao/SinglelampDataDao.java
+++ b/src/main/java/api/dao/SinglelampDataDao.java
@@ -4,6 +4,7 @@
 import api.bean.SinglelampDataEntity;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -26,4 +27,7 @@
     //List<SinglelampDataEntity> selectByUserId(Long userId);
     /**鍗曚釜鐏潌鏁版嵁*/
     List<SinglelampDataEntity> selectByStreetlightId(String mac);
+
+    @Select("select count(*) from pole_streetlight ps where ps.streetlight_id in(select pus.streetlight_id from pole_user_streetlight pus where pus.company_id in(select suc.company_id from sys_user_company suc where suc.user_id=#{userId}))")
+    Integer countByCompany(@Param("userId") Long userId);
 }
diff --git a/src/main/java/api/dao/WeatherV2Dao.java b/src/main/java/api/dao/WeatherV2Dao.java
new file mode 100644
index 0000000..2b5d09a
--- /dev/null
+++ b/src/main/java/api/dao/WeatherV2Dao.java
@@ -0,0 +1,33 @@
+package api.dao;
+
+import api.bean.PoleSensorV2SoilVOEntity;
+import api.bean.PoleSensorV2VOEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 鑰曞啘 鍖楃悊宸�
+ **/
+@Mapper
+@Repository
+public interface WeatherV2Dao {
+
+    List<PoleSensorV2VOEntity> selectAll();
+
+    List<PoleSensorV2VOEntity> selectByCompany(Long userId);
+
+    List<PoleSensorV2VOEntity> selectByUserId(Long userId);
+
+    List<PoleSensorV2VOEntity> getSensorByPoleId(Long poleId);
+
+    List<PoleSensorV2SoilVOEntity> selectAllForSoil();
+
+    List<PoleSensorV2SoilVOEntity> selectByCompanyForSoil(Long userId);
+
+    List<PoleSensorV2SoilVOEntity> selectByUserIdForSoil(Long userId);
+
+
+    List<PoleSensorV2SoilVOEntity> getSensorByMac(String mac);
+}
diff --git a/src/main/java/api/service/AccessService.java b/src/main/java/api/service/AccessService.java
index fbbaa18..74c397d 100644
--- a/src/main/java/api/service/AccessService.java
+++ b/src/main/java/api/service/AccessService.java
@@ -51,7 +51,7 @@
             return Msg.error("secret mistake");
         }
 
-        if(new Date().getTime() - accessData.getUpdateTime().getTime() > OUT_EXPRESS_TIME) {
+        if(System.currentTimeMillis() - accessData.getUpdateTime().getTime() > OUT_EXPRESS_TIME) {
 
             accessData.setAccessToken(UUID.randomUUID().toString());
             accessData.setUpdateTime(new Date());
@@ -61,4 +61,13 @@
         }
         return Msg.ok().put("accessToken",accessData.getAccessToken());
     }
+
+
+    public String getYs7AccountId(String accessKey) {
+
+        String ys7AccountId
+                = accessDao.selectYs7AccountIdByAccessToken(accessKey);
+
+        return ys7AccountId;
+    }
 }
diff --git a/src/main/java/api/service/SinglelampDataServer.java b/src/main/java/api/service/SinglelampDataServer.java
index 8370a73..7e5ae13 100644
--- a/src/main/java/api/service/SinglelampDataServer.java
+++ b/src/main/java/api/service/SinglelampDataServer.java
@@ -3,6 +3,7 @@
 import api.bean.ReqParams;
 import api.bean.SinglelampDataEntity;
 import api.dao.SinglelampDataDao;
+import cn.hutool.core.collection.ListUtil;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,21 +28,41 @@
     public PageInfo<SinglelampDataEntity> selectList(Long userId, ReqParams reqParams) {
         Long roleId = accessService.getRoleId(userId);
 
-        if(roleId == null || roleId == 0){
+        if (roleId == null || roleId == 0) {
             return null;
         }
 
         List<SinglelampDataEntity> list = null;
 
-        if(roleId.longValue() == 1 ){
-            PageHelper.startPage(reqParams.getPage(),reqParams.getLimit());
+        Integer count = null;
+        if (roleId.longValue() == 1) {
+            PageHelper.startPage(reqParams.getPage(), reqParams.getLimit());
             list = singlelampDao.selectAll();
-        }else if (roleId.longValue() == 2 || roleId.longValue() == 3){
-           PageHelper.startPage(reqParams.getPage(),reqParams.getLimit());
-            list = singlelampDao.selectByCompany(reqParams.getPage(),reqParams.getLimit(),userId);
+        } else if (roleId.longValue() == 2 || roleId.longValue() == 3) {
+            count = singlelampDao.countByCompany(userId);
+            list = singlelampDao.selectByCompany(1, count, userId);
 
         }
-        PageInfo<SinglelampDataEntity> page = new PageInfo<>(list);
+        Integer listLimit = reqParams.getLimit();
+        Integer listPage = reqParams.getPage();
+
+        if ((listLimit > listPage * listLimit)
+            || listLimit < listPage){
+            listLimit = count;
+        }
+
+        List<SinglelampDataEntity> pageList =
+                ListUtil.sortByProperty(list,"streetlightId");
+
+        List<SinglelampDataEntity> finalList =
+                ListUtil.page(listPage-1, listLimit, pageList);
+
+        PageInfo<SinglelampDataEntity> page = new PageInfo<>(finalList);
+
+
+        page.setStartRow(list.size());
+        page.setEndRow(count);
+
         return page;
 
     }
diff --git a/src/main/java/api/service/WeatherV2Service.java b/src/main/java/api/service/WeatherV2Service.java
new file mode 100644
index 0000000..0606ebf
--- /dev/null
+++ b/src/main/java/api/service/WeatherV2Service.java
@@ -0,0 +1,101 @@
+package api.service;
+
+import api.bean.PoleSensorV2SoilVOEntity;
+import api.bean.PoleSensorV2VOEntity;
+import api.bean.ReqParams;
+import api.bean.WeatherEntity;
+import api.dao.WeatherDao;
+import api.dao.WeatherV2Dao;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 鑰曞啘 鍖楃悊宸�
+ **/
+@Service
+public class WeatherV2Service {
+    @Autowired
+    private AccessService accessService;
+    @Autowired
+    private WeatherV2Dao weatherV2Dao;
+    public PageInfo<PoleSensorV2VOEntity> list(Long userId, ReqParams reqParams) {
+        Long roleId = accessService.getRoleId(userId);
+
+        if (roleId == null || roleId == 0) {
+            return null;
+        }
+
+        List<PoleSensorV2VOEntity> list = null;
+
+        Long poleId = reqParams.getLightId();
+
+        if(null == poleId || poleId.equals("")){
+
+            if (roleId.longValue() == 1) {
+                PageHelper.startPage(reqParams.getPage(), reqParams.getLimit());
+                list = weatherV2Dao.selectAll();
+            } else if (roleId.longValue() == 2) {
+                PageHelper.startPage(reqParams.getPage(), reqParams.getLimit());
+                list = weatherV2Dao.selectByCompany(userId);
+            } else if (roleId.longValue() == 3) {
+                PageHelper.startPage(reqParams.getPage(), reqParams.getLimit());
+                list = weatherV2Dao.selectByUserId(userId);
+            }
+
+
+
+        }else {
+            PageHelper.startPage(reqParams.getPage(), reqParams.getLimit());
+
+            list = weatherV2Dao.getSensorByPoleId(poleId);
+        }
+
+
+        PageInfo<PoleSensorV2VOEntity> page = new PageInfo<>(list);
+        return page;
+
+}
+
+
+    public PageInfo<PoleSensorV2SoilVOEntity> soilList(Long userId, ReqParams reqParams) {
+        Long roleId = accessService.getRoleId(userId);
+
+        if (roleId == null || roleId == 0) {
+            return null;
+        }
+
+        List<PoleSensorV2SoilVOEntity> list = null;
+
+        String mac = reqParams.getMac();
+
+        if(null == mac || mac.equals("")){
+
+            if (roleId.longValue() == 1) {
+                PageHelper.startPage(reqParams.getPage(), reqParams.getLimit());
+                list = weatherV2Dao.selectAllForSoil();
+            } else if (roleId.longValue() == 2) {
+                PageHelper.startPage(reqParams.getPage(), reqParams.getLimit());
+                list = weatherV2Dao.selectByCompanyForSoil(userId);
+            } else if (roleId.longValue() == 3) {
+                PageHelper.startPage(reqParams.getPage(), reqParams.getLimit());
+                list = weatherV2Dao.selectByUserIdForSoil(userId);
+            }
+
+
+
+        }else {
+            PageHelper.startPage(reqParams.getPage(), reqParams.getLimit());
+
+            list = weatherV2Dao.getSensorByMac(mac);
+        }
+
+
+        PageInfo<PoleSensorV2SoilVOEntity> page = new PageInfo<>(list);
+        return page;
+
+    }
+}
diff --git a/src/main/java/api/utils/httpClient.java b/src/main/java/api/utils/httpClient.java
deleted file mode 100644
index 3ff2ae1..0000000
--- a/src/main/java/api/utils/httpClient.java
+++ /dev/null
@@ -1,144 +0,0 @@
-package api.utils;
-
-import org.apache.http.HttpEntity;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.util.EntityUtils;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.*;
-import java.util.Map.Entry;
-
-/**
- * @program: api
- * @description:
- * @author: YSS
- * @create: 2020-09-03 14:13
- **/
-public class httpClient {
-
-
-        public static String doGet(String url) {
-            CloseableHttpClient httpClient = null;
-            CloseableHttpResponse response = null;
-            String result = "";
-            try {
-                // 閫氳繃鍧�榛樿閰嶇疆鍒涘缓涓�涓猦ttpClient瀹炰緥
-                httpClient = HttpClients.createDefault();
-                // 鍒涘缓httpGet杩滅▼杩炴帴瀹炰緥
-                HttpGet httpGet = new HttpGet(url);
-                // 璁剧疆璇锋眰澶翠俊鎭紝閴存潈
-                httpGet.setHeader("Authorization", "Bearer da3efcbf-0845-4fe3-8aba-ee040be542c0");
-                // 璁剧疆閰嶇疆璇锋眰鍙傛暟
-                RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000)// 杩炴帴涓绘満鏈嶅姟瓒呮椂鏃堕棿
-                        .setConnectionRequestTimeout(35000)// 璇锋眰瓒呮椂鏃堕棿
-                        .setSocketTimeout(60000)// 鏁版嵁璇诲彇瓒呮椂鏃堕棿
-                        .build();
-                // 涓篽ttpGet瀹炰緥璁剧疆閰嶇疆
-                httpGet.setConfig(requestConfig);
-                // 鎵цget璇锋眰寰楀埌杩斿洖瀵硅薄
-                response = httpClient.execute(httpGet);
-                // 閫氳繃杩斿洖瀵硅薄鑾峰彇杩斿洖鏁版嵁
-                HttpEntity entity = response.getEntity();
-                // 閫氳繃EntityUtils涓殑toString鏂规硶灏嗙粨鏋滆浆鎹负瀛楃涓�
-                result = EntityUtils.toString(entity);
-            } catch (ClientProtocolException e) {
-                e.printStackTrace();
-            } catch (IOException e) {
-                e.printStackTrace();
-            } finally {
-                // 鍏抽棴璧勬簮
-                if (null != response) {
-                    try {
-                        response.close();
-                    } catch (IOException e) {
-                        e.printStackTrace();
-                    }
-                }
-                if (null != httpClient) {
-                    try {
-                        httpClient.close();
-                    } catch (IOException e) {
-                        e.printStackTrace();
-                    }
-                }
-            }
-            return result;
-        }
-
-        public static String doPost(String url, Map<String, Object> paramMap) {
-            CloseableHttpClient httpClient = null;
-            CloseableHttpResponse httpResponse = null;
-            String result = "";
-            // 鍒涘缓httpClient瀹炰緥
-            httpClient = HttpClients.createDefault();
-            // 鍒涘缓httpPost杩滅▼杩炴帴瀹炰緥
-            HttpPost httpPost = new HttpPost(url);
-            // 閰嶇疆璇锋眰鍙傛暟瀹炰緥
-            RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000)// 璁剧疆杩炴帴涓绘満鏈嶅姟瓒呮椂鏃堕棿
-                    .setConnectionRequestTimeout(35000)// 璁剧疆杩炴帴璇锋眰瓒呮椂鏃堕棿
-                    .setSocketTimeout(60000)// 璁剧疆璇诲彇鏁版嵁杩炴帴瓒呮椂鏃堕棿
-                    .build();
-            // 涓篽ttpPost瀹炰緥璁剧疆閰嶇疆
-            httpPost.setConfig(requestConfig);
-            // 璁剧疆璇锋眰澶�
-            httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded");
-            // 灏佽post璇锋眰鍙傛暟
-            if (null != paramMap && paramMap.size() > 0) {
-                List<NameValuePair> nvps = new ArrayList<NameValuePair>();
-                // 閫氳繃map闆嗘垚entrySet鏂规硶鑾峰彇entity
-                Set<Entry<String, Object>> entrySet = paramMap.entrySet();
-                // 寰幆閬嶅巻锛岃幏鍙栬凯浠e櫒
-                Iterator<Entry<String, Object>> iterator = entrySet.iterator();
-                while (iterator.hasNext()) {
-                    Entry<String, Object> mapEntry = iterator.next();
-                    nvps.add(new BasicNameValuePair(mapEntry.getKey(), mapEntry.getValue().toString()));
-                }
-
-                // 涓篽ttpPost璁剧疆灏佽濂界殑璇锋眰鍙傛暟
-                try {
-                    httpPost.setEntity(new UrlEncodedFormEntity(nvps, "UTF-8"));
-                } catch (UnsupportedEncodingException e) {
-                    e.printStackTrace();
-                }
-            }
-            try {
-                // httpClient瀵硅薄鎵цpost璇锋眰,骞惰繑鍥炲搷搴斿弬鏁板璞�
-                httpResponse = httpClient.execute(httpPost);
-                // 浠庡搷搴斿璞′腑鑾峰彇鍝嶅簲鍐呭
-                HttpEntity entity = httpResponse.getEntity();
-                result = EntityUtils.toString(entity);
-            } catch (ClientProtocolException e) {
-                e.printStackTrace();
-            } catch (IOException e) {
-                e.printStackTrace();
-            } finally {
-                // 鍏抽棴璧勬簮
-                if (null != httpResponse) {
-                    try {
-                        httpResponse.close();
-                    } catch (IOException e) {
-                        e.printStackTrace();
-                    }
-                }
-                if (null != httpClient) {
-                    try {
-                        httpClient.close();
-                    } catch (IOException e) {
-                        e.printStackTrace();
-                    }
-                }
-            }
-            return result;
-        }
-
-}
diff --git a/src/main/resources/mapper/PoleSinglelampDataMapper.xml b/src/main/resources/mapper/PoleSinglelampDataMapper.xml
index cae20f4..f810ede 100644
--- a/src/main/resources/mapper/PoleSinglelampDataMapper.xml
+++ b/src/main/resources/mapper/PoleSinglelampDataMapper.xml
@@ -71,4 +71,6 @@
             psd.singlelamp_data_id DESC
     </select>
 
+
+
 </mapper>
diff --git a/src/main/resources/mapper/WeatherV2Dao.xml b/src/main/resources/mapper/WeatherV2Dao.xml
new file mode 100644
index 0000000..b294fe1
--- /dev/null
+++ b/src/main/resources/mapper/WeatherV2Dao.xml
@@ -0,0 +1,257 @@
+<?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="api.dao.WeatherV2Dao">
+
+
+    <select id="selectAll" resultType="api.bean.PoleSensorV2VOEntity">
+
+        SELECT
+            p1.streetlight_name,p1.link_method,
+            p2.*
+        FROM
+            pole_streetlight p1
+                LEFT JOIN pole_sensor_v2 p2 ON p1.streetlight_id = p2.streetlight_id
+        WHERE
+                id IN (
+                SELECT
+                    max(id)
+                FROM
+                    pole_sensor_v2
+                GROUP BY
+                    streetlight_id
+            )
+    </select>
+
+
+
+    <select id="selectByCompany" resultType="api.bean.PoleSensorV2VOEntity" parameterType="java.lang.Long">
+        SELECT
+            p1.streetlight_name,p1.link_method,
+            p2.*
+        FROM
+            pole_streetlight p1
+                LEFT JOIN pole_sensor_v2 p2 ON p1.streetlight_id = p2.streetlight_id
+        WHERE
+                id IN (
+                SELECT
+                    max(id)
+                FROM
+                    pole_sensor_v2
+                WHERE
+                        streetlight_id IN (
+                        SELECT
+                            streetlight_id
+                        FROM
+                            pole_user_streetlight
+                        WHERE
+                                company_id = (
+                                SELECT
+                                    company_id
+                                FROM
+                                    sys_user_company
+                                WHERE
+                                    user_id = #{userId}
+                            )
+                    )
+                GROUP BY
+                    streetlight_id
+            )
+
+    </select>
+
+    <select id="selectByUserId" resultType="api.bean.PoleSensorV2VOEntity" parameterType="java.lang.Long">
+        SELECT
+            p1.streetlight_name,p1.link_method,
+            p2.*
+        FROM
+            pole_streetlight p1
+                LEFT JOIN pole_sensor_v2 p2 ON p1.streetlight_id = p2.streetlight_id
+        WHERE
+                id IN (
+                SELECT
+                    max(id)
+                FROM
+                    pole_sensor_v2
+                WHERE
+                        streetlight_id IN (
+                        SELECT
+                            streetlight_id
+                        FROM
+                            pole_user_streetlight
+                        WHERE
+                            user_id = #{userId}
+                    )
+                GROUP BY
+                    streetlight_id
+            )
+
+    </select>
+    <select id="getSensorByPoleId" resultType="api.bean.PoleSensorV2VOEntity" parameterType="java.lang.Long">
+        SELECT
+            p1.streetlight_name,p1.link_method,
+            p2.*
+        FROM
+            pole_streetlight p1
+                LEFT JOIN pole_sensor_v2 p2 ON p1.streetlight_id = p2.streetlight_id
+        WHERE
+                id IN (
+                SELECT
+                    id
+                FROM
+                    pole_sensor_v2
+                WHERE
+                    streetlight_id = #{poleId}
+            )
+        ORDER BY
+            create_time DESC
+    </select>
+
+
+    <!--
+
+
+
+
+
+
+
+
+
+    鍦熷¥
+
+
+
+
+
+
+
+
+
+
+    -->
+    <select id="selectAllForSoil" resultType="api.bean.PoleSensorV2SoilVOEntity">
+        select *
+        from
+            pole_sensor_v2_soil psvs
+                join(
+                select
+                    max(id) as id
+                from
+                    pole_sensor_v2_soil
+                group by
+                    mac
+            ) maxid
+                    on psvs.id  = maxid.id
+                        and psvs.device_type = '51'
+
+                join pole_streetlight  ps on ps.code_number = psvs.mac
+        order by psvs.id desc
+
+    </select>
+
+    <select id="selectByCompanyForSoil" resultType="api.bean.PoleSensorV2SoilVOEntity"
+            parameterType="java.lang.Long">
+        select
+            *
+        from
+            pole_sensor_v2_soil psvs
+                join(
+                select
+                    max(id) as id
+                from
+                    pole_sensor_v2_soil
+                group by
+                    mac
+            ) maxid
+                    on
+                                psvs.id = maxid.id
+                            and psvs.device_type = '51'
+                            and mac in (
+                            select
+                                ps.code_number
+                            from
+                                pole_streetlight ps
+                            where
+                                    ps.streetlight_id in (
+                                    select
+                                        pus.streetlight_id
+                                    from
+                                        pole_user_streetlight pus
+                                    where
+                                            pus.company_id in(
+                                            select
+                                                suc.company_id
+                                            from
+                                                sys_user_company suc
+                                            where
+                                                    suc.user_id =
+                                                    #{userId}
+                                        )
+                                )
+                        )
+                join pole_streetlight ps on
+                ps.code_number = psvs.mac
+        order by
+            psvs.id desc
+
+    </select>
+    <select id="selectByUserIdForSoil" resultType="api.bean.PoleSensorV2SoilVOEntity"
+            parameterType="java.lang.Long">
+
+        select
+            *
+        from
+            pole_sensor_v2_soil psvs
+                join(
+                select
+                    max(id) as id
+                from
+                    pole_sensor_v2_soil
+                group by
+                    mac
+            ) maxid
+                    on
+                                psvs.id = maxid.id
+                            and psvs.device_type = '51'
+                            and mac in (
+                            select
+                                ps.code_number
+                            from
+                                pole_streetlight ps
+                            where
+                                    ps.streetlight_id in (
+                                    select
+                                        pus.streetlight_id
+                                    from
+                                        pole_user_streetlight pus
+                                    where
+                                            pus.company_id in(
+                                            select
+                                                suc.company_id
+                                            from
+                                                sys_user_company suc
+                                            where
+                                                    suc.user_id =
+                                                    #{userId}
+                                        )
+                                )
+                        )
+                join pole_streetlight ps on
+                ps.code_number = psvs.mac
+        order by
+            psvs.id desc
+    </select>
+
+    <select id="getSensorByMac" resultType="api.bean.PoleSensorV2SoilVOEntity"
+            parameterType="java.lang.String">
+        select *
+        from
+            pole_sensor_v2_soil psvs
+                join pole_streetlight  ps on ps.code_number = psvs.mac
+        where device_type  = '51'
+          and mac = #{mac}
+        order by psvs.id desc
+
+
+    </select>
+</mapper>
diff --git a/target/api-1.0-SNAPSHOT.jar.original b/target/api-1.0-SNAPSHOT.jar.original
index bf473bc..ca966c3 100644
--- a/target/api-1.0-SNAPSHOT.jar.original
+++ b/target/api-1.0-SNAPSHOT.jar.original
Binary files differ
diff --git a/target/classes/mapper/PoleSinglelampDataMapper.xml b/target/classes/mapper/PoleSinglelampDataMapper.xml
index cae20f4..f810ede 100644
--- a/target/classes/mapper/PoleSinglelampDataMapper.xml
+++ b/target/classes/mapper/PoleSinglelampDataMapper.xml
@@ -71,4 +71,6 @@
             psd.singlelamp_data_id DESC
     </select>
 
+
+
 </mapper>
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
index abb2cf1..d206bc1 100644
--- a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
+++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
@@ -2,22 +2,29 @@
 api\service\PoleService.class
 api\bean\SinglelampDataEntity.class
 api\controller\PoleController.class
+api\dao\WeatherV2Dao.class
 api\service\WeatherService.class
-api\utils\httpClient.class
 api\bean\PoleLightBatchEntity.class
+api\bean\TimerRequest.class
 api\bean\ReqParams.class
 api\service\SinglelampDataServer.class
+api\controller\CameraController.class
+api\service\WeatherV2Service.class
 api\utils\HttpUtil.class
 api\controller\WeatherController.class
 api\controller\SinglelampDataController.class
 api\dao\SinglelampDataDao.class
+api\bean\PoleSensorV2VOEntity.class
+api\controller\TimerController.class
 api\dao\AccessDao.class
 api\service\AccessService.class
+api\bean\PoleSensorV2SoilVOEntity.class
 api\bean\LampEntity.class
 api\result\Msg.class
 api\bean\AccessEntity.class
 api\utils\CommonHeader.class
 api\APIApplication.class
 api\dao\WeatherDao.class
+api\controller\WeatherV2Controller.class
 api\bean\WeatherEntity.class
 api\controller\AccessController.class
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
index 3ac34f1..5f6597d 100644
--- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
+++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -1,23 +1,30 @@
-D:\Coding\api\src\main\java\api\dao\SinglelampDataDao.java
 D:\Coding\api\src\main\java\api\service\WeatherService.java
-D:\Coding\api\src\main\java\api\bean\AccessEntity.java
-D:\Coding\api\src\main\java\api\service\AccessService.java
-D:\Coding\api\src\main\java\api\bean\ReqParams.java
 D:\Coding\api\src\main\java\api\controller\PoleController.java
 D:\Coding\api\src\main\java\api\service\PoleService.java
+D:\Coding\api\src\main\java\api\service\WeatherV2Service.java
 D:\Coding\api\src\main\java\api\service\SinglelampDataServer.java
-D:\Coding\api\src\main\java\api\utils\httpClient.java
-D:\Coding\api\src\main\java\api\utils\HttpUtil.java
+D:\Coding\api\src\main\java\api\bean\TimerRequest.java
 D:\Coding\api\src\main\java\api\controller\SinglelampDataController.java
+D:\Coding\api\src\main\java\api\dao\AccessDao.java
+D:\Coding\api\src\main\java\api\controller\AccessController.java
+D:\Coding\api\src\main\java\api\bean\LampEntity.java
+D:\Coding\api\src\main\java\api\dao\LampDao.java
+D:\Coding\api\src\main\java\api\bean\PoleSensorV2SoilVOEntity.java
+D:\Coding\api\src\main\java\api\dao\SinglelampDataDao.java
+D:\Coding\api\src\main\java\api\bean\AccessEntity.java
+D:\Coding\api\src\main\java\api\service\AccessService.java
+D:\Coding\api\src\main\java\api\dao\WeatherV2Dao.java
+D:\Coding\api\src\main\java\api\bean\ReqParams.java
+D:\Coding\api\src\main\java\api\utils\HttpUtil.java
+D:\Coding\api\src\main\java\api\controller\TimerController.java
+D:\Coding\api\src\main\java\api\bean\PoleSensorV2VOEntity.java
 D:\Coding\api\src\main\java\api\dao\WeatherDao.java
 D:\Coding\api\src\main\java\api\bean\SinglelampDataEntity.java
 D:\Coding\api\src\main\java\api\bean\WeatherEntity.java
 D:\Coding\api\src\main\java\api\bean\PoleLightBatchEntity.java
-D:\Coding\api\src\main\java\api\dao\AccessDao.java
+D:\Coding\api\src\main\java\api\controller\CameraController.java
+D:\Coding\api\src\main\java\api\controller\WeatherV2Controller.java
 D:\Coding\api\src\main\java\api\result\Msg.java
 D:\Coding\api\src\main\java\api\utils\CommonHeader.java
-D:\Coding\api\src\main\java\api\controller\AccessController.java
-D:\Coding\api\src\main\java\api\bean\LampEntity.java
 D:\Coding\api\src\main\java\api\controller\WeatherController.java
-D:\Coding\api\src\main\java\api\dao\LampDao.java
 D:\Coding\api\src\main\java\api\APIApplication.java

--
Gitblit v1.9.3