浏览代码

基础搭建添加

523096025 3 年之前
父节点
当前提交
9bbf013d23
共有 17 个文件被更改,包括 602 次插入10 次删除
  1. 32 0
      beeboxs/src/main/java/com/huimv/beeboxs/controller/HiveBaseBeehiveController.java
  2. 37 0
      beeboxs/src/main/java/com/huimv/beeboxs/controller/HiveBaseStationController.java
  3. 33 0
      beeboxs/src/main/java/com/huimv/beeboxs/controller/HiveBeehiveOutController.java
  4. 1 1
      beeboxs/src/main/java/com/huimv/beeboxs/entity/BaseHiveFarm.java
  5. 34 0
      beeboxs/src/main/java/com/huimv/beeboxs/entity/HiveBaseBeehive.java
  6. 10 1
      beeboxs/src/main/java/com/huimv/beeboxs/entity/HiveBaseStation.java
  7. 102 0
      beeboxs/src/main/java/com/huimv/beeboxs/entity/HiveBeehiveOut.java
  8. 74 0
      beeboxs/src/main/java/com/huimv/beeboxs/entity/dto/HiveBaseBeeStationDao.java
  9. 61 0
      beeboxs/src/main/java/com/huimv/beeboxs/entity/vo/HiveBaseStationVo.java
  10. 16 0
      beeboxs/src/main/java/com/huimv/beeboxs/mapper/HiveBeehiveOutMapper.java
  11. 2 0
      beeboxs/src/main/java/com/huimv/beeboxs/service/IHiveBaseBeehiveService.java
  12. 4 0
      beeboxs/src/main/java/com/huimv/beeboxs/service/IHiveBaseStationService.java
  13. 20 0
      beeboxs/src/main/java/com/huimv/beeboxs/service/IHiveBeehiveOutService.java
  14. 28 6
      beeboxs/src/main/java/com/huimv/beeboxs/service/impl/HiveBaseBeehiveServiceImpl.java
  15. 80 2
      beeboxs/src/main/java/com/huimv/beeboxs/service/impl/HiveBaseStationServiceImpl.java
  16. 44 0
      beeboxs/src/main/java/com/huimv/beeboxs/service/impl/HiveBeehiveOutServiceImpl.java
  17. 24 0
      beeboxs/src/main/resources/mapper/HiveBeehiveOutMapper.xml

+ 32 - 0
beeboxs/src/main/java/com/huimv/beeboxs/controller/HiveBaseBeehiveController.java

@@ -1,11 +1,19 @@
 package com.huimv.beeboxs.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.huimv.beeboxs.common.utils.Result;
+import com.huimv.beeboxs.entity.HiveBaseBeehive;
+import com.huimv.beeboxs.entity.HiveBaseStation;
+import com.huimv.beeboxs.entity.vo.HiveBaseStationVo;
 import com.huimv.beeboxs.service.IHiveBaseBeehiveService;
