设备信息

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; 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.controller.BaseController;
import com.fastbee.common.core.domain.AjaxResult; 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.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -15,14 +18,29 @@ public class DeviceInfoController extends BaseController {
@Autowired @Autowired
private DeviceInformationWormsMapper deviceInformationWormsMapper; 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") @GetMapping("/wormList")
public AjaxResult getDeviceList() { 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") @GetMapping("/weatherList")
public AjaxResult getWeatherList() { 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") @GetMapping("/soilList")
public AjaxResult getSoilList() { 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") @GetMapping("/lightList")
public AjaxResult getLightList() { 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 io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; 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.annotation.Excel;
import com.fastbee.common.core.domain.BaseEntity; import com.fastbee.common.core.domain.BaseEntity;
@ -14,70 +12,75 @@ import com.fastbee.common.core.domain.BaseEntity;
* 靶标害虫设备基础信息对象 iot_device_information_targetPests * 靶标害虫设备基础信息对象 iot_device_information_targetPests
* *
* @author kerwincui * @author kerwincui
* @date 2024-11-18 * @date 2024-11-27
*/ */
@ApiModel(value = "DeviceInformationTargetpests",description = "靶标害虫设备基础信息 iot_device_information_targetPests") @ApiModel(value = "DeviceInformationTargetpests",description = "靶标害虫设备基础信息 iot_device_information_targetPests")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@TableName("iot_device_information_targetPests") @TableName("iot_device_information_targetPests")
public class DeviceInformationTargetpests extends BaseEntity public class DeviceInformationTargetpests extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 主键 */ /** 主键 */
private Long id; private Long id;
/** 设备品牌 */ /** 设备品牌 */
@Excel(name = "设备品牌") @Excel(name = "设备品牌")
@ApiModelProperty("设备品牌") @ApiModelProperty("设备品牌")
private String deviceBrand; private String deviceBrand;
/** 类型 */ /** 类型 */
@Excel(name = "类型") @Excel(name = "类型")
@ApiModelProperty("类型") @ApiModelProperty("类型")
private String type; private String type;
/** 设备型号 */ /** 设备型号 */
@Excel(name = "设备型号") @Excel(name = "设备型号")
@ApiModelProperty("设备型号") @ApiModelProperty("设备型号")
private String deviceType; private String deviceType;
/** 供电 */ /** 供电 */
@Excel(name = "供电") @Excel(name = "供电")
@ApiModelProperty("供电") @ApiModelProperty("供电")
private String powerSupply; private String powerSupply;
/** 设备编码 */ /** 设备编码 */
@Excel(name = "设备编码") @Excel(name = "设备编码")
@ApiModelProperty("设备编码") @ApiModelProperty("设备编码")
private String deviceEncoding; private String deviceEncoding;
/** 地址码 */ /** 地址码 */
@Excel(name = "地址码") @Excel(name = "地址码")
@ApiModelProperty("地址码") @ApiModelProperty("地址码")
private String addressCode; private String addressCode;
/** 安装位置 */ /** 安装位置 */
@Excel(name = "安装位置") @Excel(name = "安装位置")
@ApiModelProperty("安装位置") @ApiModelProperty("安装位置")
private String installationLocation; private String installationLocation;
/** 经度 */ /** 经度 */
@Excel(name = "经度") @Excel(name = "经度")
@ApiModelProperty("经度") @ApiModelProperty("经度")
private String longitude; private String longitude;
/** 纬度 */ /** 纬度 */
@Excel(name = "纬度") @Excel(name = "纬度")
@ApiModelProperty("纬度") @ApiModelProperty("纬度")
private String latitude; private String latitude;
/** 对接方式 */ /** 对接方式 */
@Excel(name = "对接方式") @Excel(name = "对接方式")
@ApiModelProperty("对接方式") @ApiModelProperty("对接方式")
private String dockingMethod; private String dockingMethod;
/** 删除标志0代表存在2代表删除 */ /** 删除标志0代表存在2代表删除 */
private Integer delFlag; private Integer delFlag;
/** 名称 */
@Excel(name = "名称")
@ApiModelProperty("名称")
private String name;
} }

View File

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