diff --git a/fastbee-open-api/src/main/java/com/fastbee/data/controller/aaScreenAgricultural/DeviceInfoController.java b/fastbee-open-api/src/main/java/com/fastbee/data/controller/aaScreenAgricultural/DeviceInfoController.java index eaa9c3c..76888cc 100644 --- a/fastbee-open-api/src/main/java/com/fastbee/data/controller/aaScreenAgricultural/DeviceInfoController.java +++ b/fastbee-open-api/src/main/java/com/fastbee/data/controller/aaScreenAgricultural/DeviceInfoController.java @@ -1,8 +1,11 @@ package com.fastbee.data.controller.aaScreenAgricultural; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.fastbee.common.core.controller.BaseController; import com.fastbee.common.core.domain.AjaxResult; -import com.fastbee.deviceInfo.mapper.DeviceInformationWormsMapper; +import com.fastbee.deviceInfo.domain.*; +import com.fastbee.deviceInfo.mapper.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -15,14 +18,29 @@ public class DeviceInfoController extends BaseController { @Autowired private DeviceInformationWormsMapper deviceInformationWormsMapper; + @Autowired + private DeviceInformationMeteorologyMapper deviceInformationMeteorologyMapper; + @Autowired + private DeviceInformationMoistureMapper deviceInformationMoistureMapper; + @Autowired + private DeviceInformationTargetpestsMapper deviceInformationTargetpestsMapper; + + @Autowired + private DeviceInformationMiaoqingMapper deviceInformationMiaoqingMapper; + + @Autowired + private DeviceInformationMonitorMapper deviceInformationMonitorMapper; /** * 查询虫情设备列表 */ @GetMapping("/wormList") public AjaxResult getDeviceList() { - return success(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.select(DeviceInformationMeteorology::getId,DeviceInformationMeteorology::getName, + DeviceInformationMeteorology::getLongitude,DeviceInformationMeteorology::getLatitude); + return success(deviceInformationMeteorologyMapper.selectList(queryWrapper)); } /** @@ -30,7 +48,10 @@ public class DeviceInfoController extends BaseController { */ @GetMapping("/weatherList") public AjaxResult getWeatherList() { - return success(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.select(DeviceInformationWorms::getId,DeviceInformationWorms::getName, + DeviceInformationWorms::getLongitude,DeviceInformationWorms::getLatitude); + return success(deviceInformationWormsMapper.selectList(queryWrapper)); } /** @@ -38,13 +59,39 @@ public class DeviceInfoController extends BaseController { */ @GetMapping("/soilList") public AjaxResult getSoilList() { - return success(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.select(DeviceInformationMoisture::getId,DeviceInformationMoisture::getName, + DeviceInformationMoisture::getLongitude,DeviceInformationMoisture::getLatitude); + return success(deviceInformationMoistureMapper.selectList(queryWrapper)); } /** * 查询杀虫灯设备列表 */ @GetMapping("/lightList") public AjaxResult getLightList() { - return success(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.select(DeviceInformationTargetpests::getId,DeviceInformationTargetpests::getName, + DeviceInformationTargetpests::getLongitude,DeviceInformationTargetpests::getLatitude); + return success(deviceInformationTargetpestsMapper.selectList(queryWrapper)); + } + /** + * 查询苗情设备列表 + */ + @GetMapping("/miaoList") + public AjaxResult getmiaoList() { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.select(DeviceInformationMiaoqing::getId,DeviceInformationMiaoqing::getName, + DeviceInformationMiaoqing::getLongitude,DeviceInformationMiaoqing::getLatitude); + return success(deviceInformationMiaoqingMapper.selectList(queryWrapper)); + } + /** + * 查询监控站设备列表 + */ + @GetMapping("/monitorList") + public AjaxResult getmonitorList() { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.select(DeviceInformationMonitor::getId,DeviceInformationMonitor::getName, + DeviceInformationMonitor::getLongitude,DeviceInformationMonitor::getLatitude); + return success(deviceInformationMonitorMapper.selectList(queryWrapper)); } } diff --git a/fastbee-service/fastbee-device-service/src/main/java/com/fastbee/deviceInfo/domain/DeviceInformationTargetpests.java b/fastbee-service/fastbee-device-service/src/main/java/com/fastbee/deviceInfo/domain/DeviceInformationTargetpests.java index f3269bc..8cf8790 100644 --- a/fastbee-service/fastbee-device-service/src/main/java/com/fastbee/deviceInfo/domain/DeviceInformationTargetpests.java +++ b/fastbee-service/fastbee-device-service/src/main/java/com/fastbee/deviceInfo/domain/DeviceInformationTargetpests.java @@ -5,8 +5,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; import com.fastbee.common.annotation.Excel; import com.fastbee.common.core.domain.BaseEntity; @@ -14,70 +12,75 @@ import com.fastbee.common.core.domain.BaseEntity; * 靶标害虫设备基础信息对象 iot_device_information_targetPests * * @author kerwincui - * @date 2024-11-18 + * @date 2024-11-27 */ @ApiModel(value = "DeviceInformationTargetpests",description = "靶标害虫设备基础信息 iot_device_information_targetPests") @Data @EqualsAndHashCode(callSuper = true) @TableName("iot_device_information_targetPests") public class DeviceInformationTargetpests extends BaseEntity - { -private static final long serialVersionUID = 1L; +{ + private static final long serialVersionUID = 1L; /** 主键 */ private Long id; /** 设备品牌 */ - @Excel(name = "设备品牌") - @ApiModelProperty("设备品牌") + @Excel(name = "设备品牌") + @ApiModelProperty("设备品牌") private String deviceBrand; /** 类型 */ - @Excel(name = "类型") - @ApiModelProperty("类型") + @Excel(name = "类型") + @ApiModelProperty("类型") private String type; /** 设备型号 */ - @Excel(name = "设备型号") - @ApiModelProperty("设备型号") + @Excel(name = "设备型号") + @ApiModelProperty("设备型号") private String deviceType; /** 供电 */ - @Excel(name = "供电") - @ApiModelProperty("供电") + @Excel(name = "供电") + @ApiModelProperty("供电") private String powerSupply; /** 设备编码 */ - @Excel(name = "设备编码") - @ApiModelProperty("设备编码") + @Excel(name = "设备编码") + @ApiModelProperty("设备编码") private String deviceEncoding; /** 地址码 */ - @Excel(name = "地址码") - @ApiModelProperty("地址码") + @Excel(name = "地址码") + @ApiModelProperty("地址码") private String addressCode; /** 安装位置 */ - @Excel(name = "安装位置") - @ApiModelProperty("安装位置") + @Excel(name = "安装位置") + @ApiModelProperty("安装位置") private String installationLocation; /** 经度 */ - @Excel(name = "经度") - @ApiModelProperty("经度") + @Excel(name = "经度") + @ApiModelProperty("经度") private String longitude; /** 纬度 */ - @Excel(name = "纬度") - @ApiModelProperty("纬度") + @Excel(name = "纬度") + @ApiModelProperty("纬度") private String latitude; /** 对接方式 */ - @Excel(name = "对接方式") - @ApiModelProperty("对接方式") + @Excel(name = "对接方式") + @ApiModelProperty("对接方式") private String dockingMethod; /** 删除标志(0代表存在,2代表删除) */ private Integer delFlag; + /** 名称 */ + @Excel(name = "名称") + @ApiModelProperty("名称") + private String name; + } diff --git a/fastbee-service/fastbee-device-service/src/main/resources/mapper/DeviceInformationTargetpestsMapper.xml b/fastbee-service/fastbee-device-service/src/main/resources/mapper/DeviceInformationTargetpestsMapper.xml index 1a336ab..22fce6c 100644 --- a/fastbee-service/fastbee-device-service/src/main/resources/mapper/DeviceInformationTargetpestsMapper.xml +++ b/fastbee-service/fastbee-device-service/src/main/resources/mapper/DeviceInformationTargetpestsMapper.xml @@ -21,10 +21,11 @@ + - select id, device_brand, type, device_type, power_supply, device_encoding, address_code, installation_location, longitude, latitude, docking_method, del_flag, create_time, create_by, update_time, update_by from iot_device_information_targetPests + select id, device_brand, type, device_type, power_supply, device_encoding, address_code, installation_location, longitude, latitude, docking_method, del_flag, create_time, create_by, update_time, update_by, name from iot_device_information_targetPests @@ -66,6 +68,7 @@ create_by, update_time, update_by, + name, #{deviceBrand}, @@ -83,6 +86,7 @@ #{createBy}, #{updateTime}, #{updateBy}, + #{name}, @@ -104,6 +108,7 @@ create_by = #{createBy}, update_time = #{updateTime}, update_by = #{updateBy}, + name = #{name}, where id = #{id}