+import com.huimv.beeboxs.service.IHiveBaseStationService;
+import com.huimv.beeboxs.service.IHiveBeehiveService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
 import java.util.Map;
 
 /**
@@ -22,6 +30,8 @@ import java.util.Map;
 public class HiveBaseBeehiveController {
     @Autowired
     private IHiveBaseBeehiveService baseBeehiveService;
+    @Autowired
+    private IHiveBaseStationService baseStationService;
 
     @PostMapping("/list")
     public Result page(@RequestBody Map map){
@@ -29,4 +39,26 @@ public class HiveBaseBeehiveController {
         return baseBeehiveService.searchList(map);
     }
 
+
+    @PostMapping("/update")
+    public Result update(@RequestBody HiveBaseBeehive hiveBaseBeehive){
+        hiveBaseBeehive.setBindingDate(new Date());
+
+
+        HiveBaseStation hex = baseStationService.getOne(new QueryWrapper<HiveBaseStation>().eq("ap_uid_hex", hiveBaseBeehive.getApUidHex()));
+
+        hiveBaseBeehive.setFarmId(hex.getFarmId());
+        hiveBaseBeehive.setApName(hex.getApName());
+        baseBeehiveService.updateById(hiveBaseBeehive);
+        return new Result(10000,"绑定成功",true);
+    }
+
+    @PostMapping("/listAll")
+    public Result listAll(@RequestBody Map map){
+
+        return baseBeehiveService.listAll(map);
+    }
+
+
+
 }

+ 37 - 0
beeboxs/src/main/java/com/huimv/beeboxs/controller/HiveBaseStationController.java

@@ -1,12 +1,18 @@
 package com.huimv.beeboxs.controller;
 
 
+import com.baomidou.mybatisplus.extension.api.R;
 import com.huimv.beeboxs.common.utils.Result;
+import com.huimv.beeboxs.common.utils.ResultCode;
+import com.huimv.beeboxs.entity.HiveBaseStation;
+import com.huimv.beeboxs.entity.vo.HiveBaseStationVo;
+import com.huimv.beeboxs.service.IBaseHiveFarmService;
 import com.huimv.beeboxs.service.IHiveBaseBeehiveService;
 import com.huimv.beeboxs.service.IHiveBaseStationService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.Map;
 
 /**
@@ -25,10 +31,41 @@ public class HiveBaseStationController {
     @Autowired
     private IHiveBaseStationService baseStationService;
 
+    @Autowired
+    private IBaseHiveFarmService baseHiveFarmService;
+
     @PostMapping("/list")
     public Result page(@RequestBody Map map){
 
         return baseStationService.searchList(map);
     }
 
+    @PostMapping("/listCount")
+    public Result listCount(@RequestBody Map map){
+
+        return baseStationService.listCount(map);
+    }
+
+
+    @PostMapping("/listAll")
+    public Result listAll(@RequestBody Map map){
+
+        return baseStationService.listAll(map);
+    }
+
+    @PostMapping("/update")
+    public Result update(@RequestBody HiveBaseStationVo hiveBaseStationVo){
+
+        HiveBaseStation hiveBaseStation = new HiveBaseStation();
+        hiveBaseStation.setId(hiveBaseStationVo.getId());
+        Integer farmIds = hiveBaseStationVo.getFarmIds();
+        String farmName = baseHiveFarmService.getById(farmIds).getFarmName();
+        hiveBaseStation.setFarmId(farmIds);
+        hiveBaseStation.setFarmName(farmName);
+        hiveBaseStation.setBindingDate(new Date());
+        baseStationService.updateById(hiveBaseStation);
+        return new Result(10000,"绑定成功",true);
+    }
+
+
 }

+ 33 - 0
beeboxs/src/main/java/com/huimv/beeboxs/controller/HiveBeehiveOutController.java

@@ -0,0 +1,33 @@
+package com.huimv.beeboxs.controller;
+
+
+import com.huimv.beeboxs.common.utils.Result;
+import com.huimv.beeboxs.service.IHiveBaseBeehiveService;
+import com.huimv.beeboxs.service.IHiveBeehiveOutService;
+import com.huimv.beeboxs.service.IHiveBeehiveService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2022-04-22
+ */
+@RestController
+@CrossOrigin
+@RequestMapping("/hiveBeehiveOut")
+public class HiveBeehiveOutController {
+    @Autowired
+    private IHiveBeehiveOutService beehiveService;
+
+    @PostMapping("/list")
+    public Result page(@RequestBody Map map){
+
+        return beehiveService.searchList(map);
+    }
+}

+ 1 - 1
beeboxs/src/main/java/com/huimv/beeboxs/entity/BaseHiveFarm.java

@@ -33,7 +33,7 @@ public class BaseHiveFarm implements Serializable {
 
     private String frontLocation;
 
-    private String rowStatus;
+    private Boolean rowStatus;
 
 
 }

