设备在线率统计等
This commit is contained in:
@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
import com.fastbee.iot.model.ThingsModelItem.*;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
@ -18,6 +19,7 @@ import java.util.List;
|
||||
* @author kerwincui
|
||||
* @date 2021-12-16
|
||||
*/
|
||||
@Data
|
||||
public class DeviceShortOutput implements Serializable {
|
||||
public DeviceShortOutput(){
|
||||
this.stringList=new ArrayList<>();
|
||||
|
@ -65,7 +65,7 @@ public class QxtrTask {
|
||||
* 定时任务 更新设备在线状态
|
||||
*/
|
||||
public void updateDeviceStatus() throws Exception {
|
||||
// log.info("定时任务,更新设备在线状态");
|
||||
log.info("定时任务,更新设备在线状态");
|
||||
Device device = new Device();
|
||||
ArrayList<Map<String, Object>> resultList = new ArrayList<>();
|
||||
device.setProductId(136L);
|
||||
|
@ -39,6 +39,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="tel" column="tel" />
|
||||
<result property="caretaker" column="caretaker" />
|
||||
<result property="managementUnit" column="management_unit" />
|
||||
<result property="deviceBrand" column="device_brand" />
|
||||
<result property="deviceModel" column="device_model" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.fastbee.iot.model.DeviceShortOutput" id="DeviceShortResult">
|
||||
@ -370,7 +372,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
d.serial_number, d.management_unit, d.caretaker, d.tel,
|
||||
d.firmware_version, d.status, d.rssi,d.is_shadow,d.is_simulate ,d.location_way,d.things_model_value,
|
||||
d.network_address, d.network_ip, d.longitude, d.latitude, d.active_time, d.create_time, d.update_time,
|
||||
d.img_url,d.summary,d.remark,d.dev_params,p.guid from iot_device d
|
||||
d.img_url,d.summary,d.remark,d.dev_params,p.guid,d.device_brand,d.device_model from iot_device d
|
||||
left join iot_product p on p.product_id=d.product_id
|
||||
where device_id = #{deviceId}
|
||||
</select>
|
||||
@ -537,6 +539,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="managementUnit != null">management_unit,</if>
|
||||
<if test="caretaker != null">caretaker,</if>
|
||||
<if test="tel != null">tel,</if>
|
||||
<if test="deviceBrand != null">device_brand,</if>
|
||||
<if test="deviceModel != null">device_model,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||
@ -571,6 +575,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="managementUnit != null">#{managementUnit},</if>
|
||||
<if test="caretaker != null">#{caretaker},</if>
|
||||
<if test="tel != null">#{tel},</if>
|
||||
<if test="deviceBrand != null">#{deviceBrand},</if>
|
||||
<if test="deviceModel != null">#{deviceModel},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -630,6 +636,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="managementUnit != null">management_unit = #{managementUnit},</if>
|
||||
<if test="caretaker != null">caretaker = #{caretaker},</if>
|
||||
<if test="tel != null">tel = #{tel},</if>
|
||||
<if test="deviceBrand != null">#{deviceBrand},</if>
|
||||
<if test="deviceModel != null">#{deviceModel},</if>
|
||||
</trim>
|
||||
where device_id = #{deviceId}
|
||||
</update>
|
||||
@ -694,6 +702,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="managementUnit != null">management_unit = #{managementUnit},</if>
|
||||
<if test="caretaker != null">caretaker = #{caretaker},</if>
|
||||
<if test="tel != null">tel = #{tel},</if>
|
||||
<if test="deviceBrand != null">#{deviceBrand},</if>
|
||||
<if test="deviceModel != null">#{deviceModel},</if>
|
||||
</trim>
|
||||
where serial_number = #{serialNumber}
|
||||
</update>
|
||||
|
Reference in New Issue
Block a user