虫情设备实时数据
This commit is contained in:
parent
88d15bf724
commit
f0390eba11
@ -0,0 +1,118 @@
|
||||
package com.fastbee.deviceData.domain;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 虫情设备实时数据对象 iot_device_worms_realtime
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-11-07
|
||||
*/
|
||||
@ApiModel(value = "DeviceWormsRealtime",description = "虫情设备实时数据 iot_device_worms_realtime")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DeviceWormsRealtime extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 设备编号 */
|
||||
@Excel(name = "设备编号")
|
||||
@ApiModelProperty("设备编号")
|
||||
private String deviceAddr;
|
||||
|
||||
/** 降雨状态 */
|
||||
@Excel(name = "降雨状态")
|
||||
@ApiModelProperty("降雨状态")
|
||||
private String rain;
|
||||
|
||||
/** 杀虫挡板(0:关闭;1:打开) */
|
||||
@Excel(name = "杀虫挡板", readConverterExp = "0=:关闭;1:打开")
|
||||
@ApiModelProperty("杀虫挡板")
|
||||
private String wormFlap;
|
||||
|
||||
/** 杀虫仓温度 */
|
||||
@Excel(name = "杀虫仓温度")
|
||||
@ApiModelProperty("杀虫仓温度")
|
||||
private String insecticideTem;
|
||||
|
||||
/** 震动装置(0:关闭;1:打开) */
|
||||
@Excel(name = "震动装置", readConverterExp = "0=:关闭;1:打开")
|
||||
@ApiModelProperty("震动装置")
|
||||
private String shake;
|
||||
|
||||
/** 经度 */
|
||||
@Excel(name = "经度")
|
||||
@ApiModelProperty("经度")
|
||||
private String lng;
|
||||
|
||||
/** 烘干挡板(0:关闭;1:打开) */
|
||||
@Excel(name = "烘干挡板", readConverterExp = "0=:关闭;1:打开")
|
||||
@ApiModelProperty("烘干挡板")
|
||||
private String dryingFlap;
|
||||
|
||||
/** 杀虫控制(0:关闭;1:打开) */
|
||||
@Excel(name = "杀虫控制", readConverterExp = "0=:关闭;1:打开")
|
||||
@ApiModelProperty("杀虫控制")
|
||||
private String insecticide;
|
||||
|
||||
/** 移虫挡板(0:关闭;1:打开) */
|
||||
@Excel(name = "移虫挡板", readConverterExp = "0=:关闭;1:打开")
|
||||
@ApiModelProperty("移虫挡板")
|
||||
private String moveWorm;
|
||||
|
||||
/** 运行模式(1:自动;0:手动) */
|
||||
@Excel(name = "运行模式", readConverterExp = "1=:自动;0:手动")
|
||||
@ApiModelProperty("运行模式")
|
||||
private String mode;
|
||||
|
||||
/** 烘干控制(0:关闭;1:打开) */
|
||||
@Excel(name = "烘干控制", readConverterExp = "0=:关闭;1:打开")
|
||||
@ApiModelProperty("烘干控制")
|
||||
private String drying;
|
||||
|
||||
/** 虫雨挡板(0:关闭;1:打开) */
|
||||
@Excel(name = "虫雨挡板", readConverterExp = "0=:关闭;1:打开")
|
||||
@ApiModelProperty("虫雨挡板")
|
||||
private String rainFlap;
|
||||
|
||||
/** 诱虫灯状态(0:关闭;1:打开) */
|
||||
@Excel(name = "诱虫灯状态", readConverterExp = "0=:关闭;1:打开")
|
||||
@ApiModelProperty("诱虫灯状态")
|
||||
private String attractWorm;
|
||||
|
||||
/** 光照度 */
|
||||
@Excel(name = "光照度")
|
||||
@ApiModelProperty("光照度")
|
||||
private String illum;
|
||||
|
||||
/** 烘干仓温度 */
|
||||
@Excel(name = "烘干仓温度")
|
||||
@ApiModelProperty("烘干仓温度")
|
||||
private String dryingTem;
|
||||
|
||||
/** 纬度 */
|
||||
@Excel(name = "纬度")
|
||||
@ApiModelProperty("纬度")
|
||||
private String lat;
|
||||
|
||||
/** 补光灯(0:关闭;1:打开) */
|
||||
@Excel(name = "补光灯", readConverterExp = "0=:关闭;1:打开")
|
||||
@ApiModelProperty("补光灯")
|
||||
private String fillLight;
|
||||
|
||||
/** 设备状态(online/offline) */
|
||||
@Excel(name = "设备状态", readConverterExp = "o=nline/offline")
|
||||
@ApiModelProperty("设备状态")
|
||||
private String status;
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.fastbee.deviceData.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.deviceData.domain.DeviceWormsRealtime;
|
||||
|
||||
/**
|
||||
* 虫情设备实时数据Mapper接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-11-07
|
||||
*/
|
||||
public interface DeviceWormsRealtimeMapper
|
||||
{
|
||||
/**
|
||||
* 查询虫情设备实时数据
|
||||
*
|
||||
* @param id 虫情设备实时数据主键
|
||||
* @return 虫情设备实时数据
|
||||
*/
|
||||
public DeviceWormsRealtime selectDeviceWormsRealtimeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询虫情设备实时数据列表
|
||||
*
|
||||
* @param deviceWormsRealtime 虫情设备实时数据
|
||||
* @return 虫情设备实时数据集合
|
||||
*/
|
||||
public List<DeviceWormsRealtime> selectDeviceWormsRealtimeList(DeviceWormsRealtime deviceWormsRealtime);
|
||||
|
||||
/**
|
||||
* 新增虫情设备实时数据
|
||||
*
|
||||
* @param deviceWormsRealtime 虫情设备实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDeviceWormsRealtime(DeviceWormsRealtime deviceWormsRealtime);
|
||||
|
||||
/**
|
||||
* 修改虫情设备实时数据
|
||||
*
|
||||
* @param deviceWormsRealtime 虫情设备实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDeviceWormsRealtime(DeviceWormsRealtime deviceWormsRealtime);
|
||||
|
||||
/**
|
||||
* 删除虫情设备实时数据
|
||||
*
|
||||
* @param id 虫情设备实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeviceWormsRealtimeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除虫情设备实时数据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeviceWormsRealtimeByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.fastbee.deviceData.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.deviceData.domain.DeviceWormsRealtime;
|
||||
|
||||
/**
|
||||
* 虫情设备实时数据Service接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-11-07
|
||||
*/
|
||||
public interface IDeviceWormsRealtimeService
|
||||
{
|
||||
/**
|
||||
* 查询虫情设备实时数据
|
||||
*
|
||||
* @param id 虫情设备实时数据主键
|
||||
* @return 虫情设备实时数据
|
||||
*/
|
||||
public DeviceWormsRealtime selectDeviceWormsRealtimeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询虫情设备实时数据列表
|
||||
*
|
||||
* @param deviceWormsRealtime 虫情设备实时数据
|
||||
* @return 虫情设备实时数据集合
|
||||
*/
|
||||
public List<DeviceWormsRealtime> selectDeviceWormsRealtimeList(DeviceWormsRealtime deviceWormsRealtime);
|
||||
|
||||
/**
|
||||
* 新增虫情设备实时数据
|
||||
*
|
||||
* @param deviceWormsRealtime 虫情设备实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDeviceWormsRealtime(DeviceWormsRealtime deviceWormsRealtime);
|
||||
|
||||
/**
|
||||
* 修改虫情设备实时数据
|
||||
*
|
||||
* @param deviceWormsRealtime 虫情设备实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDeviceWormsRealtime(DeviceWormsRealtime deviceWormsRealtime);
|
||||
|
||||
/**
|
||||
* 批量删除虫情设备实时数据
|
||||
*
|
||||
* @param ids 需要删除的虫情设备实时数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeviceWormsRealtimeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除虫情设备实时数据信息
|
||||
*
|
||||
* @param id 虫情设备实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeviceWormsRealtimeById(Long id);
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.fastbee.deviceData.service.imp;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fastbee.deviceData.mapper.DeviceWormsRealtimeMapper;
|
||||
import com.fastbee.deviceData.domain.DeviceWormsRealtime;
|
||||
import com.fastbee.deviceData.service.IDeviceWormsRealtimeService;
|
||||
|
||||
/**
|
||||
* 虫情设备实时数据Service业务层处理
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-11-07
|
||||
*/
|
||||
@Service
|
||||
public class DeviceWormsRealtimeServiceImpl implements IDeviceWormsRealtimeService
|
||||
{
|
||||
@Autowired
|
||||
private DeviceWormsRealtimeMapper deviceWormsRealtimeMapper;
|
||||
|
||||
/**
|
||||
* 查询虫情设备实时数据
|
||||
*
|
||||
* @param id 虫情设备实时数据主键
|
||||
* @return 虫情设备实时数据
|
||||
*/
|
||||
@Override
|
||||
public DeviceWormsRealtime selectDeviceWormsRealtimeById(Long id)
|
||||
{
|
||||
return deviceWormsRealtimeMapper.selectDeviceWormsRealtimeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询虫情设备实时数据列表
|
||||
*
|
||||
* @param deviceWormsRealtime 虫情设备实时数据
|
||||
* @return 虫情设备实时数据
|
||||
*/
|
||||
@Override
|
||||
public List<DeviceWormsRealtime> selectDeviceWormsRealtimeList(DeviceWormsRealtime deviceWormsRealtime)
|
||||
{
|
||||
return deviceWormsRealtimeMapper.selectDeviceWormsRealtimeList(deviceWormsRealtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增虫情设备实时数据
|
||||
*
|
||||
* @param deviceWormsRealtime 虫情设备实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDeviceWormsRealtime(DeviceWormsRealtime deviceWormsRealtime)
|
||||
{
|
||||
return deviceWormsRealtimeMapper.insertDeviceWormsRealtime(deviceWormsRealtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改虫情设备实时数据
|
||||
*
|
||||
* @param deviceWormsRealtime 虫情设备实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDeviceWormsRealtime(DeviceWormsRealtime deviceWormsRealtime)
|
||||
{
|
||||
return deviceWormsRealtimeMapper.updateDeviceWormsRealtime(deviceWormsRealtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除虫情设备实时数据
|
||||
*
|
||||
* @param ids 需要删除的虫情设备实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDeviceWormsRealtimeByIds(Long[] ids)
|
||||
{
|
||||
return deviceWormsRealtimeMapper.deleteDeviceWormsRealtimeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除虫情设备实时数据信息
|
||||
*
|
||||
* @param id 虫情设备实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDeviceWormsRealtimeById(Long id)
|
||||
{
|
||||
return deviceWormsRealtimeMapper.deleteDeviceWormsRealtimeById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
<?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.fastbee.deviceData.mapper.DeviceWormsRealtimeMapper">
|
||||
|
||||
<resultMap type="DeviceWormsRealtime" id="DeviceWormsRealtimeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="deviceAddr" column="device_addr" />
|
||||
<result property="rain" column="rain" />
|
||||
<result property="wormFlap" column="worm_flap" />
|
||||
<result property="insecticideTem" column="insecticide_tem" />
|
||||
<result property="shake" column="shake" />
|
||||
<result property="lng" column="lng" />
|
||||
<result property="dryingFlap" column="drying_flap" />
|
||||
<result property="insecticide" column="insecticide" />
|
||||
<result property="moveWorm" column="move_worm" />
|
||||
<result property="mode" column="mode" />
|
||||
<result property="drying" column="drying" />
|
||||
<result property="rainFlap" column="rain_flap" />
|
||||
<result property="attractWorm" column="attract_worm" />
|
||||
<result property="illum" column="illum" />
|
||||
<result property="dryingTem" column="drying_tem" />
|
||||
<result property="lat" column="lat" />
|
||||
<result property="fillLight" column="fill_light" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeviceWormsRealtimeVo">
|
||||
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 from iot_device_worms_realtime
|
||||
</sql>
|
||||
|
||||
<select id="selectDeviceWormsRealtimeList" parameterType="DeviceWormsRealtime" resultMap="DeviceWormsRealtimeResult">
|
||||
<include refid="selectDeviceWormsRealtimeVo"/>
|
||||
<where>
|
||||
<if test="deviceAddr != null and deviceAddr != ''"> and device_addr = #{deviceAddr}</if>
|
||||
<if test="rain != null and rain != ''"> and rain = #{rain}</if>
|
||||
<if test="wormFlap != null and wormFlap != ''"> and worm_flap = #{wormFlap}</if>
|
||||
<if test="insecticideTem != null and insecticideTem != ''"> and insecticide_tem = #{insecticideTem}</if>
|
||||
<if test="shake != null and shake != ''"> and shake = #{shake}</if>
|
||||
<if test="lng != null and lng != ''"> and lng = #{lng}</if>
|
||||
<if test="dryingFlap != null and dryingFlap != ''"> and drying_flap = #{dryingFlap}</if>
|
||||
<if test="insecticide != null and insecticide != ''"> and insecticide = #{insecticide}</if>
|
||||
<if test="moveWorm != null and moveWorm != ''"> and move_worm = #{moveWorm}</if>
|
||||
<if test="mode != null and mode != ''"> and mode = #{mode}</if>
|
||||
<if test="drying != null and drying != ''"> and drying = #{drying}</if>
|
||||
<if test="rainFlap != null and rainFlap != ''"> and rain_flap = #{rainFlap}</if>
|
||||
<if test="attractWorm != null and attractWorm != ''"> and attract_worm = #{attractWorm}</if>
|
||||
<if test="illum != null and illum != ''"> and illum = #{illum}</if>
|
||||
<if test="dryingTem != null and dryingTem != ''"> and drying_tem = #{dryingTem}</if>
|
||||
<if test="lat != null and lat != ''"> and lat = #{lat}</if>
|
||||
<if test="fillLight != null and fillLight != ''"> and fill_light = #{fillLight}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDeviceWormsRealtimeById" parameterType="Long" resultMap="DeviceWormsRealtimeResult">
|
||||
<include refid="selectDeviceWormsRealtimeVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDeviceWormsRealtime" parameterType="DeviceWormsRealtime" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into iot_device_worms_realtime
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceAddr != null">device_addr,</if>
|
||||
<if test="rain != null">rain,</if>
|
||||
<if test="wormFlap != null">worm_flap,</if>
|
||||
<if test="insecticideTem != null">insecticide_tem,</if>
|
||||
<if test="shake != null">shake,</if>
|
||||
<if test="lng != null">lng,</if>
|
||||
<if test="dryingFlap != null">drying_flap,</if>
|
||||
<if test="insecticide != null">insecticide,</if>
|
||||
<if test="moveWorm != null">move_worm,</if>
|
||||
<if test="mode != null">mode,</if>
|
||||
<if test="drying != null">drying,</if>
|
||||
<if test="rainFlap != null">rain_flap,</if>
|
||||
<if test="attractWorm != null">attract_worm,</if>
|
||||
<if test="illum != null">illum,</if>
|
||||
<if test="dryingTem != null">drying_tem,</if>
|
||||
<if test="lat != null">lat,</if>
|
||||
<if test="fillLight != null">fill_light,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceAddr != null">#{deviceAddr},</if>
|
||||
<if test="rain != null">#{rain},</if>
|
||||
<if test="wormFlap != null">#{wormFlap},</if>
|
||||
<if test="insecticideTem != null">#{insecticideTem},</if>
|
||||
<if test="shake != null">#{shake},</if>
|
||||
<if test="lng != null">#{lng},</if>
|
||||
<if test="dryingFlap != null">#{dryingFlap},</if>
|
||||
<if test="insecticide != null">#{insecticide},</if>
|
||||
<if test="moveWorm != null">#{moveWorm},</if>
|
||||
<if test="mode != null">#{mode},</if>
|
||||
<if test="drying != null">#{drying},</if>
|
||||
<if test="rainFlap != null">#{rainFlap},</if>
|
||||
<if test="attractWorm != null">#{attractWorm},</if>
|
||||
<if test="illum != null">#{illum},</if>
|
||||
<if test="dryingTem != null">#{dryingTem},</if>
|
||||
<if test="lat != null">#{lat},</if>
|
||||
<if test="fillLight != null">#{fillLight},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDeviceWormsRealtime" parameterType="DeviceWormsRealtime">
|
||||
update iot_device_worms_realtime
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deviceAddr != null">device_addr = #{deviceAddr},</if>
|
||||
<if test="rain != null">rain = #{rain},</if>
|
||||
<if test="wormFlap != null">worm_flap = #{wormFlap},</if>
|
||||
<if test="insecticideTem != null">insecticide_tem = #{insecticideTem},</if>
|
||||
<if test="shake != null">shake = #{shake},</if>
|
||||
<if test="lng != null">lng = #{lng},</if>
|
||||
<if test="dryingFlap != null">drying_flap = #{dryingFlap},</if>
|
||||
<if test="insecticide != null">insecticide = #{insecticide},</if>
|
||||
<if test="moveWorm != null">move_worm = #{moveWorm},</if>
|
||||
<if test="mode != null">mode = #{mode},</if>
|
||||
<if test="drying != null">drying = #{drying},</if>
|
||||
<if test="rainFlap != null">rain_flap = #{rainFlap},</if>
|
||||
<if test="attractWorm != null">attract_worm = #{attractWorm},</if>
|
||||
<if test="illum != null">illum = #{illum},</if>
|
||||
<if test="dryingTem != null">drying_tem = #{dryingTem},</if>
|
||||
<if test="lat != null">lat = #{lat},</if>
|
||||
<if test="fillLight != null">fill_light = #{fillLight},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDeviceWormsRealtimeById" parameterType="Long">
|
||||
delete from iot_device_worms_realtime where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDeviceWormsRealtimeByIds" parameterType="String">
|
||||
delete from iot_device_worms_realtime where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user