+ 34 - 0
beeboxs/src/main/java/com/huimv/beeboxs/entity/HiveBaseBeehive.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import java.io.Serializable;
+import java.util.Date;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
@@ -90,5 +91,38 @@ public class HiveBaseBeehive implements Serializable {
      */
     private Integer rssi;
 
+    /**
+     * 牧场
+     */
+    private Integer farmId;
+
+    /**
+     * 室内温度
+     */
+    private String indoorTem;
 
+    /**
+     *  室内湿度
+     */
+    private String indoorHum;
+
+
+    /**
+     *  室外温度
+     */
+    private String outdoorTem;
+
+    /**
+     *  室外湿度
+     */
+    private String outdoorHum;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date bindingDate;
+
+
+    /**
+     *  基站名字
+     */
+    private String apName;
 }

+ 10 - 1
beeboxs/src/main/java/com/huimv/beeboxs/entity/HiveBaseStation.java

@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import java.io.Serializable;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -78,8 +81,14 @@ public class HiveBaseStation implements Serializable {
     /**
      * 牧场id
      */
-    private String farmId;
+    private Integer farmId;
 
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date bindingDate;
 
+    /**
+     * 牧场id
+     */
+    private String farmName;
 
 }

+ 102 - 0
beeboxs/src/main/java/com/huimv/beeboxs/entity/HiveBeehiveOut.java

@@ -0,0 +1,102 @@
+package com.huimv.beeboxs.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2022-04-22
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("hive_beehive_out")
+public class HiveBeehiveOut implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 传感器 ID
+     */
+    private String hiveId;
+
+    /**
+     * 基站ID
+     */
+    private String stationId;
+
+    /**
+     * 蜂箱编码
+     */
+    private String hiveCode;
+
+    /**
+     * 网络状态
+     */
+    private Integer netStatus;
+
+    /**
+     * 电量
+     */
+    private String bat;
+
+    /**
+     * 信号强度
+     */
+    private String rssi;
+
+    /**
+     * 状态
+     */
+    private Integer beeStatus;
+
+    /**
+     * 温度
+     */
+    private String temp;
+
+    /**
+     * 湿度
+     */
+    private String humi;
+
+    /**
+     * 上传时间
+     */
+    private LocalDateTime uploadTime;
+
+    /**
+     * 拓展字段 1
+     */
+    private String other1;
+
+    /**
+     * 拓展字段 2
+     */
+    private String other2;
+
+    /**
+     * 日期
+     */
+    private LocalDateTime createDate;
+
+    /**
+     * 牧场id
+     */
+    private Integer farmId;
+
+
+}

+ 74 - 0
beeboxs/src/main/java/com/huimv/beeboxs/entity/dto/HiveBaseBeeStationDao.java

@@ -0,0 +1,74 @@
+package com.huimv.beeboxs.entity.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class HiveBaseBeeStationDao {
+    private Integer id;
+
+    /**
+     * 网关 ID
+     */
+    private String apUidHex;
+
+    /**
+     * 网关型号
+     */
+    private String model;
+
+    /**
+     * 网关别名
+     */
+    private String apName;
+
+    /**
+     * 0-表示在线;1-表示离线
+     */
+    private Integer apState;
+
+    /**
+     * 1-仓库内;2-室内;3车载;4-出入库闸门;5-电子围栏;6-便携手持;
+     0-其他
+     */
+    private Integer purpose;
+
+    /**
+     * 网关经度
+     */
+    private String latitude;
+
+    /**
+     * 网关纬度
+     */
+    private String longitude;
+
+    /**
+     * 环境温度
+     */
+    private String envTem;
+
+
+    /**
+     * 环境湿度
+     */
+    private String envHum;
+
+
+    /**
+     * 牧场id
+     */
+    private Integer farmId;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date bindingDate;
+
+    private Integer beeBoxNum;
+
+    private Integer onBeeBoxNum;
+
+    private Integer offBeeBoxNum;
+
+}

+ 61 - 0
beeboxs/src/main/java/com/huimv/beeboxs/entity/vo/HiveBaseStationVo.java

@@ -0,0 +1,61 @@
+package com.huimv.beeboxs.entity.vo;
+
+import lombok.Data;
+
+@Data
+public class HiveBaseStationVo {
+    private Integer id;
+
+    /**
+     * 网关 ID
+     */
+    private String apUidHex;
+
+    /**
+     * 网关型号
+     */
+    private String model;
+
+    /**
+     * 网关别名
+     */
+    private String apName;
+
+    /**
+     * 0-表示在线;1-表示离线
+     */
+    private Integer apState;
+
+    /**
+     * 1-仓库内;2-室内;3车载;4-出入库闸门;5-电子围栏;6-便携手持;
+     0-其他
+     */
+    private Integer purpose;
+
+    /**
+     * 网关经度
+     */
+    private String latitude;
+
+    /**
+     * 网关纬度
+     */
+    private String longitude;
+
+    /**
+     * 环境温度
+     */
+    private String envTem;
+
+
+    /**
+     * 环境湿度
+     */
+    private String envHum;
+
+
+    /**
+     * 牧场id
+     */
+    private Integer farmIds;
+}

+ 16 - 0
beeboxs/src/main/java/com/huimv/beeboxs/mapper/HiveBeehiveOutMapper.java

@@ -0,0 +1,16 @@
+package com.huimv.beeboxs.mapper;
+
+import com.huimv.beeboxs.entity.HiveBeehiveOut;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author author
+ * @since 2022-04-22
+ */
+public interface HiveBeehiveOutMapper extends BaseMapper<HiveBeehiveOut> {
+
+}

+ 2 - 0
beeboxs/src/main/java/com/huimv/beeboxs/service/IHiveBaseBeehiveService.java

@@ -17,4 +17,6 @@ import java.util.Map;
 public interface IHiveBaseBeehiveService extends IService<HiveBaseBeehive> {
 
     Result searchList(Map map);
+
+    Result listAll(Map map);
 }

+ 4 - 0
beeboxs/src/main/java/com/huimv/beeboxs/service/IHiveBaseStationService.java

@@ -17,4 +17,8 @@ import java.util.Map;
 public interface IHiveBaseStationService extends IService<HiveBaseStation> {
 
     Result searchList(Map map);
+
+    Result listAll(Map map);
+
+    Result listCount(Map map);
 }

+ 20 - 0
beeboxs/src/main/java/com/huimv/beeboxs/service/IHiveBeehiveOutService.java

@@ -0,0 +1,20 @@
+package com.huimv.beeboxs.service;
+
+import com.huimv.beeboxs.common.utils.Result;
+import com.huimv.beeboxs.entity.HiveBeehiveOut;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Map;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author author
+ * @since 2022-04-22
+ */
+public interface IHiveBeehiveOutService extends IService<HiveBeehiveOut> {
+
+    Result searchList(Map map);
+}

+ 28 - 6
beeboxs/src/main/java/com/huimv/beeboxs/service/impl/HiveBaseBeehiveServiceImpl.java

@@ -1,5 +1,7 @@
 package com.huimv.beeboxs.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.huimv.beeboxs.common.utils.Result;
 import com.huimv.beeboxs.common.utils.ResultCode;
@@ -28,6 +30,31 @@ public class HiveBaseBeehiveServiceImpl extends ServiceImpl<HiveBaseBeehiveMappe
     public Result searchList(Map map) {
         Integer current =  (Integer)map.get("current");
         Integer pageSize =   (Integer) map.get("pageSize");
+        Integer farmId =(Integer)  map.get("farmId");
+        String apUidHex =(String)  map.get("apUidHex");
+
+        if (farmId == null || farmId <1 ){
+            return new  Result(10001,"牧场错误",false);
+        }
+        if (current == null || current <1 ){
+            current =1;
+        }
+        if (pageSize == null || pageSize <1 ){
+            pageSize =10;
+        }
+        QueryWrapper<HiveBaseBeehive> wrapper = new QueryWrapper<>();
+
+        wrapper.eq("farm_id",farmId);
+        wrapper.eq(StringUtils.isNotBlank(apUidHex),"ap_uid_hex",apUidHex);
+        Page<HiveBaseBeehive> page = this.page(new Page<>(current, pageSize),wrapper);
+
+        return new  Result(ResultCode.SUCCESS,page);
+    }
+
+    @Override
+    public Result listAll(Map map) {
+        Integer current =  (Integer)map.get("current");
+        Integer pageSize =   (Integer) map.get("pageSize");
         if (current == null || current <1 ){
             current =1;
         }
@@ -35,12 +62,7 @@ public class HiveBaseBeehiveServiceImpl extends ServiceImpl<HiveBaseBeehiveMappe
             pageSize =10;
         }
         Page<HiveBaseBeehive> page = this.page(new Page<>(current, pageSize));
