提交 9c7f7f34 authored 作者: 林业通's avatar 林业通

设备主页加房间名称

上级 ee53c280
...@@ -322,7 +322,7 @@ public class ShDeviceController { ...@@ -322,7 +322,7 @@ public class ShDeviceController {
return R.error("缺少参数"); return R.error("缺少参数");
} }
ShDeviceEntity device = otherShDeviceService.getById(deviceId); Map<String, Object> device = otherShDeviceService.index(deviceId);
ShDeviceDataEntity dataEntity = shDeviceDataService.getOne(new QueryWrapper<ShDeviceDataEntity>().eq("device_id", deviceId)); ShDeviceDataEntity dataEntity = shDeviceDataService.getOne(new QueryWrapper<ShDeviceDataEntity>().eq("device_id", deviceId));
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("device", device); map.put("device", device);
......
...@@ -8,6 +8,7 @@ import tech.glinfo.enbao.modules.sh.entity.ShDeviceDataEntity; ...@@ -8,6 +8,7 @@ import tech.glinfo.enbao.modules.sh.entity.ShDeviceDataEntity;
import tech.glinfo.enbao.modules.sh.entity.ShDeviceEntity; import tech.glinfo.enbao.modules.sh.entity.ShDeviceEntity;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author linyetong * @author linyetong
...@@ -31,4 +32,9 @@ public interface OtherShDeviceDao extends BaseMapper<ShDeviceEntity> { ...@@ -31,4 +32,9 @@ public interface OtherShDeviceDao extends BaseMapper<ShDeviceEntity> {
" </script>") " </script>")
void deleteRelation(Integer id); void deleteRelation(Integer id);
@Select("<script>" +
"SELECT a.id, a.numbering, a.numbering_flag numberingFlag, a.name, a.online_status onlineStatus, a.pic, a.spare_one spareOne, a.spare_two spareTwo, b.name roomName FROM sh_device a LEFT JOIN sh_family_room b ON a.room_id = b.id WHERE a.id = ${id}" +
" </script>")
Map<String, Object> index(Integer id);
} }
...@@ -39,4 +39,5 @@ public interface OtherShDeviceService extends IService<ShDeviceEntity> { ...@@ -39,4 +39,5 @@ public interface OtherShDeviceService extends IService<ShDeviceEntity> {
List<ShDeviceEntity> getDeviceByFlag(Integer userId); List<ShDeviceEntity> getDeviceByFlag(Integer userId);
Map<String, Object> index(Integer id);
} }
...@@ -191,4 +191,9 @@ public class OtherShDeviceServiceImpl extends ServiceImpl<OtherShDeviceDao, ShDe ...@@ -191,4 +191,9 @@ public class OtherShDeviceServiceImpl extends ServiceImpl<OtherShDeviceDao, ShDe
return this.baseMapper.getDeviceByFlag(userId); return this.baseMapper.getDeviceByFlag(userId);
} }
@Override
public Map<String, Object> index(Integer id) {
return this.baseMapper.index(id);
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论