微信小程序长者端显示温湿度
This commit is contained in:
parent
61eb8ba09b
commit
b52564dd90
|
|
@ -2,6 +2,10 @@ package com.nu.modules.yiweilian.humid.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.yiweilian.humid.entity.HumidDevice;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface HumidDeviceMapper extends BaseMapper<HumidDevice> {
|
||||
List<HumidDevice> queryByNuIds(@Param("nuIds") String nuIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,40 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.yiweilian.humid.mapper.HumidDeviceMapper">
|
||||
|
||||
<select id="queryByNuIds" parameterType="string" resultType="com.nu.modules.yiweilian.humid.entity.HumidDevice">
|
||||
select
|
||||
a.id,
|
||||
a.sn,
|
||||
b.device_name as deviceName,
|
||||
b.device_type as deviceTypes,
|
||||
a.reporting_interval as reportingInterval,
|
||||
a.record_interval as recordInterval,
|
||||
a.history_report_time as historyReportTime,
|
||||
a.history_interval as historyInterval,
|
||||
a.temperature_high as temperatureHigh,
|
||||
a.temperature_low as temperatureLow,
|
||||
a.temperature_buffer as temperatureBuffer,
|
||||
a.humidity_high as humidityHigh,
|
||||
a.humidity_low as humidityLow,
|
||||
a.humidity_buffer as humidityBuffer,
|
||||
a.iz_outages as izOutages,
|
||||
a.iz_low_battery as izLowBattery,
|
||||
a.iz_online as izOnline,
|
||||
a.time_code as timeCode,
|
||||
a.temperature,
|
||||
a.humidity,
|
||||
a.status,
|
||||
a.reporting_time as reportingTime,
|
||||
a.electricity,
|
||||
b.nu_id as nuId
|
||||
from nu_iot_yiweilian_humid_device a
|
||||
inner join nu_iot_device_preview b on a.sn = b.sn
|
||||
where b.device_status != '损坏'
|
||||
and b.nu_id in
|
||||
<foreach item="nuId" index="index" collection="nuIds.split(',')"
|
||||
open="(" separator="," close=")">
|
||||
#{nuId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -20,10 +20,11 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
|
||||
@Override
|
||||
public List<HumidDeviceEntity> queryByNuIds(String nuids) {
|
||||
QueryWrapper<HumidDevice> qw = new QueryWrapper<>();
|
||||
qw.in("nu_id",nuids.split(","));
|
||||
qw.orderByDesc("reporting_time");
|
||||
List<HumidDevice> list = baseMapper.selectList(qw);
|
||||
// QueryWrapper<HumidDevice> qw = new QueryWrapper<>();
|
||||
// qw.in("nu_id",nuids.split(","));
|
||||
// qw.orderByDesc("reporting_time");
|
||||
// List<HumidDevice> list = baseMapper.selectList(qw);
|
||||
List<HumidDevice> list = baseMapper.queryByNuIds(nuids);
|
||||
return BeanUtil.copyToList(list,HumidDeviceEntity.class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue