From 2f432f52c1cfb1567dadcf6e040c5d38b0a26a79 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期五, 28 十一月 2025 17:31:49 +0800
Subject: [PATCH] 数量检测配置页面
---
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DeviceIotRepository.java | 41 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DeviceIotRepository.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DeviceIotRepository.java
new file mode 100644
index 0000000..98d1329
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DeviceIotRepository.java
@@ -0,0 +1,41 @@
+package com.fzzy.igds.repository;
+
+import com.fzzy.igds.domain.DeviceIot;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * @Description
+ * @Author CZT
+ * @Date 2025/11/28 14:42
+ */
+@Service
+public interface DeviceIotRepository extends JpaRepository<DeviceIot, String>, JpaSpecificationExecutor<DeviceIot> {
+
+ /**
+ * 鏍规嵁缁勭粐缂栫爜鑾峰彇浠撳簱璐т綅淇℃伅
+ *
+ * @param companyId
+ * @return
+ */
+ @Query("from DeviceIot where companyId =:companyId order by id")
+ List<DeviceIot> getDeviceIotByCompanyId(@Param("companyId") String companyId);
+
+ /**
+ * 鏇存柊璁惧浣嶇疆
+ * @param deviceId
+ * @param posX
+ * @param posY
+ */
+ @Transactional
+ @Modifying
+ @Query("update DeviceIot set posX =:posX,posY =:posY where id =:deviceId")
+ void updatePos(@Param("deviceId") String deviceId, @Param("posX") Double posX, @Param("posY") Double posY);
+}
--
Gitblit v1.9.3