You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
3.0 KiB
119 lines
3.0 KiB
|
2 weeks ago
|
<?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.data.emqx.mapper.DeviceDataMapper">
|
||
|
|
|
||
|
|
<!-- 统计称重&标签数据数量 -->
|
||
|
|
<select id="countWeightRfidByDeviceIdAndSeqNum" resultType="int">
|
||
|
|
select count(*)
|
||
|
|
from emqx_device_weight_rfid
|
||
|
|
where device_id = #{deviceId} and seq_num = #{seqNum}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<!-- 插入称重&标签数据 -->
|
||
|
|
<insert id="insertWeightRfid" parameterType="com.data.emqx.domain.DeviceWeightRfid" >
|
||
|
|
insert into emqx_device_weight_rfid (
|
||
|
|
id,
|
||
|
|
device_id,
|
||
|
|
seq_num,
|
||
|
|
send_time,
|
||
|
|
weight,
|
||
|
|
rfid,
|
||
|
|
flag,
|
||
|
|
create_time,
|
||
|
|
update_time)
|
||
|
|
values (
|
||
|
|
#{id},
|
||
|
|
#{deviceId},
|
||
|
|
#{seqNum},
|
||
|
|
#{sendTime},
|
||
|
|
#{weight},
|
||
|
|
#{rfid},
|
||
|
|
#{flag},
|
||
|
|
#{createTime},
|
||
|
|
#{updateTime}
|
||
|
|
)
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<!-- 统计告警数据数量 -->
|
||
|
|
<select id="countAlarmByDeviceIdAndSeqNum" resultType="int">
|
||
|
|
select count(*)
|
||
|
|
from emqx_device_alarm
|
||
|
|
where device_id = #{deviceId} and seq_num = #{seqNum}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<!-- 插入告警数据 -->
|
||
|
|
<insert id="insertAlarm" parameterType="com.data.emqx.domain.DeviceAlarm" >
|
||
|
|
insert into emqx_device_alarm (
|
||
|
|
id,
|
||
|
|
device_id,
|
||
|
|
seq_num,
|
||
|
|
send_time,
|
||
|
|
uwb,
|
||
|
|
flag,
|
||
|
|
create_time,
|
||
|
|
update_time)
|
||
|
|
values (
|
||
|
|
#{id},
|
||
|
|
#{deviceId},
|
||
|
|
#{seqNum},
|
||
|
|
#{sendTime},
|
||
|
|
#{uwb},
|
||
|
|
#{flag},
|
||
|
|
#{createTime},
|
||
|
|
#{updateTime}
|
||
|
|
)
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<!-- 统计心跳数据数量 -->
|
||
|
|
<select id="countHeartByDeviceIdAndSendTime" resultType="int">
|
||
|
|
select count(*)
|
||
|
|
from emqx_device_heart
|
||
|
|
where device_id = #{deviceId} and send_time = #{sendTime}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<!-- 插入心跳数据 -->
|
||
|
|
<insert id="insertHeart" parameterType="com.data.emqx.domain.DeviceHeart" >
|
||
|
|
insert into emqx_device_heart (
|
||
|
|
id,
|
||
|
|
device_id,
|
||
|
|
sys_vol,
|
||
|
|
net_rssi,
|
||
|
|
send_time,
|
||
|
|
flag,
|
||
|
|
create_time,
|
||
|
|
update_time)
|
||
|
|
values (
|
||
|
|
#{id},
|
||
|
|
#{deviceId},
|
||
|
|
#{sysVol},
|
||
|
|
#{netRSSI},
|
||
|
|
#{sendTime},
|
||
|
|
#{flag},
|
||
|
|
#{createTime},
|
||
|
|
#{updateTime}
|
||
|
|
)
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<!-- 插入告警UWB数据 -->
|
||
|
|
<insert id="insertAlarmUwb" parameterType="com.data.emqx.domain.DeviceAlarmUwb" >
|
||
|
|
insert into emqx_device_alarm_uwb (
|
||
|
|
id,
|
||
|
|
alarm_id,
|
||
|
|
uwb_id,
|
||
|
|
dist,
|
||
|
|
create_time,
|
||
|
|
update_time)
|
||
|
|
values (
|
||
|
|
#{id},
|
||
|
|
#{alarmId},
|
||
|
|
#{uwbId},
|
||
|
|
#{dist},
|
||
|
|
#{createTime},
|
||
|
|
#{updateTime}
|
||
|
|
)
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
</mapper>
|