-        //时间戳
-//        List<HiveBaseBeehive> records = page.getRecords();
-//        for (HiveBaseBeehive record : records) {
-//
-//
-//        }
+
         return new  Result(ResultCode.SUCCESS,page);
     }
 }

+ 80 - 2
beeboxs/src/main/java/com/huimv/beeboxs/service/impl/HiveBaseStationServiceImpl.java

@@ -1,14 +1,24 @@
 package com.huimv.beeboxs.service.impl;
 
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.huimv.beeboxs.common.utils.Result;
 import com.huimv.beeboxs.common.utils.ResultCode;
+import com.huimv.beeboxs.entity.HiveBaseBeehive;
 import com.huimv.beeboxs.entity.HiveBaseStation;
+import com.huimv.beeboxs.entity.dto.HiveBaseBeeStationDao;
+import com.huimv.beeboxs.entity.vo.HiveBaseStationVo;
 import com.huimv.beeboxs.mapper.HiveBaseStationMapper;
+import com.huimv.beeboxs.service.IHiveBaseBeehiveService;
 import com.huimv.beeboxs.service.IHiveBaseStationService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -21,20 +31,88 @@ import java.util.Map;
  */
 @Service
 public class HiveBaseStationServiceImpl extends ServiceImpl<HiveBaseStationMapper, HiveBaseStation> implements IHiveBaseStationService {
+    @Autowired
+    private IHiveBaseBeehiveService baseBeehiveService;
 
     @Override
     public Result searchList(Map map) {
 
         Integer current =  (Integer)map.get("current");
         Integer pageSize =   (Integer) map.get("pageSize");
-        map.get("");
+        Integer farmId =(Integer)  map.get("farmId");
+
+        if (farmId == null || farmId <1 ){
+            return new  Result(10001,"牧场错误",false);
+        }
+
+        if (current == null || current <1 ){
+            current =1;
+        }
+        if (pageSize == null || pageSize <1 ){
+            pageSize =10;
+        }
+        QueryWrapper<HiveBaseStation> wrapper = new QueryWrapper<>();
+
+        wrapper.eq("farm_id",farmId);
+        Page<HiveBaseStation> page = this.page(new Page<>(current, pageSize));
+
+        List<HiveBaseStation> records = page.getRecords();
+        List list = new ArrayList();
+        for (HiveBaseStation record : records) {
+            HiveBaseBeeStationDao hiveBaseStationVo = new HiveBaseBeeStationDao();
+            BeanUtil.copyProperties(record,hiveBaseStationVo);
+            String apUidHex = record.getApUidHex();
+            QueryWrapper<HiveBaseBeehive> hiveBaseBeehiveQueryWrapper = new QueryWrapper<>();
+            hiveBaseBeehiveQueryWrapper.eq("ap_uid_hex",apUidHex);
+            //总数
+            hiveBaseStationVo.setBeeBoxNum(  baseBeehiveService.count(hiveBaseBeehiveQueryWrapper));
+            hiveBaseBeehiveQueryWrapper.eq("tag_state",1);
+            hiveBaseStationVo.setOffBeeBoxNum(  baseBeehiveService.count(hiveBaseBeehiveQueryWrapper));
+
+            hiveBaseBeehiveQueryWrapper.clear();
+            hiveBaseBeehiveQueryWrapper.eq("ap_uid_hex",apUidHex).eq("tag_state",0);
+            hiveBaseStationVo.setOnBeeBoxNum(  baseBeehiveService.count(hiveBaseBeehiveQueryWrapper));
+            list.add(hiveBaseStationVo);
+        }
+        page.setRecords(list);
+        return new  Result(ResultCode.SUCCESS,page);
+    }
+
+    @Override
+    public Result listAll(Map map) {
+
+        Integer current =  (Integer)map.get("current");
+        Integer pageSize =   (Integer) map.get("pageSize");
+
         if (current == null || current <1 ){
             current =1;
         }
         if (pageSize == null || pageSize <1 ){
-            current =10;
+            pageSize =10;
         }
+        QueryWrapper<HiveBaseStation> wrapper = new QueryWrapper<>();
+
         Page<HiveBaseStation> page = this.page(new Page<>(current, pageSize));
         return new  Result(ResultCode.SUCCESS,page);
     }
+
+    @Override
+    public Result listCount(Map map) {
+        Integer farmId = (Integer)map.get("farmId");
+        QueryWrapper<HiveBaseStation> wrapper = new QueryWrapper<>();
+        wrapper.eq("farm_id",farmId);
+
+        HashMap<String, Object> endMap = new HashMap<>();
+        int stationNum = this.count(wrapper);
+
+
+        wrapper.eq("ap_state",0);
+        int onStationNum = this.count(wrapper);
+
+        endMap.put("onStationNum",onStationNum);
+        endMap.put("offStationNum",stationNum -  onStationNum);
+        endMap.put("stationNum",stationNum);
+
+        return new Result(ResultCode.SUCCESS,endMap);
+    }
 }

