app设备类型查询

This commit is contained in:
2025-07-09 13:41:08 +08:00
parent f41bb097fd
commit 908ca6753e
13 changed files with 116 additions and 13 deletions

View File

@ -107,4 +107,5 @@ public class Device extends TenantEntity {
*/
private String createByName;
private Long bindingUserId;
}

View File

@ -27,4 +27,9 @@ public class AppDeviceVo {
* 通讯方式 0:4G;1:蓝牙
*/
private Integer communicationMode;
/**
* 设备图片
*/
private String devicePic;
}

View File

@ -90,4 +90,5 @@ public interface DeviceService extends IService<Device> {
int bindDevice(AppDeviceBo bo);
int unBindDevice(Long id);
}

View File

@ -496,7 +496,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
deviceUpdateWrapper.eq("id", device.getId())
.set("binding_status", BindingStatusEnum.BOUND.getCode())
.set("binding_user_id",userId);
return baseMapper.update(null, qw);
return baseMapper.update(null, deviceUpdateWrapper);
}else{
throw new RuntimeException("通讯方式错误");
}
@ -509,11 +509,10 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
if(device == null){
throw new RuntimeException("请先将设备入库!!!");
}
// DeviceType deviceType = deviceTypeMapper.selectById(device.getDeviceType());
// String mode = deviceType.getCommunicationMode();
UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>();
deviceUpdateWrapper.eq("id", device.getId())
.set("binding_status", BindingStatusEnum.UNBOUND.getCode());
return baseMapper.update(null, deviceUpdateWrapper);
}

View File

@ -96,9 +96,12 @@
<select id="queryAppDeviceList" resultType="com.fuyuanshen.equipment.domain.vo.AppDeviceVo">
select
d.id, d.device_name, d.device_mac, d.device_sn,
d.device_imei, d.device_mac ,dt.communication_mode
d.device_imei, d.device_mac ,dt.communication_mode,d.device_pic
from device d inner join device_type dt on d.device_type = dt.id
where d.binding_user_id = #{criteria.bindingUserId}
where d.binding_user_id = #{criteria.bindingUserId} and d.binding_status = 1
<if test="criteria.deviceType != null">
and d.device_type = #{criteria.deviceType}
</if>
</select>
<!-- 获取分配设备的客户 -->