|
|
@@ -377,4 +377,17 @@ public interface IotDeviceMapper extends BaseMapperX<IotDeviceDO> {
|
|
|
// 第一个参数传null,仅使用wrapper作为更新条件和字段,符合原逻辑
|
|
|
return update(null, lambdaUpdateWrapper);
|
|
|
}
|
|
|
+
|
|
|
+ default int updateZhbd(IotDeviceDO iotDeviceDO) {
|
|
|
+ // 非空校验保留
|
|
|
+ Assert.notNull(iotDeviceDO);
|
|
|
+ LambdaUpdateWrapper<IotDeviceDO> lambdaUpdateWrapper = new LambdaUpdateWrapper<IotDeviceDO>()
|
|
|
+ // 逐个设置更新字段,MyBatis-Plus自动处理类型和SQL拼接
|
|
|
+ .set(IotDeviceDO::getVehicleName, iotDeviceDO.getVehicleName())
|
|
|
+ .set(IotDeviceDO::getCarOnline, iotDeviceDO.getCarOnline())
|
|
|
+ // 条件匹配:根据主键ID更新(原CAS逻辑保留)
|
|
|
+ .eq(IotDeviceDO::getId, iotDeviceDO.getId());
|
|
|
+ // 第一个参数传null,仅使用wrapper作为更新条件和字段,符合原逻辑
|
|
|
+ return update(null, lambdaUpdateWrapper);
|
|
|
+ }
|
|
|
}
|