+ 44 - 0
beeboxs/src/main/java/com/huimv/beeboxs/service/impl/HiveBeehiveOutServiceImpl.java

@@ -0,0 +1,44 @@
+package com.huimv.beeboxs.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.huimv.beeboxs.common.utils.Result;
+import com.huimv.beeboxs.common.utils.ResultCode;
+import com.huimv.beeboxs.entity.HiveBeehive;
+import com.huimv.beeboxs.entity.HiveBeehiveOut;
+import com.huimv.beeboxs.mapper.HiveBeehiveOutMapper;
+import com.huimv.beeboxs.service.IHiveBeehiveOutService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author author
+ * @since 2022-04-22
+ */
+@Service
+public class HiveBeehiveOutServiceImpl extends ServiceImpl<HiveBeehiveOutMapper, HiveBeehiveOut> implements IHiveBeehiveOutService {
+    @Override
+    public Result searchList(Map map) {
+        String startDate = (String)map.get("startDate");
+        String endDate = (String)map.get("endDate");
+        String hiveId = (String)map.get("hiveId");
+
+        QueryWrapper<HiveBeehiveOut> wrapper = new QueryWrapper<>();
+        if (StringUtils.isBlank(hiveId)){
+            return new Result(10001,"请选择蜂箱",false);
+        }
+        wrapper.eq("hive_id",hiveId);
+//        wrapper.orderByDesc("create_date");
+
+        wrapper.ge(StringUtils.isNotBlank(startDate),"create_date",startDate);
+        wrapper.le(StringUtils.isNotBlank(endDate),"create_date",endDate);
+
+        return new Result(ResultCode.SUCCESS,this.list(wrapper));
+    }
+}

+ 24 - 0
beeboxs/src/main/resources/mapper/HiveBeehiveOutMapper.xml

@@ -0,0 +1,24 @@
+<?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.huimv.beeboxs.mapper.HiveBeehiveOutMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.huimv.beeboxs.entity.HiveBeehiveOut">
+        <id column="id" property="id" />
+        <result column="hive_id" property="hiveId" />
+        <result column="station_id" property="stationId" />
+        <result column="hive_code" property="hiveCode" />
+        <result column="net_status" property="netStatus" />
+        <result column="bat" property="bat" />
+        <result column="rssi" property="rssi" />
+        <result column="bee_status" property="beeStatus" />
+        <result column="temp" property="temp" />
+        <result column="humi" property="humi" />
+        <result column="upload_time" property="uploadTime" />
+        <result column="other1" property="other1" />
+        <result column="other2" property="other2" />
+        <result column="create_date" property="createDate" />
+        <result column="farm_id" property="farmId" />
+    </resultMap>
+
+</mapper>