|
@@ -2,8 +2,8 @@ package com.zy.bms.service;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.zy.bms.mapper.UserDeviceRelationMapper;
|
|
|
-import com.zy.bms.model.UserDeviceRelation;
|
|
|
+import com.zy.bms.mapper.DeviceDynamicMapper;
|
|
|
+import com.zy.bms.model.DeviceDynamic;
|
|
|
import com.zy.bms.common.vo.DeviceRelationVo;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -18,7 +18,7 @@ import java.util.List;
|
|
|
* Create on 2020/4/10
|
|
|
*/
|
|
|
@Service
|
|
|
-public class RelationService extends ServiceImpl<UserDeviceRelationMapper, UserDeviceRelation> {
|
|
|
+public class RelationService extends ServiceImpl<DeviceDynamicMapper, DeviceDynamic> {
|
|
|
|
|
|
@Resource
|
|
|
private DeviceService deviceService;
|
|
@@ -31,7 +31,7 @@ public class RelationService extends ServiceImpl<UserDeviceRelationMapper, UserD
|
|
|
* @param deviceName 设备名称
|
|
|
*/
|
|
|
public void saveEntity(String userId, String deviceNum, String deviceName) {
|
|
|
- UserDeviceRelation entity = new UserDeviceRelation();
|
|
|
+ DeviceDynamic entity = new DeviceDynamic();
|
|
|
entity.setUserId(userId);
|
|
|
entity.setDeviceNum(deviceNum);
|
|
|
baseMapper.insert(entity);
|
|
@@ -44,7 +44,7 @@ public class RelationService extends ServiceImpl<UserDeviceRelationMapper, UserD
|
|
|
* @param deviceNum 设备号
|
|
|
*/
|
|
|
public void unbind(String deviceNum, String userId) {
|
|
|
- QueryWrapper<UserDeviceRelation> queryWrapper = new QueryWrapper<>();
|
|
|
+ QueryWrapper<DeviceDynamic> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("deviceNum", deviceNum);
|
|
|
queryWrapper.eq("userId", userId);
|
|
|
baseMapper.delete(queryWrapper);
|