天气api参数调整,虫情设备图片数据获取等
This commit is contained in:
@ -0,0 +1,25 @@
|
||||
package com.fastbee.common.utils.date;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
public class DateTimeCalculationUtils {
|
||||
// 获取当前时间并减去指定单位的指定数量
|
||||
public static LocalDateTime minus(long amountToSubtract, ChronoUnit unit) {
|
||||
// 获取当前时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 减去指定的时间量
|
||||
return now.minus(amountToSubtract, unit);
|
||||
}
|
||||
|
||||
// 格式化日期时间
|
||||
public static String format(LocalDateTime dateTime) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
return dateTime.format(formatter);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("DateTime before 5 minutes: " + DateTimeCalculationUtils.format(DateTimeCalculationUtils.minus(5, ChronoUnit.MINUTES)));
|
||||
}
|
||||
}
|
@ -55,7 +55,7 @@ public class AlertLogController extends BaseController
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AlertLog alertLog)
|
||||
{
|
||||
startPage();
|
||||
startPage();
|
||||
List<AlertLog> list = alertLogService.selectAlertLogList(alertLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
@ -0,0 +1,110 @@
|
||||
package com.fastbee.data.controller.deviceInfo;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.fastbee.common.annotation.Log;
|
||||
import com.fastbee.common.core.controller.BaseController;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.enums.BusinessType;
|
||||
import com.fastbee.deviceInfo.domain.DeviceInformationMeteorology;
|
||||
import com.fastbee.deviceInfo.service.IDeviceInformationMeteorologyService;
|
||||
import com.fastbee.common.utils.poi.ExcelUtil;
|
||||
import com.fastbee.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 气象设备基础信息Controller
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/deviceInfo/meteorology")
|
||||
@Api(tags = "气象设备基础信息")
|
||||
public class DeviceInformationMeteorologyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDeviceInformationMeteorologyService deviceInformationMeteorologyService;
|
||||
|
||||
/**
|
||||
* 查询气象设备基础信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:meteorology:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询气象设备基础信息列表")
|
||||
public TableDataInfo list(DeviceInformationMeteorology deviceInformationMeteorology)
|
||||
{
|
||||
startPage();
|
||||
List<DeviceInformationMeteorology> list = deviceInformationMeteorologyService.selectDeviceInformationMeteorologyList(deviceInformationMeteorology);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出气象设备基础信息列表
|
||||
*/
|
||||
@ApiOperation("导出气象设备基础信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:meteorology:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DeviceInformationMeteorology deviceInformationMeteorology)
|
||||
{
|
||||
List<DeviceInformationMeteorology> list = deviceInformationMeteorologyService.selectDeviceInformationMeteorologyList(deviceInformationMeteorology);
|
||||
ExcelUtil<DeviceInformationMeteorology> util = new ExcelUtil<DeviceInformationMeteorology>(DeviceInformationMeteorology.class);
|
||||
util.exportExcel(response, list, "气象设备基础信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取气象设备基础信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:meteorology:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取气象设备基础信息详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(deviceInformationMeteorologyService.selectDeviceInformationMeteorologyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增气象设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:meteorology:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增气象设备基础信息")
|
||||
public AjaxResult add(@RequestBody DeviceInformationMeteorology deviceInformationMeteorology)
|
||||
{
|
||||
return toAjax(deviceInformationMeteorologyService.insertDeviceInformationMeteorology(deviceInformationMeteorology));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改气象设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:meteorology:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改气象设备基础信息")
|
||||
public AjaxResult edit(@RequestBody DeviceInformationMeteorology deviceInformationMeteorology)
|
||||
{
|
||||
return toAjax(deviceInformationMeteorologyService.updateDeviceInformationMeteorology(deviceInformationMeteorology));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除气象设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:meteorology:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除气象设备基础信息")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(deviceInformationMeteorologyService.deleteDeviceInformationMeteorologyByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package com.fastbee.data.controller.deviceInfo;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.fastbee.common.annotation.Log;
|
||||
import com.fastbee.common.core.controller.BaseController;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.enums.BusinessType;
|
||||
import com.fastbee.deviceInfo.domain.DeviceInformationMiaoqing;
|
||||
import com.fastbee.deviceInfo.service.IDeviceInformationMiaoqingService;
|
||||
import com.fastbee.common.utils.poi.ExcelUtil;
|
||||
import com.fastbee.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 苗情设备基础信息Controller
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/deviceInfo/miaoQing")
|
||||
@Api(tags = "苗情设备基础信息")
|
||||
public class DeviceInformationMiaoqingController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDeviceInformationMiaoqingService deviceInformationMiaoqingService;
|
||||
|
||||
/**
|
||||
* 查询苗情设备基础信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:miaoQing:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询苗情设备基础信息列表")
|
||||
public TableDataInfo list(DeviceInformationMiaoqing deviceInformationMiaoqing)
|
||||
{
|
||||
startPage();
|
||||
List<DeviceInformationMiaoqing> list = deviceInformationMiaoqingService.selectDeviceInformationMiaoqingList(deviceInformationMiaoqing);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出苗情设备基础信息列表
|
||||
*/
|
||||
@ApiOperation("导出苗情设备基础信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:miaoQing:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DeviceInformationMiaoqing deviceInformationMiaoqing)
|
||||
{
|
||||
List<DeviceInformationMiaoqing> list = deviceInformationMiaoqingService.selectDeviceInformationMiaoqingList(deviceInformationMiaoqing);
|
||||
ExcelUtil<DeviceInformationMiaoqing> util = new ExcelUtil<DeviceInformationMiaoqing>(DeviceInformationMiaoqing.class);
|
||||
util.exportExcel(response, list, "苗情设备基础信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取苗情设备基础信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:miaoQing:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取苗情设备基础信息详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(deviceInformationMiaoqingService.selectDeviceInformationMiaoqingById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增苗情设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:miaoQing:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增苗情设备基础信息")
|
||||
public AjaxResult add(@RequestBody DeviceInformationMiaoqing deviceInformationMiaoqing)
|
||||
{
|
||||
return toAjax(deviceInformationMiaoqingService.insertDeviceInformationMiaoqing(deviceInformationMiaoqing));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改苗情设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:miaoQing:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改苗情设备基础信息")
|
||||
public AjaxResult edit(@RequestBody DeviceInformationMiaoqing deviceInformationMiaoqing)
|
||||
{
|
||||
return toAjax(deviceInformationMiaoqingService.updateDeviceInformationMiaoqing(deviceInformationMiaoqing));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除苗情设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:miaoQing:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除苗情设备基础信息")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(deviceInformationMiaoqingService.deleteDeviceInformationMiaoqingByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package com.fastbee.data.controller.deviceInfo;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.fastbee.common.annotation.Log;
|
||||
import com.fastbee.common.core.controller.BaseController;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.enums.BusinessType;
|
||||
import com.fastbee.deviceInfo.domain.DeviceInformationMoisture;
|
||||
import com.fastbee.deviceInfo.service.IDeviceInformationMoistureService;
|
||||
import com.fastbee.common.utils.poi.ExcelUtil;
|
||||
import com.fastbee.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 墒情设备基础信息Controller
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/deviceInfo/moisture")
|
||||
@Api(tags = "墒情设备基础信息")
|
||||
public class DeviceInformationMoistureController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDeviceInformationMoistureService deviceInformationMoistureService;
|
||||
|
||||
/**
|
||||
* 查询墒情设备基础信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:moisture:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询墒情设备基础信息列表")
|
||||
public TableDataInfo list(DeviceInformationMoisture deviceInformationMoisture)
|
||||
{
|
||||
startPage();
|
||||
List<DeviceInformationMoisture> list = deviceInformationMoistureService.selectDeviceInformationMoistureList(deviceInformationMoisture);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出墒情设备基础信息列表
|
||||
*/
|
||||
@ApiOperation("导出墒情设备基础信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:moisture:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DeviceInformationMoisture deviceInformationMoisture)
|
||||
{
|
||||
List<DeviceInformationMoisture> list = deviceInformationMoistureService.selectDeviceInformationMoistureList(deviceInformationMoisture);
|
||||
ExcelUtil<DeviceInformationMoisture> util = new ExcelUtil<DeviceInformationMoisture>(DeviceInformationMoisture.class);
|
||||
util.exportExcel(response, list, "墒情设备基础信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取墒情设备基础信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:moisture:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取墒情设备基础信息详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(deviceInformationMoistureService.selectDeviceInformationMoistureById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增墒情设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:moisture:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增墒情设备基础信息")
|
||||
public AjaxResult add(@RequestBody DeviceInformationMoisture deviceInformationMoisture)
|
||||
{
|
||||
return toAjax(deviceInformationMoistureService.insertDeviceInformationMoisture(deviceInformationMoisture));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改墒情设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:moisture:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改墒情设备基础信息")
|
||||
public AjaxResult edit(@RequestBody DeviceInformationMoisture deviceInformationMoisture)
|
||||
{
|
||||
return toAjax(deviceInformationMoistureService.updateDeviceInformationMoisture(deviceInformationMoisture));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除墒情设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:moisture:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除墒情设备基础信息")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(deviceInformationMoistureService.deleteDeviceInformationMoistureByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package com.fastbee.data.controller.deviceInfo;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.fastbee.common.annotation.Log;
|
||||
import com.fastbee.common.core.controller.BaseController;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.enums.BusinessType;
|
||||
import com.fastbee.deviceInfo.domain.DeviceInformationMonitor;
|
||||
import com.fastbee.deviceInfo.service.IDeviceInformationMonitorService;
|
||||
import com.fastbee.common.utils.poi.ExcelUtil;
|
||||
import com.fastbee.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 监控站设备基础信息Controller
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/deviceInfo/monitor")
|
||||
@Api(tags = "监控站设备基础信息")
|
||||
public class DeviceInformationMonitorController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDeviceInformationMonitorService deviceInformationMonitorService;
|
||||
|
||||
/**
|
||||
* 查询监控站设备基础信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询监控站设备基础信息列表")
|
||||
public TableDataInfo list(DeviceInformationMonitor deviceInformationMonitor)
|
||||
{
|
||||
startPage();
|
||||
List<DeviceInformationMonitor> list = deviceInformationMonitorService.selectDeviceInformationMonitorList(deviceInformationMonitor);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出监控站设备基础信息列表
|
||||
*/
|
||||
@ApiOperation("导出监控站设备基础信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DeviceInformationMonitor deviceInformationMonitor)
|
||||
{
|
||||
List<DeviceInformationMonitor> list = deviceInformationMonitorService.selectDeviceInformationMonitorList(deviceInformationMonitor);
|
||||
ExcelUtil<DeviceInformationMonitor> util = new ExcelUtil<DeviceInformationMonitor>(DeviceInformationMonitor.class);
|
||||
util.exportExcel(response, list, "监控站设备基础信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取监控站设备基础信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取监控站设备基础信息详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(deviceInformationMonitorService.selectDeviceInformationMonitorById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增监控站设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增监控站设备基础信息")
|
||||
public AjaxResult add(@RequestBody DeviceInformationMonitor deviceInformationMonitor)
|
||||
{
|
||||
return toAjax(deviceInformationMonitorService.insertDeviceInformationMonitor(deviceInformationMonitor));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改监控站设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改监控站设备基础信息")
|
||||
public AjaxResult edit(@RequestBody DeviceInformationMonitor deviceInformationMonitor)
|
||||
{
|
||||
return toAjax(deviceInformationMonitorService.updateDeviceInformationMonitor(deviceInformationMonitor));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监控站设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除监控站设备基础信息")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(deviceInformationMonitorService.deleteDeviceInformationMonitorByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package com.fastbee.data.controller.deviceInfo;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.fastbee.common.annotation.Log;
|
||||
import com.fastbee.common.core.controller.BaseController;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.enums.BusinessType;
|
||||
import com.fastbee.deviceInfo.domain.DeviceInformationTargetpests;
|
||||
import com.fastbee.deviceInfo.service.IDeviceInformationTargetpestsService;
|
||||
import com.fastbee.common.utils.poi.ExcelUtil;
|
||||
import com.fastbee.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 靶标害虫设备基础信息Controller
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/deviceInfo/targetPests")
|
||||
@Api(tags = "靶标害虫设备基础信息")
|
||||
public class DeviceInformationTargetpestsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDeviceInformationTargetpestsService deviceInformationTargetpestsService;
|
||||
|
||||
/**
|
||||
* 查询靶标害虫设备基础信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:targetPests:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询靶标害虫设备基础信息列表")
|
||||
public TableDataInfo list(DeviceInformationTargetpests deviceInformationTargetpests)
|
||||
{
|
||||
startPage();
|
||||
List<DeviceInformationTargetpests> list = deviceInformationTargetpestsService.selectDeviceInformationTargetpestsList(deviceInformationTargetpests);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出靶标害虫设备基础信息列表
|
||||
*/
|
||||
@ApiOperation("导出靶标害虫设备基础信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:targetPests:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DeviceInformationTargetpests deviceInformationTargetpests)
|
||||
{
|
||||
List<DeviceInformationTargetpests> list = deviceInformationTargetpestsService.selectDeviceInformationTargetpestsList(deviceInformationTargetpests);
|
||||
ExcelUtil<DeviceInformationTargetpests> util = new ExcelUtil<DeviceInformationTargetpests>(DeviceInformationTargetpests.class);
|
||||
util.exportExcel(response, list, "靶标害虫设备基础信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取靶标害虫设备基础信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:targetPests:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取靶标害虫设备基础信息详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(deviceInformationTargetpestsService.selectDeviceInformationTargetpestsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增靶标害虫设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:targetPests:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增靶标害虫设备基础信息")
|
||||
public AjaxResult add(@RequestBody DeviceInformationTargetpests deviceInformationTargetpests)
|
||||
{
|
||||
return toAjax(deviceInformationTargetpestsService.insertDeviceInformationTargetpests(deviceInformationTargetpests));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改靶标害虫设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:targetPests:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改靶标害虫设备基础信息")
|
||||
public AjaxResult edit(@RequestBody DeviceInformationTargetpests deviceInformationTargetpests)
|
||||
{
|
||||
return toAjax(deviceInformationTargetpestsService.updateDeviceInformationTargetpests(deviceInformationTargetpests));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除靶标害虫设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:targetPests:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除靶标害虫设备基础信息")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(deviceInformationTargetpestsService.deleteDeviceInformationTargetpestsByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package com.fastbee.data.controller.deviceInfo;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.fastbee.common.annotation.Log;
|
||||
import com.fastbee.common.core.controller.BaseController;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.enums.BusinessType;
|
||||
import com.fastbee.deviceInfo.domain.DeviceInformationWorms;
|
||||
import com.fastbee.deviceInfo.service.IDeviceInformationWormsService;
|
||||
import com.fastbee.common.utils.poi.ExcelUtil;
|
||||
import com.fastbee.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 虫情设备基础信息Controller
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/deviceInfo/worms")
|
||||
@Api(tags = "虫情设备基础信息")
|
||||
public class DeviceInformationWormsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDeviceInformationWormsService deviceInformationWormsService;
|
||||
|
||||
/**
|
||||
* 查询虫情设备基础信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:worms:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询虫情设备基础信息列表")
|
||||
public TableDataInfo list(DeviceInformationWorms deviceInformationWorms)
|
||||
{
|
||||
startPage();
|
||||
List<DeviceInformationWorms> list = deviceInformationWormsService.selectDeviceInformationWormsList(deviceInformationWorms);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出虫情设备基础信息列表
|
||||
*/
|
||||
@ApiOperation("导出虫情设备基础信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:worms:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DeviceInformationWorms deviceInformationWorms)
|
||||
{
|
||||
List<DeviceInformationWorms> list = deviceInformationWormsService.selectDeviceInformationWormsList(deviceInformationWorms);
|
||||
ExcelUtil<DeviceInformationWorms> util = new ExcelUtil<DeviceInformationWorms>(DeviceInformationWorms.class);
|
||||
util.exportExcel(response, list, "虫情设备基础信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取虫情设备基础信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:worms:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取虫情设备基础信息详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(deviceInformationWormsService.selectDeviceInformationWormsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增虫情设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:worms:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增虫情设备基础信息")
|
||||
public AjaxResult add(@RequestBody DeviceInformationWorms deviceInformationWorms)
|
||||
{
|
||||
return toAjax(deviceInformationWormsService.insertDeviceInformationWorms(deviceInformationWorms));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改虫情设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:worms:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改虫情设备基础信息")
|
||||
public AjaxResult edit(@RequestBody DeviceInformationWorms deviceInformationWorms)
|
||||
{
|
||||
return toAjax(deviceInformationWormsService.updateDeviceInformationWorms(deviceInformationWorms));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除虫情设备基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:worms:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除虫情设备基础信息")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(deviceInformationWormsService.deleteDeviceInformationWormsByIds(ids));
|
||||
}
|
||||
}
|
@ -17,25 +17,11 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.6.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.fastbee</groupId>
|
||||
<artifactId>fastbee-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -7,6 +7,7 @@ import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.fastbee.common.exception.ServiceException;
|
||||
import com.fastbee.common.utils.DateUtils;
|
||||
import com.fastbee.common.utils.date.DateTimeCalculationUtils;
|
||||
import com.fastbee.deviceData.domain.DeviceRealtimedataWorms;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -15,6 +16,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
@ -28,10 +30,11 @@ public class RenkeDeviceDataService {
|
||||
* @param deviceAddrs 设备地址,支持多个用英文逗号分隔
|
||||
*/
|
||||
public DeviceRealtimedataWorms setData(String deviceAddrs) {
|
||||
DeviceRealtimedataWorms deviceRealtimedataWorms= new DeviceRealtimedataWorms();
|
||||
//处理鉴权
|
||||
String token = authenticationService.getToken();
|
||||
// String token = new RenKeAuthorizationService().getToken();
|
||||
//获取设备实时数据
|
||||
//获取设备基础实时数据
|
||||
HttpResponse response = HttpRequest.get("http://api.farm.0531yun.cn/api/v2.0/entrance/device/getRealTimeData")
|
||||
.header("token", token)
|
||||
.form("deviceAddrs", deviceAddrs)
|
||||
@ -46,7 +49,35 @@ public class RenkeDeviceDataService {
|
||||
JSONObject jsonObject1 = JSONUtil.parseObj(jsonObject.get("data"));
|
||||
//获取实时时间
|
||||
String realTime = jsonObject1.get("DTime").toString();
|
||||
DeviceRealtimedataWorms deviceRealtimedataWorms = JSONUtil.toBean(jsonObject1, DeviceRealtimedataWorms.class);
|
||||
//反序列化封装基础数据
|
||||
deviceRealtimedataWorms = JSONUtil.toBean(jsonObject1, DeviceRealtimedataWorms.class);
|
||||
//获取虫情设备关键数据
|
||||
HttpResponse response1 = HttpRequest.get("http://api.farm.0531yun.cn/api/v2.0/worm/deviceData/getWormDataList")
|
||||
.header("token", token)
|
||||
.form("deviceAddrs", deviceAddrs)
|
||||
//开始时间是5分钟前
|
||||
.form("beginTime", DateTimeCalculationUtils.format(DateTimeCalculationUtils.minus(5, ChronoUnit.MINUTES)))
|
||||
.form("endTime", DateUtils.getNowDate())
|
||||
.form("pages", 1)
|
||||
.form("limit", 10)
|
||||
.execute();
|
||||
String respBodyStr1 = response.body();
|
||||
if(StringUtils.isBlank(respBodyStr1)) {
|
||||
throw new RuntimeException("获取设备实时数据失败!");
|
||||
}
|
||||
JSONObject jsonObject2 = JSONUtil.parseObj(respBodyStr1);
|
||||
JSONObject jsonObject3 = JSONUtil.parseObj(jsonObject2.get("data"));
|
||||
JSONArray jsonArray = JSONUtil.parseArray(jsonObject3.get("rows"));
|
||||
JSONObject jsonObject4 = JSONUtil.parseObj(jsonArray.get(0));
|
||||
//获取拍照图片
|
||||
Object imagesUrl = jsonObject4.get("imagesUrl");
|
||||
//获取虫情分析后的图片地址
|
||||
Object analyseCoordUrl = jsonObject4.get("analyseCoordUrl");
|
||||
|
||||
deviceRealtimedataWorms.setPestPhotos(analyseCoordUrl.toString());
|
||||
deviceRealtimedataWorms.setCamera(imagesUrl.toString());
|
||||
|
||||
|
||||
deviceRealtimedataWorms.setSaveTime(DateUtils.getNowDate());
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
try {
|
||||
|
@ -19,7 +19,7 @@ public class TianqiApi {
|
||||
|
||||
String url = UrlConstant.QitianApi + "?key=" +
|
||||
UrlConstant.PrivateKey +
|
||||
"&location=kenli&language=zh-Hans&unit=c";//指定URL
|
||||
"&location=YBMUBR41ZWVC&language=zh-Hans&unit=c";//指定URL
|
||||
HttpResponse execute = HttpUtil.createGet(url).execute();
|
||||
if (execute.getStatus() == HttpStatus.HTTP_OK) {
|
||||
JSONObject jsonObject = new JSONObject(execute.body());
|
||||
@ -54,4 +54,22 @@ public class TianqiApi {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// String url="https://api.seniverse.com/v3/location/search.json?key="+UrlConstant.PrivateKey+"&q=绥滨";
|
||||
// HttpResponse execute = HttpUtil.createGet(url).execute();
|
||||
// if (execute.getStatus() == HttpStatus.HTTP_OK) {
|
||||
// JSONObject jsonObject = new JSONObject(execute.body());
|
||||
// System.out.println("jsonObject = " + jsonObject);
|
||||
// }
|
||||
String url = UrlConstant.QitianApi + "?key=" +
|
||||
UrlConstant.PrivateKey +
|
||||
"&location=YBMUBR41ZWVC&language=zh-Hans&unit=c";//指定URL
|
||||
HttpResponse execute = HttpUtil.createGet(url).execute();
|
||||
if (execute.getStatus() == HttpStatus.HTTP_OK) {
|
||||
JSONObject jsonObject = new JSONObject(execute.body());
|
||||
System.out.println("jsonObject = " + jsonObject);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -133,4 +133,14 @@ private static final long serialVersionUID = 1L;
|
||||
@ApiModelProperty("实时时间")
|
||||
private Date realTime;
|
||||
|
||||
/** 摄像头 */
|
||||
@Excel(name = "摄像头")
|
||||
@ApiModelProperty("摄像头")
|
||||
private String camera;
|
||||
|
||||
/** 虫害照片 */
|
||||
@Excel(name = "虫害照片")
|
||||
@ApiModelProperty("虫害照片")
|
||||
private String pestPhotos;
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.fastbee.deviceInfo.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -20,6 +22,7 @@ import com.fastbee.common.core.domain.BaseEntity;
|
||||
@ApiModel(value = "DeviceInformationMeteorology",description = "气象设备基础信息 iot_device_information_meteorology")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("iot_device_information_meteorology")
|
||||
public class DeviceInformationMeteorology extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.fastbee.deviceInfo.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -20,6 +22,7 @@ import com.fastbee.common.core.domain.BaseEntity;
|
||||
@ApiModel(value = "DeviceInformationMiaoqing",description = "苗情设备基础信息 iot_device_information_miaoQing")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("iot_device_information_miaoQing")
|
||||
public class DeviceInformationMiaoqing extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.fastbee.deviceInfo.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -20,6 +22,7 @@ import com.fastbee.common.core.domain.BaseEntity;
|
||||
@ApiModel(value = "DeviceInformationMoisture",description = "墒情设备基础信息 iot_device_information_moisture")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("iot_device_information_moisture")
|
||||
public class DeviceInformationMoisture extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.fastbee.deviceInfo.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -20,6 +22,7 @@ import com.fastbee.common.core.domain.BaseEntity;
|
||||
@ApiModel(value = "DeviceInformationMonitor",description = "监控站设备基础信息 iot_device_information_monitor")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("iot_device_information_monitor")
|
||||
public class DeviceInformationMonitor extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fastbee.deviceInfo.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -18,6 +19,7 @@ import com.fastbee.common.core.domain.BaseEntity;
|
||||
@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;
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.fastbee.deviceInfo.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -20,6 +22,7 @@ import com.fastbee.common.core.domain.BaseEntity;
|
||||
@ApiModel(value = "DeviceInformationWorms",description = "虫情设备基础信息 iot_device_information_worms")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("iot_device_information_worms")
|
||||
public class DeviceInformationWorms extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.fastbee.deviceInfo.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fastbee.deviceInfo.domain.DeviceInformationMeteorology;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@ -11,7 +13,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceInformationMeteorologyMapper
|
||||
public interface DeviceInformationMeteorologyMapper extends BaseMapper<DeviceInformationMeteorology>
|
||||
{
|
||||
/**
|
||||
* 查询气象设备基础信息
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.fastbee.deviceInfo.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fastbee.deviceInfo.domain.DeviceInformationMiaoqing;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@ -11,7 +13,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceInformationMiaoqingMapper
|
||||
public interface DeviceInformationMiaoqingMapper extends BaseMapper<DeviceInformationMiaoqing>
|
||||
{
|
||||
/**
|
||||
* 查询苗情设备基础信息
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.fastbee.deviceInfo.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fastbee.deviceInfo.domain.DeviceInformationMoisture;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@ -11,7 +13,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceInformationMoistureMapper
|
||||
public interface DeviceInformationMoistureMapper extends BaseMapper<DeviceInformationMoisture>
|
||||
{
|
||||
/**
|
||||
* 查询墒情设备基础信息
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.fastbee.deviceInfo.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fastbee.deviceInfo.domain.DeviceInformationMonitor;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@ -11,7 +13,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceInformationMonitorMapper
|
||||
public interface DeviceInformationMonitorMapper extends BaseMapper<DeviceInformationMonitor>
|
||||
{
|
||||
/**
|
||||
* 查询监控站设备基础信息
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.fastbee.deviceInfo.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fastbee.deviceInfo.domain.DeviceInformationTargetpests;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@ -11,7 +13,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceInformationTargetpestsMapper
|
||||
public interface DeviceInformationTargetpestsMapper extends BaseMapper<DeviceInformationTargetpests>
|
||||
{
|
||||
/**
|
||||
* 查询靶标害虫设备基础信息
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.fastbee.deviceInfo.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fastbee.deviceInfo.domain.DeviceInformationWorms;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@ -11,7 +13,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceInformationWormsMapper
|
||||
public interface DeviceInformationWormsMapper extends BaseMapper<DeviceInformationWorms>
|
||||
{
|
||||
/**
|
||||
* 查询虫情设备基础信息
|
||||
|
@ -26,10 +26,12 @@
|
||||
<result property="status" column="status" />
|
||||
<result property="saveTime" column="save_time" />
|
||||
<result property="realTime" column="real_time" />
|
||||
<result property="camera" column="camera" />
|
||||
<result property="pestPhotos" column="pest_photos" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeviceRealtimedataWormsVo">
|
||||
select id, device_addr, rain, worm_flap, insecticide_tem, shake, lng, drying_flap, insecticide, move_worm, mode, drying, rain_flap, attract_worm, illum, drying_tem, lat, fill_light, status, save_time, real_time from iot_device_realtimedata_worms
|
||||
select id, device_addr, rain, worm_flap, insecticide_tem, shake, lng, drying_flap, insecticide, move_worm, mode, drying, rain_flap, attract_worm, illum, drying_tem, lat, fill_light, status, save_time, real_time, camera, pest_photos from iot_device_realtimedata_worms
|
||||
</sql>
|
||||
|
||||
<select id="selectDeviceRealtimedataWormsList" parameterType="DeviceRealtimedataWorms" resultMap="DeviceRealtimedataWormsResult">
|
||||
@ -55,6 +57,8 @@
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="saveTime != null "> and save_time = #{saveTime}</if>
|
||||
<if test="realTime != null "> and real_time = #{realTime}</if>
|
||||
<if test="camera != null and camera != ''"> and camera = #{camera}</if>
|
||||
<if test="pestPhotos != null and pestPhotos != ''"> and pest_photos = #{pestPhotos}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -86,6 +90,8 @@
|
||||
<if test="status != null">status,</if>
|
||||
<if test="saveTime != null">save_time,</if>
|
||||
<if test="realTime != null">real_time,</if>
|
||||
<if test="camera != null">camera,</if>
|
||||
<if test="pestPhotos != null">pest_photos,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceAddr != null">#{deviceAddr},</if>
|
||||
@ -108,6 +114,8 @@
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="saveTime != null">#{saveTime},</if>
|
||||
<if test="realTime != null">#{realTime},</if>
|
||||
<if test="camera != null">#{camera},</if>
|
||||
<if test="pestPhotos != null">#{pestPhotos},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -134,6 +142,8 @@
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="saveTime != null">save_time = #{saveTime},</if>
|
||||
<if test="realTime != null">real_time = #{realTime},</if>
|
||||
<if test="camera != null">camera = #{camera},</if>
|
||||
<if test="pestPhotos != null">pest_photos = #{pestPhotos},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
Reference in New Issue
Block a user