设备信息

This commit is contained in:
zhumeixiao 2024-11-27 16:53:19 +08:00
parent 351e45cc09
commit 2dbb92a036
3 changed files with 86 additions and 31 deletions

View File

@ -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<DeviceInformationMeteorology> 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<DeviceInformationWorms> 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<DeviceInformationMoisture> 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<DeviceInformationTargetpests> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.select(DeviceInformationTargetpests::getId,DeviceInformationTargetpests::getName,
DeviceInformationTargetpests::getLongitude,DeviceInformationTargetpests::getLatitude);
return success(deviceInformationTargetpestsMapper.selectList(queryWrapper));
}
/**
* 查询苗情设备列表
*/
@GetMapping("/miaoList")
public AjaxResult getmiaoList() {
LambdaQueryWrapper<DeviceInformationMiaoqing> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.select(DeviceInformationMiaoqing::getId,DeviceInformationMiaoqing::getName,
DeviceInformationMiaoqing::getLongitude,DeviceInformationMiaoqing::getLatitude);
return success(deviceInformationMiaoqingMapper.selectList(queryWrapper));
}
/**
* 查询监控站设备列表
*/
@GetMapping("/monitorList")
public AjaxResult getmonitorList() {
LambdaQueryWrapper<DeviceInformationMonitor> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.select(DeviceInformationMonitor::getId,DeviceInformationMonitor::getName,
DeviceInformationMonitor::getLongitude,DeviceInformationMonitor::getLatitude);
return success(deviceInformationMonitorMapper.selectList(queryWrapper));
}
}

View File

@ -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,15 +12,15 @@ 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;
@ -80,4 +78,9 @@ private static final long serialVersionUID = 1L;
/** 删除标志0代表存在2代表删除 */
private Integer delFlag;
/** 名称 */
@Excel(name = "名称")
@ApiModelProperty("名称")
private String name;
}

View File

@ -21,10 +21,11 @@
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="name" column="name" />
</resultMap>
<sql id="selectDeviceInformationTargetpestsVo">
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
</sql>
<select id="selectDeviceInformationTargetpestsList" parameterType="DeviceInformationTargetpests" resultMap="DeviceInformationTargetpestsResult">
@ -40,6 +41,7 @@
<if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
<if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
<if test="dockingMethod != null and dockingMethod != ''"> and docking_method = #{dockingMethod}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
</where>
</select>
@ -66,6 +68,7 @@
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="name != null">name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceBrand != null">#{deviceBrand},</if>
@ -83,6 +86,7 @@
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="name != null">#{name},</if>
</trim>
</insert>
@ -104,6 +108,7 @@
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="name != null">name = #{name},</if>
</trim>
where id = #{id}
</update>